Hello,
Does anybody have got any expierence with Cardboardfish.com SMS sending integration to Zabbix custom scripts. At the moment my coding skills are weak.
And I have got until this:
Maybe someone has got any suggestions to get it moving?
Does anybody have got any expierence with Cardboardfish.com SMS sending integration to Zabbix custom scripts. At the moment my coding skills are weak.
And I have got until this:
Code:
#!/usr/bin/php
<?php
//UN = username
$UN = "username";
//P = password
$P = "password";
//System=H
$S = "H";
if (count($argv)<3) {
die ("Usage: ".$argv[0]." recipientmobilenumber \"message\"\n");
}
if ( $debug )
to = urllib.quote_plus(recipient(sys.argv[1]))
$DA = $argv[1];
$M = $argv[2];
$apiargs=array(
"UN" => $UN,
"P" => $P,
"DA" => $DA,
"SA" => $SA
"M" => $M);
$url = "http://sms1.cardboardfish.com:9001/HTTPSMS?";
$params = "";
foreach ($apiargs as $k=>$v) {
if ( $params != "" ) {
$params .= "&";
}
$params .= $k."=".urlencode($v);
}
$url .= $params;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url );
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
if ( $result === false ) {
?>
Comment