Ad Widget

Collapse

Plz help me: Zabbix SMS report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • THUHV
    Junior Member
    • Dec 2009
    • 28

    #1

    Plz help me: Zabbix SMS report

    My network have zabbix 1.6.5 now, and i want to configure it can be report to me via SMS now, i have a CDMA modem, everybody can give me the way to install it to my zabbix. if you can, show me step by step thats good for me because i'm only a newbie, thanks you!
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    i've heard that cdma might be tricky (mostly usa system, right ?)

    if you can send messages through it using commandline, it should be perfectly usable as a custom alert script.

    if not, you might need a different modem - nelsonab was talking about some modem he had found that would be usable in usa cellular networks.
    Zabbix 3.0 Network Monitoring book

    Comment

    • THUHV
      Junior Member
      • Dec 2009
      • 28

      #3
      no, im from Vietnam bro

      May you give me which command line which i use to send sms?

      thanks

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        that depends on your modem. i have never even seen a cdma one - refer to the modem documentation.
        Zabbix 3.0 Network Monitoring book

        Comment

        • MrKen
          Senior Member
          • Oct 2008
          • 652

          #5
          "A CDMA modem is a wireless modem that works with CDMA networks. A CDMA modem can be an external unit or a PCMCIA card (also called PC Card). An external CDMA modem is connected to a PC through a serial cable, a USB cable, Bluetooth or Infrared. Unlike GSM modems, CDMA modems and phones do not require a SIM card from a wireless carrier in order to operate.
          CDMA modems are activated by the network once you subscribe to a CDMA service provider." Source: somewhere on the net.

          And: "CDMA modems support an extended set of AT commands, please note that not all CDMA modems use the same commands for sending SMS !
          These extended AT commands are defined in the CDMA standards."

          THUHV you will need to use the AT commands. Write a script that you can execute on the command line. When you have that working you can then create Media type 'script' to call your script. Zabbix will pass 3 parameters to that script - ToNumber, Subject, Message.

          How to write the script? Don't know! But this link may be useful http://www.developershome.com/sms/ho...dSMSFromPC.asp

          There are also these two on the wiki, it won't help you directly but should be useful in helping you to write the script http://www.zabbix.com/wiki/howto/config/alerts/smsapi?s[]=sms

          http://www.zabbix.com/wiki/howto/config/alerts/sms

          HTH
          MrKen
          Disclaimer: All of the above is pure speculation.

          Comment

          • THUHV
            Junior Member
            • Dec 2009
            • 28

            #6
            Thanks you very much, i will try it now
            Happy holiday to all

            Comment

            • THUHV
              Junior Member
              • Dec 2009
              • 28

              #7
              hi

              i use this link: http://www.zabbix.com/wiki/howto/config/alerts/smsapi?s[]=sms

              and want to use clickatell

              but i dont know which name and path i will save with the code below

              plz show me the name i will named this code and path
              thanks

              is it the name is smsclickatell.php and path is /home/zabbix/bin/smsclickatell.php ?

              PHP Code:
              #!/usr/local/bin/php
              <?php
              /*****************************************
               *smsclickatell
               *
               * A simple script to send an SMS via
               * www.clickatell.com.
               *
               *
               *****************************************/
               
              // Set the following three values:
               
              $apiid="221111";
              $user="username";
              $password="password";
               
               
              // Do not change anything beneath this line:
               
              if($_SERVER["argc"]<3){
               die(
              "Usage: ".$_SERVER["argv"][0]." recipientmobilenumber message\n");
              }
               
              $apiargs=array();
              $apiargs["api_id"]=$apiid;
              $apiargs["user"]=$user;
              $apiargs["password"]=$password;
              $apiargs["to"]=$_SERVER["argv"][1];
              $apiargs["text"]=$_SERVER["argv"][3];
              $apiargs["from"]="Zabbix";
              $apiargs["req_feat"]=32;
               
              $url="http://api.clickatell.com/http/sendmsg?";
              foreach(
              $apiargs as $k=>$v)$url.="$k=".urlencode($v)."&";
               
              @
              file_get_contents($url);
               
              ?>

              Comment

              • MrKen
                Senior Member
                • Oct 2008
                • 652

                #8
                Strange, in Part 1 it says:

                Create a file in the directory, you specified in the zabbix_server.conf, key AlertScriptsPath: # Location for custom alert scripts
                AlertScriptsPath=/usr/local/zabbix/ called smsclickatell, and ensure that it's executable (chmod 755 smsclickatell).

                But then in Part 3 it says:

                test it, by running:
                /home/zabbix/bin/smsclickatell +4471234123123 "Test message"

                I would put it in the location of your AlertScriptsPath. Call it smsclickatell or anything else you want to call it.

                MrKen
                Disclaimer: All of the above is pure speculation.

                Comment

                Working...