Ad Widget

Collapse

Zabbix service intration with CardboardFish.com SMS sending service.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Slesers
    Junior Member
    • Feb 2011
    • 11

    #1

    Zabbix service intration with CardboardFish.com SMS sending service.

    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:
    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 ) {
    
    
    ?>
    Maybe someone has got any suggestions to get it moving?
  • Slesers
    Junior Member
    • Feb 2011
    • 11

    #2
    Any idea maybe what I am doing wrong?

    Comment

    • Slesers
      Junior Member
      • Feb 2011
      • 11

      #3
      I found the solution for the problem. If someone needed here is the script. it's written in the PHP

      Code:
      #!/usr/bin/php
      <?php
      $DA         = $argv[1];
      $M          = $argv[2];
      
      
      $message=array(
          "DA"         => $DA,
          "M"          => $M);
      
      $url    = "http://sms1.cardboardfish.com:9001/HTTPSMS?S=H&UN=XXXXXX&P=XXXXXXX&SA=Zabbix&";
      $params    = "";
      
      foreach ($message 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);
      
      ?>

      Comment

      Working...