X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fping.c;fp=src%2Fping.c;h=b536f42966639f4d7e3ca260e238b7944440294f;hp=5366b98fbcc1d309be5b4161c82f5dd9ca23ff85;hb=3bd6fcdfd20002eee1f1803460728449c0c98f86;hpb=c253952ba26a4123aade567d590ff206f84ec82f diff --git a/src/ping.c b/src/ping.c index 5366b98f..b536f429 100644 --- a/src/ping.c +++ b/src/ping.c @@ -184,10 +184,11 @@ static void *ping_thread (void *arg) /* {{{ */ count = 0; for (hl = hostlist_head; hl != NULL; hl = hl->next) { - int status; - status = ping_host_add (pingobj, hl->host); - if (status != 0) - WARNING ("ping plugin: ping_host_add (%s) failed.", hl->host); + int tmp_status; + tmp_status = ping_host_add (pingobj, hl->host); + if (tmp_status != 0) + WARNING ("ping plugin: ping_host_add (%s) failed: %s", + hl->host, ping_get_error (pingobj)); else count++; } @@ -217,7 +218,9 @@ static void *ping_thread (void *arg) /* {{{ */ if (gettimeofday (&tv_begin, NULL) < 0) { - ERROR ("ping plugin: gettimeofday failed"); + char errbuf[1024]; + ERROR ("ping plugin: gettimeofday failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); ping_thread_error = 1; break; } @@ -322,7 +325,9 @@ static void *ping_thread (void *arg) /* {{{ */ if (gettimeofday (&tv_end, NULL) < 0) { - ERROR ("ping plugin: gettimeofday failed"); + char errbuf[1024]; + ERROR ("ping plugin: gettimeofday failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); ping_thread_error = 1; break; }