Ad Widget

Collapse

zabbix media type - script - on 1.4.6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loki
    Junior Member
    • Jul 2008
    • 7

    #1

    zabbix media type - script - on 1.4.6

    Hey All,

    Running zabbix 1.4.6 and running into issues with the media type script...

    zabbix_server.conf relevant bit..

    AlertScriptsPath=/home/zabbix/bin/

    script is called sms.sh - just pumps $1 $2 $3 to a file in /tmp


    #!/bin/bash

    echo $1 $2 $3 > /tmp/.lastsms
    exit 0


    when it tries to run it - this goes into the zabbix_server.log file

    21830:20080912:190044 Unsupported media type [3] for alert ID [6411]

    any ideas ?
    Reply With Quote
  • xs-
    Senior Member
    Zabbix Certified Specialist
    • Dec 2007
    • 393

    #2
    Did you check if the script is accessible and executable by the zabbix server user?

    Besides that, the send-to field from from a user's media def is prepended to the message. So if you have a tel nr there, it would be $1

    Comment

    • loki
      Junior Member
      • Jul 2008
      • 7

      #3
      are there any compile time options i need to make this work? or am i just better off waiting for zabbix 1.6 ?

      Comment

      • xs-
        Senior Member
        Zabbix Certified Specialist
        • Dec 2007
        • 393

        #4
        No, just make sure that the media script is accessible and executable by the zabbix_server user.

        Comment

        • loki
          Junior Member
          • Jul 2008
          • 7

          #5
          [root@gold named]# su - zabbix
          [zabbix@gold ~]$ bin/sms.sh a b c
          [zabbix@gold ~]$ cat /tmp/.lastsms
          a b c
          [zabbix@gold ~]$

          Comment

          • loki
            Junior Member
            • Jul 2008
            • 7

            #6
            [zabbix@gold ~]$ cat /etc/zabbix_server.conf | egrep -v '^#|^$'
            NodeID=0
            StartPollers=5
            ListenPort=10051
            SenderFrequency=30
            DebugLevel=3
            Timeout=5
            PidFile=/var/tmp/zabbix_server.pid
            LogFile=/tmp/zabbix_server.log
            AlertScriptsPath=/home/zabbix/bin/
            DBHost=127.0.0.1
            DBName=zabbix
            DBUser=xxxx
            DBPassword=xxxx

            Comment

            • xs-
              Senior Member
              Zabbix Certified Specialist
              • Dec 2007
              • 393

              #7
              Hmm

              This might be farfetched but, try and lose the .sh extension (rename it to sms, and dont forget to change the script name in zabbix itself).

              Comment

              • loki
                Junior Member
                • Jul 2008
                • 7

                #8
                just tried - no luck

                any other suggestions ?

                Comment

                • loki
                  Junior Member
                  • Jul 2008
                  • 7

                  #9
                  so explain this one...

                  i edit zabbix_server.conf, change debug to 4... kill & restart zabbix_server
                  magically it works with debug 4 on .. wtf?

                  so i change it back to debug3, still works ?

                  either it took a restart of zabbix_server to pick up the change to sms from sms.sh or something weird happened..

                  oh well.. all good now.

                  Comment

                  Working...