diff -Nru zabbix-2.0.9.orig/src/zabbix_agent/active.c zabbix-2.0.9/src/zabbix_agent/active.c --- zabbix-2.0.9.orig/src/zabbix_agent/active.c 2013-10-08 20:27:46.000000000 +0900 +++ zabbix-2.0.9/src/zabbix_agent/active.c 2013-10-28 21:43:37.000000000 +0900 @@ -762,9 +762,9 @@ #ifdef _WINDOWS unsigned long timestamp, logeventid; unsigned short severity; - char key_severity[MAX_STRING_LEN], str_severity[32] /* for `regex_match_ex' */; - char key_source[MAX_STRING_LEN], *source = NULL; - char key_logeventid[MAX_STRING_LEN], str_logeventid[8] /* for `regex_match_ex' */; + char key_severity[MAX_STRING_LEN], str_severity[32]; /* for `regex_match_ex' */ + char key_source[MAX_STRING_LEN], *source = NULL, str_source[32]; /* for `regex_match_ex' */ + char key_logeventid[MAX_STRING_LEN], str_logeventid[8]; /* for `regex_match_ex' */ #endif char encoding[32]; char tmp[16]; @@ -1073,12 +1073,15 @@ break; } + zbx_snprintf(str_source, sizeof(str_source), "%s", source); + zbx_snprintf(str_logeventid, sizeof(str_logeventid), "%lu", logeventid); if (SUCCEED == regexp_match_ex(regexps, regexps_num, value, pattern, ZBX_CASE_SENSITIVE) && SUCCEED == regexp_match_ex(regexps, regexps_num, str_severity, key_severity, ZBX_IGNORE_CASE) && - (('\0' == *key_source) ? 1 : (0 == strcmp(key_source, source))) && + SUCCEED == regexp_match_ex(regexps, regexps_num, str_source, + key_source, ZBX_IGNORE_CASE) && SUCCEED == regexp_match_ex(regexps, regexps_num, str_logeventid, key_logeventid, ZBX_CASE_SENSITIVE)) { diff -Nru zabbix-2.0.9.orig/src/zabbix_server/trapper/active.c zabbix-2.0.9/src/zabbix_server/trapper/active.c --- zabbix-2.0.9.orig/src/zabbix_server/trapper/active.c 2013-10-08 20:27:46.000000000 +0900 +++ zabbix-2.0.9/src/zabbix_server/trapper/active.c 2013-10-28 21:43:37.000000000 +0900 @@ -286,7 +286,7 @@ const char *__function_name = "send_list_of_active_checks_json"; char host[HOST_HOST_LEN_MAX], *name_esc, params[MAX_STRING_LEN], pattern[MAX_STRING_LEN], tmp[32], - key_severity[MAX_STRING_LEN], key_logeventid[MAX_STRING_LEN], + key_severity[MAX_STRING_LEN], source[MAX_STRING_LEN], key_logeventid[MAX_STRING_LEN], ip[INTERFACE_IP_LEN_MAX]; DB_RESULT result; DB_ROW row; @@ -427,6 +427,11 @@ *key_severity == '@') add_regexp_name(®exp, ®exp_alloc, ®exp_num, key_severity + 1); + /* dealing with `source' parameter */ + if ( 0 == get_param(params, 4, source, sizeof(source)) && + *source == '@') + add_regexp_name(®exp, ®exp_alloc, ®exp_num, source + 1); + /* dealing with `logeventid' parameter */ if (0 == get_param(params, 5, key_logeventid, sizeof(key_logeventid)) && *key_logeventid == '@')