Code

use float for time in perf data
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 4 Mar 2004 05:08:43 +0000 (05:08 +0000)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 4 Mar 2004 05:08:43 +0000 (05:08 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@842 f882894a-f735-0410-b71e-b25c423dba1c

plugins/check_dig.c
plugins/check_dns.c
plugins/check_game.c

index e348a352bec09323eeef97c134f70f43e21e1871..9e1d84792de1bcb8ae5360e88af7696be6855d00 100644 (file)
@@ -151,11 +151,11 @@ main (int argc, char **argv)
 
        printf ("DNS %s - %s|%s\n",
                state_text (result), output,
-               perfdata("time", microsec, "us",
+               fperfdata("time", elapsed_time, "s",
                         (warning_interval>UNDEFINED?TRUE:FALSE),
-                        (int)(1e6*warning_interval),
+                        warning_interval,
                         (critical_interval>UNDEFINED?TRUE:FALSE),
-                        (int)(1e6*critical_interval),
+                        critical_interval,
                                                                         TRUE, 0, FALSE, 0));
        return result;
 }
index 14d4306cdaf59ac6ce45652ea82a8caa704b1a98..43a38fa0c71ea39787a3311b02ba6f1ca4d07e66 100644 (file)
@@ -198,7 +198,7 @@ main (int argc, char **argv)
                printf ("%s %s: ", _("DNS"), _("OK"));
                printf (ngettext("%.3f second response time, ", "%.3f seconds response time, ", elapsed_time), elapsed_time);
                printf (_("%s returns %s"), query_address, address);
-               printf ("|%s\n", perfdata ("time", microsec, "us", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+               printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
        }
        else if (result == STATE_WARNING)
                printf (_("DNS WARNING - %s\n"),
index 3ebf6afabb2e50bc1aac332ddf30333191f09a81..ac72873deb9f6fe6f8f4f3e375db3ae6f419a780 100644 (file)
@@ -152,7 +152,7 @@ main (int argc, char **argv)
                                                perfdata ("players", atol(ret[qstat_game_players]), "",
                                  FALSE, 0, FALSE, 0,
                                  TRUE, 0, TRUE, atol(ret[qstat_game_players_max])),
-                                               perfdata ("ping", atol(ret[qstat_ping_field]), "",
+                                               fperfdata ("ping", strtod(ret[qstat_ping_field], NULL), "",
                                  FALSE, 0, FALSE, 0,
                                  TRUE, 0, FALSE, 0));
        }