I created a new host via a template consisting of multiple agent items and a single trigger {<host>:status.last(0)}=2
I then shutdown the zabbix agent on <host>.
This shows up in the events and summary as being ON, and the latest data shows a value of 2 - all perfect, but no action was initiated.
I fixed this by modifying src/libs/zbxdbhigh/db.c to add another condition to the DBupdate_trigger_value function, which did not cater for unknown trigger values (determined by previous alerts).
The change was as follows:-
--- db.c.old 2006-02-17 14:34:35.667794863 +1300
+++ db.c 2006-02-17 14:08:18.454827912 +1300
@@ -584,6 +584,7 @@
}*/
if( ((trigger->value == TRIGGER_VALUE_TRUE) && (new_value == TRIGGER_VALUE_FALSE)) ||
((trigger->value == TRIGGER_VALUE_FALSE) && (new_value == TRIGGER_VALUE_TRUE)) ||
+ (trigger->prevvalue == TRIGGER_VALUE_UNKNOWN) ||
((trigger->prevvalue == TRIGGER_VALUE_FALSE) && (trigger->value == TRIGGER_VALUE_UNKNOWN) && (new_value == TRIGGER_VALUE_TRUE)) ||
((trigger->prevvalue == TRIGGER_VALUE_TRUE) && (trigger->value == TRIGGER_VALUE_UNKNOWN) && (new_value == TRIGGER_VALUE_FALSE)))
{
Needless to say, after making the change, relinking, restarting the server, recreating the host and again shutting down the agent - an alert was received
I then shutdown the zabbix agent on <host>.
This shows up in the events and summary as being ON, and the latest data shows a value of 2 - all perfect, but no action was initiated.
I fixed this by modifying src/libs/zbxdbhigh/db.c to add another condition to the DBupdate_trigger_value function, which did not cater for unknown trigger values (determined by previous alerts).
The change was as follows:-
--- db.c.old 2006-02-17 14:34:35.667794863 +1300
+++ db.c 2006-02-17 14:08:18.454827912 +1300
@@ -584,6 +584,7 @@
}*/
if( ((trigger->value == TRIGGER_VALUE_TRUE) && (new_value == TRIGGER_VALUE_FALSE)) ||
((trigger->value == TRIGGER_VALUE_FALSE) && (new_value == TRIGGER_VALUE_TRUE)) ||
+ (trigger->prevvalue == TRIGGER_VALUE_UNKNOWN) ||
((trigger->prevvalue == TRIGGER_VALUE_FALSE) && (trigger->value == TRIGGER_VALUE_UNKNOWN) && (new_value == TRIGGER_VALUE_TRUE)) ||
((trigger->prevvalue == TRIGGER_VALUE_TRUE) && (trigger->value == TRIGGER_VALUE_UNKNOWN) && (new_value == TRIGGER_VALUE_FALSE)))
{
Needless to say, after making the change, relinking, restarting the server, recreating the host and again shutting down the agent - an alert was received