Ad Widget

Collapse

Run external script on trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gazzerh
    Member
    • Jun 2006
    • 36

    #1

    Run external script on trigger

    This is a fantastic program. I can sense a "rpm -e nagios" coming on

    One thing I would like to see (it might be included I don't know for sure) is the a way to call a program (shell/perl/python/etc) when a trigger is in a certain state and pass some data to this program.

    This would be good for me because I have perl scripts which send SMSs for example. When a trigger is critical I would like to call a script and pass a message about the host, problem, etc so it sends an SMS.

    It would also be nice to be able to send SMS to different people at different times. Maybe have more fields for users like email address, mobile phone numbers and on-call times and have a facility to link to SMS scripts. So you can specify the parameters you have on your SMS script using variables defined in Zabbix (send_sms %phonenumber% %message% for example) and then Zabbix does the rest.

    I know this is a lot of work and you probably don't understand my babble but I would be interested to hear your views on this.

    Cheers,
    Garry
  • schneck
    Member
    • May 2006
    • 62

    #2
    Re: Scripts and SMS

    Originally posted by gazzerh
    One thing I would like to see (it might be included I don't know for sure) is the a way to call a program (shell/perl/python/etc) when a trigger is in a certain state and pass some data to this program.
    * Go to Configuration -> General
    * Select Media Types
    * Click Create Media Type
    * in Type, select Script

    The directories where the scripts are expected are defined in the main zabbix configuration file (AlertScriptsPath.)

    This would be good for me because I have perl scripts which send SMSs for example.
    There is also a Media Type SMS (I havn't tried it yet, though)

    \B.

    Comment

    • just2blue4u
      Senior Member
      • Apr 2006
      • 347

      #3
      scripts are expected in /home/zabbix/bin/ by default...
      Big ZABBIX is watching you!
      (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

      Comment

      • gazzerh
        Member
        • Jun 2006
        • 36

        #4
        Originally posted by schneck
        * Go to Configuration -> General
        * Select Media Types
        * Click Create Media Type
        * in Type, select Script

        The directories where the scripts are expected are defined in the main zabbix configuration file (AlertScriptsPath.)



        There is also a Media Type SMS (I havn't tried it yet, though)

        \B.
        Thanks for the help. I am having problems with getting the conditions working when I create an action. For example I have created a condition for the trigger severity and one for a specific trigger. I made the trigger become that certain condition and nothing happens. It shows that the trigger is "average" but there is nothing in the actions page.

        What am I doing wrong?

        Comment

        • gazzerh
          Member
          • Jun 2006
          • 36

          #5
          Fixed it. Sorry. Worked out I need to use more conditions.

          Comment

          Working...