Ad Widget

Collapse

zabbix and gnokii

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jens
    Junior Member
    • Feb 2007
    • 4

    #1

    zabbix and gnokii

    I want to send criticle alerts via sms to my mobile phone.
    As we have and old Nokia 6210 with data cable, we want to use it.
    When I create a media type for the mobile phone (ttyS0) it doesn't send alerts.
    When I use gnokii --sendsms ... it works fine. So my solution was to create a script to call the gnokii command.
    The script looks like this:
    echo $1 $2 $3 | gnokii --sendsms 5551234567

    In case of an alert the zabbix_server.log shows the error "Exec format error".
    When I change the script as
    gnokii --sendsms ...
    this error will not reported, but (of course) no sms will be send.

    Thankz for all Your help !

    cu
    Jens
  • Jens
    Junior Member
    • Feb 2007
    • 4

    #2
    Now I've found the search funtion of the forum
    and modified the script as follows:
    #!/bin/bash
    echo $1 $3 | gnokii --sendsms ********* >sms.log
    exit 0

    Now, no error will logged ... but no sms was send

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      I think you should use full path to gnoki, say, /usr/sbin/gnoki ?
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • Jens
        Junior Member
        • Feb 2007
        • 4

        #4
        Originally posted by Alexei
        I think you should use full path to gnoki, say, /usr/sbin/gnoki ?
        Thankz, it is a really good idea ... but it doesn't work

        Comment

        • maxence
          Junior Member
          • Mar 2007
          • 5

          #5
          Hello,

          I had the same problem :
          gnokii working perfectly in terminal connected as zabbix but i was unable to use the script.

          I've solved it with setup "use_locking = no" in the config file of gnokii /etc/gnokiirc

          I didn't understand the reason (apparently user right problem) but that did the trick (no error log in zabbix'logs).

          Hope that can help

          Comment

          • hegermi
            Junior Member
            • Dec 2006
            • 19

            #6
            use smsd

            Put your outgoing messages in a mysql table and let smsd figure it out

            Comment

            • jean
              Member
              • Apr 2006
              • 85

              #7
              I use gnokii with Ubuntu and a gprs usb modm and it works. Try to add a sudo before gnokii command :
              Like this :
              exec ("/bin/echo \"$argv[2]\" |/usr/bin/sudo /usr/bin/gnokii --sendsms $argv[1] 2>/dev/null");

              Regards

              Jean

              Comment

              • evgeny elkin
                Member
                • Jul 2007
                • 52

                #8
                Jean thanx for advices, can you explain me, where did you put this script? In Actions|Remote commans? Thanks!

                Comment

                Working...