summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-30 12:56:38 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-30 12:56:38 +0000
commit744c20bfa026fffcf300b84c3fe190daf06c68ed (patch)
tree56af90df4786226a26e1640f7ff3b788f74cb991 /src
parentd3533116fa7dbf04a3583848cc245b67001745a9 (diff)
downloadzabbix-744c20bfa026fffcf300b84c3fe190daf06c68ed.tar.gz
zabbix-744c20bfa026fffcf300b84c3fe190daf06c68ed.tar.xz
zabbix-744c20bfa026fffcf300b84c3fe190daf06c68ed.zip
- [DEV-173] added support of notification escalations on server side
git-svn-id: svn://svn.zabbix.com/trunk@5733 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/actions.c28
1 files changed, 16 insertions, 12 deletions
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 &&