summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-17 11:16:32 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-17 11:16:32 +0000
commitc738adcb84b3f8e00058daa155d8a06cfb179d77 (patch)
tree1f2289c89db55e0796ae17f169db2470d6981086 /src
parent1584e920ff794969393705e351a756dd1d28d08d (diff)
downloadzabbix-c738adcb84b3f8e00058daa155d8a06cfb179d77.tar.gz
zabbix-c738adcb84b3f8e00058daa155d8a06cfb179d77.tar.xz
zabbix-c738adcb84b3f8e00058daa155d8a06cfb179d77.zip
- [ZBX-182] ICMP using host names
Minor fix git-svn-id: svn://svn.zabbix.com/trunk@5365 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/pinger/pinger.c12
-rw-r--r--src/zabbix_server/pinger/pinger.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/zabbix_server/pinger/pinger.c b/src/zabbix_server/pinger/pinger.c
index 6639f7f9..9b3189e2 100644
--- a/src/zabbix_server/pinger/pinger.c
+++ b/src/zabbix_server/pinger/pinger.c
@@ -38,7 +38,8 @@ ZBX_FPING_HOST
double mseconds;
};
-static zbx_process_t zbx_process;
+static zbx_process_t zbx_process;
+static int pinger_num;
/******************************************************************************
* *
@@ -119,7 +120,7 @@ static int process_value(char *key, ZBX_FPING_HOST *host, AGENT_RESULT *value)
* Comments: *
* *
******************************************************************************/
-static int get_pinger_hosts(int pinger_num, ZBX_FPING_HOST **hosts, int *hosts_allocated, int *hosts_count)
+static int get_pinger_hosts(ZBX_FPING_HOST **hosts, int *hosts_allocated, int *hosts_count)
{
DB_RESULT result;
DB_ROW row;
@@ -332,16 +333,17 @@ static int do_ping(ZBX_FPING_HOST *hosts, int hosts_count)
* Comments: never returns *
* *
******************************************************************************/
-void main_pinger_loop(zbx_process_t p, int pinger_num)
+void main_pinger_loop(zbx_process_t p, int num)
{
int start, sleeptime;
ZBX_FPING_HOST *hosts = NULL;
int hosts_allocated = 16, hosts_count;
zabbix_log(LOG_LEVEL_DEBUG, "In main_pinger_loop(num:%d)",
- pinger_num);
+ num);
zbx_process = p;
+ pinger_num = num;
hosts = zbx_malloc(hosts, hosts_allocated * sizeof(ZBX_FPING_HOST));
@@ -353,7 +355,7 @@ void main_pinger_loop(zbx_process_t p, int pinger_num)
DBconnect(ZBX_DB_CONNECT_NORMAL);
hosts_count = 0;
- if (SUCCEED == get_pinger_hosts(pinger_num, &hosts, &hosts_allocated, &hosts_count)) {
+ if (SUCCEED == get_pinger_hosts(&hosts, &hosts_allocated, &hosts_count)) {
zbx_setproctitle("pinging hosts");
do_ping(hosts, hosts_count);
diff --git a/src/zabbix_server/pinger/pinger.h b/src/zabbix_server/pinger/pinger.h
index efae6c80..d5e370ee 100644
--- a/src/zabbix_server/pinger/pinger.h
+++ b/src/zabbix_server/pinger/pinger.h
@@ -27,6 +27,6 @@ extern int CONFIG_PINGER_FREQUENCY;
extern char *CONFIG_FPING_LOCATION;
extern char *CONFIG_FPING6_LOCATION;
-void main_pinger_loop(zbx_process_t p, int pinger_num);
+void main_pinger_loop(zbx_process_t p, int num);
#endif