Ad Widget

Collapse

SNMP traps using snmptrap.sh Sending failed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andersk
    Junior Member
    • Jul 2010
    • 11

    #16
    snmptt was the solution. Now I have it all. Thanks guys!

    Comment

    • Andersk
      Junior Member
      • Jul 2010
      • 11

      #17
      Running a custom python script.

      It turns out that I want to turn off a power outlet when I receive these traps. So I need to run a python script when an action is triggered.

      In Monotoring -> Events the actions status is ok, but nothing happens. ( the script is supposed to kill power, but power is still on)

      Here is what I have done:

      - My zabbix_server.conf is setting the path to external scripts like this ExternalScripts=/home/zabbix/zabbix-1.8.2/bin

      - I made a media type (script)
      Description: powerOff
      Name: turnOff.py

      - Made added a script:
      Name: turnOff.py
      Command: python turnOff.py
      User: all
      Groups: all
      Permissions: read

      - Added the powerOff media type to the user.
      - Added the user and use rmedia to an action which is triggered.

      The zabbix_server.log
      2984:20100804:112055.126 Error executing [/home/zabbix/zabbix-1.8.2/bin/turnOff.py] [Exec format error]
      In the script command."Command: python turnOff.py" I've tried without the "python" in front, but no change. have I missed the syntax? Is it supposed to be a command like exec in front or something?

      Comment

      • MrKen
        Senior Member
        • Oct 2008
        • 652

        #18
        Just a quick guess, before going home, maybe you need Permissions: execute

        MrKen
        Disclaimer: All of the above is pure speculation.

        Comment

        • Andersk
          Junior Member
          • Jul 2010
          • 11

          #19
          The permissions were ok. I didn't know I was supposed to add "#!/usr/bin/env python" in the script: So it's all super ok now.

          Comment

          Working...