summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 967ca89)
raw | patch | inline | side by side (parent: 967ca89)
author | Florian Forster <octo@huhu.verplant.org> | |
Mon, 16 Apr 2007 13:30:08 +0000 (15:30 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 16 Apr 2007 13:30:08 +0000 (15:30 +0200) |
src/ping.c | patch | blob | history |
diff --git a/src/ping.c b/src/ping.c
index 6dcd9ec70d653f27dbea56cde12507c168560c54..89fecc8d0ec2fffadec079340769bbb35dbbb953 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
hl_prev = NULL;
while (hl_this != NULL)
{
- DEBUG ("host = %s, wait_left = %i, wait_time = %i, next = %p",
- hl_this->host, hl_this->wait_left, hl_this->wait_time, (void *) hl_this->next);
+ DEBUG ("ping plugin: host = %s, wait_left = %i, "
+ "wait_time = %i, next = %p",
+ hl_this->host, hl_this->wait_left,
+ hl_this->wait_time, (void *) hl_this->next);
if (hl_this->wait_left <= 0)
{
if (ping_host_add (pingobj, hl_this->host) == 0)
{
- DEBUG ("Successfully added host %s", hl_this->host);
+ DEBUG ("ping plugin: Successfully added host %s", hl_this->host);
/* Remove the host from the linked list */
if (hl_prev != NULL)
hl_prev->next = hl_this->next;
}
else
{
+ DEBUG ("ping plugin: Failed adding host `%s'", hl_this->host);
hl_this->wait_left = hl_this->wait_time;
hl_this->wait_time *= 2;
if (hl_this->wait_time > 86400)
char host[512];
double latency;
size_t buf_len;
+ int number_of_hosts;
if (pingobj == NULL)
return (-1);
return (-1);
}
+ number_of_hosts = 0;
for (iter = ping_iterator_get (pingobj);
iter != NULL;
iter = ping_iterator_next (iter))
&latency, &buf_len))
continue;
- DEBUG ("host = %s, latency = %f", host, latency);
+ DEBUG ("ping plugin: host = %s, latency = %f", host, latency);
ping_submit (host, latency);
+ number_of_hosts++;
}
- return (0);
+ return (number_of_hosts == 0 ? -1 : 0);
} /* int ping_read */
void module_register (modreg_e load)