From 744c20bfa026fffcf300b84c3fe190daf06c68ed Mon Sep 17 00:00:00 2001 From: sasha Date: Fri, 30 May 2008 12:56:38 +0000 Subject: - [DEV-173] added support of notification escalations on server side git-svn-id: svn://svn.zabbix.com/trunk@5733 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- src/zabbix_server/actions.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/zabbix_server/actions.c b/src/zabbix_server/actions.c index 103402d1..f52dad8f 100644 --- a/src/zabbix_server/actions.c +++ b/src/zabbix_server/actions.c @@ -335,22 +335,26 @@ int check_action_condition(DB_EVENT *event, DB_CONDITION *condition) } else if(event->source == EVENT_SOURCE_TRIGGERS && condition->conditiontype == CONDITION_TYPE_EVENT_ACKNOWLEDGED) { - result = DBselect("select count(*) from acknowledges where eventid=" ZBX_FS_UI64, + + result = DBselect("select acknowledged from events where eventid=" ZBX_FS_UI64, event->eventid); - value_int = (NULL != (row = DBfetch(result)) && SUCCEED != DBis_null(row[0]) && 0 != atoi(row[0])) ? 1 : 0; + if (NULL != (row = DBfetch(result))) { + value_int = atoi(row[0]); - DBfree_result(result); + if(condition->operator == CONDITION_OPERATOR_EQUAL) { + if (value_int == atoi(condition->value)) + ret = SUCCEED; + } else { + zabbix_log(LOG_LEVEL_ERR, "Unsupported operator [%d] for condition id [" ZBX_FS_UI64 "]", + condition->operator, + condition->conditionid); + } + } else + zabbix_log(LOG_LEVEL_ERR, "Unknown event [" ZBX_FS_UI64 "]", + event->eventid); -zabbix_log(LOG_LEVEL_ERR, "----- operator:%d value:%s:%d=%d", condition->operator, condition->value, atoi(condition->value), value_int); - if(condition->operator == CONDITION_OPERATOR_EQUAL) { - if (value_int == atoi(condition->value)) - ret = SUCCEED; - } else { - zabbix_log(LOG_LEVEL_ERR, "Unsupported operator [%d] for condition id [" ZBX_FS_UI64 "]", - condition->operator, - condition->conditionid); - } + DBfree_result(result); } else if(event->source == EVENT_SOURCE_DISCOVERY && event->object == EVENT_OBJECT_DSERVICE && -- cgit