Ad Widget

Collapse

Does this still work?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rts
    Member
    • May 2007
    • 54

    #16
    You'll need the HTTP API.

    When you run it, you'll need to do:

    php /home/zabbix/bin/smsclickatell '+447123123123123' 'subject' 'message'

    and then it shouldn't give that undefined index 3 error.

    Comment

    • ccreamer
      Junior Member
      • Mar 2012
      • 9

      #17
      I am using this script and since I am in the US, we require 2 more pieces for the api to send correctly. We need MO=1 and FROM=<Two-Way Number Status provided by clickatell> appended at the end of the http line so it comes out looking like this:



      I was wondering if you have an option to add this into your script.

      Comment

      • calebwong
        Junior Member
        • Dec 2011
        • 10

        #18
        Hi All,

        I have created an account on "clickatell.com" and setup a HTTP api for testing. After that, I follow up the instructions on the wiki http://www.zabbix.com/wiki/howto/config/alerts/smsapi.

        When I try to test it, the below error is show:
        [PHP Parse error: syntax error, unexpected T_VARIABLE in /etc/zabbix/alertscripts/cli_sms_clickatell.php on line 22]
        The Line 22 is: [// The API key. Not used for mediaburst]

        Let me show what have done,
        1. create folder "/etc/zabbix/alertscripts", add "AlertScriptsPath=/etc/zabbix/alertscripts" into "/etc/zabbix/zabbix_server.conf"
        2. create a file call "cli_sms_clickatell.php" (copy from wiki)
        3. update these info which list at below,
        $service = 'clickatell';
        $apikey = "3333xxx";
        $user = "[email protected]";
        $password = "xxxxyyyy";
        $logfilelocation = "/var/log/zabbix-server/sms/";
        4. create a folder "/var/log/zabbix-server/sms/"
        5. grant 755 permission on,
        "/etc/zabbix/alertscripts/cli_sms_clickatell.php"
        "/var/log/zabbix-server/sms/"

        May I know, is anything I wrong?
        I have complete a test by "http://api.clickatell.com/http/sendmsg?user=caleb.wongxxx%40xxxx.com&password=xxx xyyyy&api_id=3333xxx&to=00012345678&text=Message", and received a SMS message.

        Thanks and Regards,
        Caleb

        Comment

        • calebwong
          Junior Member
          • Dec 2011
          • 10

          #19
          Originally posted by calebwong
          Hi All,

          I have created an account on "clickatell.com" and setup a HTTP api for testing. After that, I follow up the instructions on the wiki http://www.zabbix.com/wiki/howto/config/alerts/smsapi.

          When I try to test it, the below error is show:
          [PHP Parse error: syntax error, unexpected T_VARIABLE in /etc/zabbix/alertscripts/cli_sms_clickatell.php on line 22]
          The Line 22 is: [// The API key. Not used for mediaburst]

          Let me show what have done,
          1. create folder "/etc/zabbix/alertscripts", add "AlertScriptsPath=/etc/zabbix/alertscripts" into "/etc/zabbix/zabbix_server.conf"
          2. create a file call "cli_sms_clickatell.php" (copy from wiki)
          3. update these info which list at below,
          $service = 'clickatell';
          $apikey = "3333xxx";
          $user = "[email protected]";
          $password = "xxxxyyyy";
          $logfilelocation = "/var/log/zabbix-server/sms/";
          4. create a folder "/var/log/zabbix-server/sms/"
          5. grant 755 permission on,
          "/etc/zabbix/alertscripts/cli_sms_clickatell.php"
          "/var/log/zabbix-server/sms/"

          May I know, is anything I wrong?
          I have complete a test by "http://api.clickatell.com/http/sendmsg?user=caleb.wongxxx%40xxxx.com&password=xxx xyyyy&api_id=3333xxx&to=00012345678&text=Message", and received a SMS message.

          Thanks and Regards,
          Caleb
          It work fine now, let me show the changes,
          [-] i have made some mistake on "copy & paste" progress, some comments are jump to next row without "//" at the begin
          [-] I am using the Opensuse template as my testing environment, I need to install curl for php calling method by "zypper in php5-curl". Otherwise, "Fatal error: Call to undefined function: curl_init()" will occur.
          [-] add "date_default_timezone_set("Asia/Hong_Kong");" in "cli_sms_clickatell.php", if you have got a message like "PHP noteice: date_default_timezone_set(): xxxxxx is invalid in cli_sms_clickatell.php on line 18. PHP waning: date ()"

          Thanks all guys.

          Comment

          • mark.chan
            Member
            • Mar 2016
            • 35

            #20
            Since I found that the wiki page for setup clickatell is removed.
            Could anyone teach me how to setup a SMS with clickatell http api?

            Comment

            Working...