From 461ff59a9ea1c9f41f2538ab2cd2c716e273d384 Mon Sep 17 00:00:00 2001 From: octo Date: Mon, 17 Apr 2006 08:51:44 +0000 Subject: [PATCH] The `ping' plugin now reports which error occured. The string is not neccessarily useful, we just use what `liboping' gives us.. --- src/ping.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.30.2