PDA

View Full Version : Run external script on trigger


gazzerh
06-06-2006, 18:11
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
06-06-2006, 18:34
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.

just2blue4u
07-06-2006, 10:32
scripts are expected in /home/zabbix/bin/ by default...

gazzerh
07-06-2006, 13:55
* 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?

gazzerh
07-06-2006, 16:04
Fixed it. Sorry. Worked out I need to use more conditions.