Ad Widget

Collapse

Does this still work?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nibb
    Member
    • Oct 2008
    • 78

    #1

    Does this still work?

    Hi, is someone still using this script:
    http://www.zabbix.com/wiki/doku.php?...i&s=clickatell

    To send SMS?

    I wonder if it still works since I get:
    PHP Parse error: syntax error, unexpected T_VARIABLE in /home/zabbix/bin/smsclickatell on line 35

    When I run it from the command line.
  • nibb
    Member
    • Oct 2008
    • 78

    #2
    Guess not.

    Does someone know of a script that will work to send Sms?

    Comment

    • Tenzer
      Senior Member
      • Nov 2007
      • 316

      #3
      The following line looks pretty borked in the script:
      PHP Code:
      foreach($apiargsas$k=>$v)$url.="$k=".urlencode($v)."&"
      Maybe the person who posted the script would see this thread and correct the line

      Comment

      • nibb
        Member
        • Oct 2008
        • 78

        #4
        I was really expecting to use SMS with Zabbix, which connected directly to Clickatell, this is a most BE feature since if your email server is down then you will be not alerted. Email is by no way replacement for SMS for alerts.

        I hope someone can take a look at it. Its hard to believe nobody is using SMS with Zabbix. Almost all monitoring system have SMS integrated.

        I hope someone can take a look at it, since im not a programmer. It should be integrated as function in Zabbix, not be an external script.
        Just my 2 cents.

        Comment

        • Calimero
          Senior Member
          • Nov 2006
          • 481

          #5
          Originally posted by nibb
          I hope someone can take a look at it, since im not a programmer. It should be integrated as function in Zabbix, not be an external script.
          Just my 2 cents.
          There are hundred of SMS plateforms in the World with obviously no standard protocol. Zabbix developers can't maintain hundreds of scripts.

          See here (where you should probably have looked in the first place):

          Your business can send & receive messages anywhere using Clickatell's SMS API platform. Learn the advantages of SMS API & how it can impact your business, here.


          ==> use $argv[1], $argv[2] and $argv[3] to get recipient, subject and message body respectively (that's how notification scripts are called by zabbix_server) and build SMS message accordingly.

          If your new script is working, feel free to update the wiki.

          Comment

          • nibb
            Member
            • Oct 2008
            • 78

            #6
            Originally posted by Calimero
            There are hundred of SMS plateforms in the World with obviously no standard protocol. Zabbix developers can't maintain hundreds of scripts.

            See here (where you should probably have looked in the first place):

            Your business can send & receive messages anywhere using Clickatell's SMS API platform. Learn the advantages of SMS API & how it can impact your business, here.


            ==> use $argv[1], $argv[2] and $argv[3] to get recipient, subject and message body respectively (that's how notification scripts are called by zabbix_server) and build SMS message accordingly.

            If your new script is working, feel free to update the wiki.
            Yes, but your missing the point here.

            The only provider that works worldwide with almost 100% coverage is Clickatell. Thats why every major software/web service that supports SMS sending is working with Clickatell. Sure they are others, but im sure they dont support my phone carrier like Clickatell does in my country. I will try your suggestion but im not a programmer, just a sys admin, i guess i will pay someone to make a script, its just weard the Wiki has a non working script. I will still take some time and see if i can make one myself playing with it around.

            Comment

            • Calimero
              Senior Member
              • Nov 2006
              • 481

              #7
              Well I could tell you that I've never heard of clickatell and that in France, most people use ATOS Origin the send SMS...

              You'll understand how subjective/specific this is.

              Plus you need an account and credits to develop a custom script. Again zabbix developers can't subscribe to several services to dev and test.

              Give me a login and a few credits and I'll code the script. Promise I won't text hundreds of my friends !

              Comment

              • nibb
                Member
                • Oct 2008
                • 78

                #8
                Thats incredible weard. I use at least 3 softwares, including support, billing, etc. And they all use clickatells api for SMS. For Zabbix you only text sms the admins for escalations so using a local SMS on your country works, but for international coverage then its the way to go. I did used the email from my cell providers which notifies when you have an email via SMS, but its terrible slow, its not real time, sometimes you send yourself and email and it takes hours to receive a reply, with clickatell i receive the message in seconds.

                Be part of the Chat Commerce & customer engagement mobile revolution with Clickatell's range of products & solutions. Build revenue and customer engagement now!


                You can sign up for a free account and it comes with free SMS credits. The api is very simple actually.

                Comment

                • Calimero
                  Senior Member
                  • Nov 2006
                  • 481

                  #9
                  Well clickatell's mail servers suck cause I don't get the verification email on gmail.

                  They're not helping !

                  Comment

                  • nibb
                    Member
                    • Oct 2008
                    • 78

                    #10
                    Originally posted by Calimero
                    Well clickatell's mail servers suck cause I don't get the verification email on gmail.

                    They're not helping !
                    They dont send an email confirmation but a SMS to the phone with a code which you have to activate on the website. But this it off topic

                    Comment

                    • Calimero
                      Senior Member
                      • Nov 2006
                      • 481

                      #11
                      Go here:
                      This class is meant to send SMS messages via the Clickatell gateway and provides support to authenticate to this service and also query for the…


                      Download sms_api-1.6.zip.
                      Extract sms_api.php

                      As a quick hack, we can use that very file as a media script.
                      Rename it to "sms_zabbix.php" if you want.

                      Add the following line at the top:
                      #!/usr/bin/php

                      (check the right path with "which php")

                      In the middle of the script, edit $api_id, $user, $password.

                      At the bottom, add the following lines:

                      Code:
                      #!/usr/bin/php
                      <?php
                      
                      // code from the class
                      
                      $to = $argv[1];
                      $subj = $argv[2]; // ignored
                      $msg = $argv[3];
                      
                      $msg = substr($msg, 0, 140);
                      
                      //echo "to: $to\n";
                      //echo "subj: $subj\n";
                      //echo "msg: $msg\n";
                      
                      $mysms = new sms();
                      $balance = $mysms->getbalance();
                      $mysms->send($to, "whatever", $msg)
                      ?>
                      Make the script executable and then:

                      # ./sms_zabbix.php 4412345598 "Will be ignored" "Zabbix: host foo.bar.com unreachable: ON"


                      That's just a quick hack (lacks any kind of error checking) but you get the idea. And there are other classes available.


                      Acutally they send both: you have to confirm both email code and SMS code.

                      Comment

                      • nibb
                        Member
                        • Oct 2008
                        • 78

                        #12
                        Thanks, will try it out tonight. If it works, we could add it to the Wiki as many people will find it very usefull. SMS is a must be on any monitoring system where techs are out of office. There is nothing nicer then to be waken up at 2 AM on Sunday.

                        Comment

                        • nibb
                          Member
                          • Oct 2008
                          • 78

                          #13
                          PHP Parse error: syntax error, unexpected '*' in /home/zabbix/bin/sms_zabbix.php on line 27

                          Comment

                          • rts
                            Member
                            • May 2007
                            • 54

                            #14
                            Sorry - I've only just seen this thread. I'm the developer who wrote it, and it should be:

                            foreach($apiargs as $k=>$v)$url.="$k=".urlencode($v)."&";

                            Somehow the wiki collapsed "apiargs as k" to "apiargsask". Just pop in some spaces, and it should work.

                            And yes, we're using this all the time.

                            Originally posted by Tenzer
                            The following line looks pretty borked in the script:
                            PHP Code:
                            foreach($apiargsas$k=>$v)$url.="$k=".urlencode($v)."&"
                            Maybe the person who posted the script would see this thread and correct the line

                            Comment

                            • ittec
                              Member
                              • Mar 2008
                              • 73

                              #15
                              Testing

                              Hi

                              I have to test the php of wiki but, in the other side, on Clickatell interface user, if we want to test the php script of you, What kind of API we have to set up?

                              Http, Smtp...? Excuse me, first steps

                              Thanks!

                              PS: if i run the php script shows this, is an error?

                              PHP Notice: Undefined offset: 3 in /home/zabbix/bin/smsclickatell on line 30
                              Last edited by ittec; 28-05-2009, 20:21. Reason: Forgot something

                              Comment

                              Working...