diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-10 12:48:47 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-10 12:48:47 +0000 |
commit | 83b727c62a463b3b15f69a390638ece27bfbbcd5 (patch) | |
tree | dee15b034dd7c237e941f97b9f25ee5dc64f360c /plugins/check_dns.c | |
parent | dcf31f383de6fd8ffff44417bfc12df76ce9ae67 (diff) | |
download | monitoring-plugins-83b727c62a463b3b15f69a390638ece27bfbbcd5.tar.gz |
perf data in integer microseconds
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@679 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r-- | plugins/check_dns.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index afc23a4f..58c0a1bf 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -78,6 +78,7 @@ main (int argc, char **argv) char *temp_buffer = NULL; int result = STATE_UNKNOWN; double elapsed_time; + long microsec; struct timeval tv; int multi_address; @@ -197,8 +198,9 @@ main (int argc, char **argv) result = STATE_CRITICAL; asprintf(&output, _("expected %s but got %s"), expected_address, address); } - - elapsed_time = delta_time (tv); + + microsec = deltime (tv); + elapsed_time = (double)microsec / 1.0e6; if (result == STATE_OK) { if (strchr (address, ',') == NULL) @@ -206,8 +208,8 @@ main (int argc, char **argv) else multi_address = TRUE; - printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n"), - elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time); + printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%ldus\n"), + elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, microsec); } else if (result == STATE_WARNING) printf (_("DNS WARNING - %s\n"), |