summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/pinger/pinger.c
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-09 08:00:02 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-09 08:00:02 +0000
commit5ee8933efab88ee9194278e98056d5ecbbc97ec4 (patch)
treed30945b56a7789a7f090198b350a7ddeef335481 /src/zabbix_server/pinger/pinger.c
parentf7d1441286e083a22782ed585beaed0154ba7109 (diff)
downloadzabbix-5ee8933efab88ee9194278e98056d5ecbbc97ec4.tar.gz
zabbix-5ee8933efab88ee9194278e98056d5ecbbc97ec4.tar.xz
zabbix-5ee8933efab88ee9194278e98056d5ecbbc97ec4.zip
- fixed pinger to process DNS name instead of host name (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@4257 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/pinger/pinger.c')
-rw-r--r--src/zabbix_server/pinger/pinger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zabbix_server/pinger/pinger.c b/src/zabbix_server/pinger/pinger.c
index 25c44f59..01620be1 100644
--- a/src/zabbix_server/pinger/pinger.c
+++ b/src/zabbix_server/pinger/pinger.c
@@ -124,7 +124,7 @@ static int process_value(char *key, char *host, AGENT_RESULT *value)
}
else
{
- result = DBselect("select %s where h.status=%d and h.hostid=i.hostid and h.host='%s' and i.key_='%s' and i.status=%d and i.type=%d and" ZBX_COND_NODEID,
+ result = DBselect("select %s where h.status=%d and h.hostid=i.hostid and h.dns='%s' and i.key_='%s' and i.status=%d and i.type=%d and" ZBX_COND_NODEID,
ZBX_SQL_ITEM_SELECT,
HOST_STATUS_MONITORED,
host,
@@ -220,7 +220,7 @@ static int create_host_file(void)
DBfree_result(result);
/* Select hosts monitored by hostname */
- result = DBselect("select distinct h.host from hosts h,items i where " ZBX_SQL_MOD(h.hostid,%d) "=%d and i.hostid=h.hostid and h.status=%d and (i.key_='%s' or i.key_='%s') and i.type=%d and i.status=%d and h.useip=0 and" ZBX_COND_NODEID,
+ result = DBselect("select distinct h.dns from hosts h,items i where " ZBX_SQL_MOD(h.hostid,%d) "=%d and i.hostid=h.hostid and h.status=%d and (i.key_='%s' or i.key_='%s') and i.type=%d and i.status=%d and h.useip=0 and" ZBX_COND_NODEID,
CONFIG_PINGER_FORKS,
pinger_num-1,
HOST_STATUS_MONITORED,
@@ -232,13 +232,13 @@ static int create_host_file(void)
while((row=DBfetch(result)))
{
- strscpy(host.host,row[0]);
+ strscpy(host.dns,row[0]);
fprintf(f,"%s\n",
- host.host);
+ host.dns);
- zabbix_log( LOG_LEVEL_DEBUG, "HOSTNAME [%s]",
- host.host);
+ zabbix_log( LOG_LEVEL_DEBUG, "DNS name [%s]",
+ host.dns);
}
DBfree_result(result);