View Full Version : Delay between messages (Configuration of actions)
I have an action configured w/ a 600 second delay between messages (also tested w/ the default 30 second delay). When the trigger becomes FALSE, the action is executed and I receive an email.
I left the trigger false for 24 hours, and I never received another page about it.
Isn't Zabbix supposed to perform the action again if it is still False past the delay period?
Or does the delay mean if the trigger goes TRUE, then FALSE again, it will only perform the action if the delay time is exceeded?
Basically, I am looking for functionality that will perform an action every X seconds if the trigger has not changed (ie, the trigger goes TRUE causing an action, and then if it doesn't become FALSE again within a specified time, perform the action AGAIN).
Thanks!
joe
Przemek Czerkas
07-02-2005, 21:52
Basically, I am looking for functionality that will perform an action every X seconds if the trigger has not changed (ie, the trigger goes TRUE causing an action, and then if it doesn't become FALSE again within a specified time, perform the action AGAIN).
On my Zabbix v1.0 installation under Cygwin I use cron for this:
- I've added new 'Media Type' of type 'script', I use following script for 'beeper' functionality (server beepes when something goes wrong):
=== /usr/local/bin/beeper ===
#!/bin/bash
PARAMS=`echo $@ | sed 's/[^ 0-9].*$//' | sed 's/^\s*//' | sed 's/\s*$//'`
if ( echo $@ | grep -i -v 'is up' | grep -i -v 'lowered' | grep -i -v 'is reachable' | grep -i -v 'is ok' ) 1>/dev/null ;then
/usr/local/bin/addcrontab "* 8-16 * * 1-5 nice -n -20 /usr/local/bin/beep.exe $PARAMS"
else
/usr/local/bin/removecrontab "* 8-16 * * 1-5 nice -n -20 /usr/local/bin/beep.exe $PARAMS"
fi
=== /usr/local/bin/beeper ===
I use separated actions for triggers (for ON and OFF events) with different subjects to the message; for ex. when trigger is ON - message subject is: "FIREBIRD is down on {HOSTNAME}"; when trigger is OFF - message subject is: FIREBIRD is up on {HOSTNAME}".
Basicall beeper script has to differentiate beetwen ON and OFF events, and later it calls addcrontab/removecrontab scripts:
=== /usr/local/bin/addcrontab ===
#!/bin/bash
NAME=`basename $0`
USER=`whoami`
TEMP_CRON=/tmp/crontab.$USER.$NAME
rm -f $TEMP_CRON
crontab -l 2>/dev/null | egrep -v '^#' > $TEMP_CRON
echo "$@" >> $TEMP_CRON
crontab -r 2>/dev/null
crontab $TEMP_CRON 2>/dev/null
rm -f $TEMP_CRON
=== /usr/local/bin/addcrontab ===
=== /usr/local/bin/removecrontab ===
#!/bin/bash
NAME=`basename $0`
USER=`whoami`
TEMP_CRON=/tmp/crontab.$USER.$NAME
rm -f $TEMP_CRON
crontab -l 2>/dev/null | fgrep -v "$@" | egrep -v '^#' > $TEMP_CRON
crontab -r 2>/dev/null
crontab $TEMP_CRON 2>/dev/null
rm -f $TEMP_CRON
=== /usr/local/bin/removecrontab ===
It works for me,but it isn't reliable, though ... I think that zabbix should handle repeatable actions internally.
Regards,
Przemek
A repeat of the email alerts is something I would also like to see incorporated into Zabbix.
I have an action configured w/ a 600 second delay between messages (also tested w/ the default 30 second delay). When the trigger becomes FALSE, the action is executed and I receive an email.
I left the trigger false for 24 hours, and I never received another page about it.
Isn't Zabbix supposed to perform the action again if it is still False past the delay period?
Or does the delay mean if the trigger goes TRUE, then FALSE again, it will only perform the action if the delay time is exceeded?
Basically, I am looking for functionality that will perform an action every X seconds if the trigger has not changed (ie, the trigger goes TRUE causing an action, and then if it doesn't become FALSE again within a specified time, perform the action AGAIN).
Thanks!
joe