From: octo Date: Mon, 17 Apr 2006 08:51:44 +0000 (+0000) Subject: The `ping' plugin now reports which error occured. The string is not neccessarily... X-Git-Tag: collectd-3.8.6^2~17 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=461ff59a9ea1c9f41f2538ab2cd2c716e273d384;p=collectd.git The `ping' plugin now reports which error occured. The string is not neccessarily useful, we just use what `liboping' gives us.. --- diff --git a/src/ping.c b/src/ping.c index d82ce06e..91e0dbcc 100644 --- a/src/ping.c +++ b/src/ping.c @@ -61,7 +61,8 @@ static int ping_config (char *key, char *value) { if ((pingobj = ping_construct ()) == NULL) { - syslog (LOG_ERR, "ping: `ping_construct' failed.\n"); + syslog (LOG_ERR, "ping: `ping_construct' failed: %s", + ping_get_error (pingobj)); return (1); } } @@ -70,7 +71,8 @@ static int ping_config (char *key, char *value) { if (ping_host_add (pingobj, value) < 0) { - syslog (LOG_WARNING, "ping: `ping_host_add' failed."); + syslog (LOG_WARNING, "ping: `ping_host_add' failed: %s", + ping_get_error (pingobj)); return (1); } } @@ -129,7 +131,8 @@ static void ping_read (void) if (ping_send (pingobj) < 0) { - syslog (LOG_ERR, "ping: `ping_send' failed."); + syslog (LOG_ERR, "ping: `ping_send' failed: %s", + ping_get_error (pingobj)); return; }