diff options
-rw-r--r-- | src/zabbix_server/trapper/trapper.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/zabbix_server/trapper/trapper.c b/src/zabbix_server/trapper/trapper.c index a9b895c7..9d2c5d6f 100644 --- a/src/zabbix_server/trapper/trapper.c +++ b/src/zabbix_server/trapper/trapper.c @@ -444,7 +444,7 @@ static int process_new_values(zbx_sock_t *sock, struct zbx_json_parse *jp, const * Return value: SUCCEED - processed successfully * * FAIL - an error occured * * * - * Author: Alksander Vladishev * + * Author: Aleksander Vladishev * * * * Comments: * * * @@ -453,6 +453,8 @@ static int process_proxy_values(zbx_sock_t *sock, struct zbx_json_parse *jp) { zbx_uint64_t proxy_hostid; + zabbix_log(LOG_LEVEL_DEBUG, "In process_proxy_values()"); + if (FAIL == get_proxy_id(jp, &proxy_hostid)) return FAIL; @@ -461,6 +463,36 @@ static int process_proxy_values(zbx_sock_t *sock, struct zbx_json_parse *jp) return process_new_values(sock, jp, proxy_hostid); } +/****************************************************************************** + * * + * Function: process_proxy_heartbeat * + * * + * Purpose: process heartbeat sent by proxy servers * + * * + * Parameters: * + * * + * Return value: SUCCEED - processed successfully * + * FAIL - an error occured * + * * + * Author: Aleksander Vladishev * + * * + * Comments: * + * * + ******************************************************************************/ +static int process_proxy_heartbeat(zbx_sock_t *sock, struct zbx_json_parse *jp) +{ + zbx_uint64_t proxy_hostid; + + zabbix_log(LOG_LEVEL_DEBUG, "In process_proxy_heartbeat()"); + + if (FAIL == get_proxy_id(jp, &proxy_hostid)) + return FAIL; + + update_proxy_lastaccess(proxy_hostid); + + return SUCCEED; +} + static int process_trap(zbx_sock_t *sock, char *s, int max_len) { char *line,*host; @@ -572,6 +604,10 @@ static int process_trap(zbx_sock_t *sock, char *s, int max_len) { ret = process_discovery_data(sock, &jp); } + else if (0 == strcmp(value, ZBX_PROTO_VALUE_PROXY_HEARTBEAT) && zbx_process == ZBX_PROCESS_SERVER) + { + ret = process_proxy_heartbeat(sock, &jp); + } else if (0 == strcmp(value, ZBX_PROTO_VALUE_GET_ACTIVE_CHECKS)) { ret = send_list_of_active_checks_json(sock, &jp); |