zabbix的工作短信脚本

时间:2014-11-22 16:03:20

标签: zabbix

是否有人可以提供从zabbix发送短信的工作脚本。我想使用免费服务提供商。我找不到任何有用的脚本。

2 个答案:

答案 0 :(得分:1)

您可以使用此脚本

#!/usr/bin/perl

print "content-type: text/html\n\n";
use CGI;
$cgi = new CGI;

$cel = $ARGV[0];
$title = $ARGV[1];
$msgx = $ARGV[2];

&enviasms;

# SOAP (Simple Object Access Protocol)
############################################

sub enviasms{ 

$dispatch = "send";
$account = "myaccount";
$code = "mypassword";
$msg = "$msgx";
$from = "Zabbix";
$to = "$cel";
$id = time();
$user = $id - 1;
$schedule = "";
$callbackOption = "";


use LWP::Simple;
#$result = get("http://system.human.com.br:8080/GatewayIntegration/msgSms.do?dispatch=send&account=$account&code=$cod e&msg=$msg&from=$from&to=$to&id=$id&schedule=$sche dule&callbackOption=$callbackOption");

if(!$result){
use strict;
use warnings;
open (my $fs, '>>', 'log');
print $fs "that is Error\n";
close $fs;
} else{
use strict;
use warnings;
open(my $fs, '>>','log');
print $fs "msg is: ";
print $fs $ARGV[2];
print $fs "::::>phone:";
print $fs $ARGV[0];
print $fs "\n";
close $fs;}}

答案 1 :(得分:0)

你可以查看不是免费但不昂贵的Pagerduty,它可以为Android和iPhone应用程序带来很大的价值,并且与Zabbix有很好的集成。

查看本指南: http://www.pagerduty.com/docs/guides/zabbix-integration-guide-2/