Code

The `ping' plugin now reports which error occured. The string is not neccessarily...
authorocto <octo>
Mon, 17 Apr 2006 08:51:44 +0000 (08:51 +0000)
committerocto <octo>
Mon, 17 Apr 2006 08:51:44 +0000 (08:51 +0000)
src/ping.c

index d82ce06e3fea93bf8c0ea0e20527577b3ca3aa1a..91e0dbcc01072fd7601695349f08684adcd53523 100644 (file)
@@ -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;
        }