summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-14 14:56:09 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-14 14:56:09 +0000
commitf8e11864b2c69b42f8ff4b73b1b458bc107ce96b (patch)
treee0d394a67a46b22394a0102a2bf6cf03cba5d4e9 /src
parentebec5b63bb5dad1eb3d2badb32e55a319ebca147 (diff)
downloadzabbix-f8e11864b2c69b42f8ff4b73b1b458bc107ce96b.tar.gz
zabbix-f8e11864b2c69b42f8ff4b73b1b458bc107ce96b.tar.xz
zabbix-f8e11864b2c69b42f8ff4b73b1b458bc107ce96b.zip
- [DEV-109] Heartbeat messages
git-svn-id: svn://svn.zabbix.com/trunk@5489 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/trapper/trapper.c38
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);