aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-08-10 12:48:47 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-08-10 12:48:47 +0000
commit83b727c62a463b3b15f69a390638ece27bfbbcd5 (patch)
treedee15b034dd7c237e941f97b9f25ee5dc64f360c /plugins/check_smtp.c
parentdcf31f383de6fd8ffff44417bfc12df76ce9ae67 (diff)
downloadmonitoring-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_smtp.c')
-rw-r--r--plugins/check_smtp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 41ed5f38..b35ebbc0 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -59,6 +59,7 @@ main (int argc, char **argv)
{
int sd;
double elapsed_time;
+ long microsec;
int result = STATE_UNKNOWN;
char buffer[MAX_INPUT_BUFFER];
char *from_str = NULL;
@@ -155,7 +156,8 @@ main (int argc, char **argv)
/* reset the alarm */
alarm (0);
- elapsed_time = delta_time (tv);
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
if (check_critical_time && elapsed_time > (double) critical_time)
result = STATE_CRITICAL;
@@ -163,11 +165,11 @@ main (int argc, char **argv)
result = STATE_WARNING;
if (verbose)
- printf (_("SMTP %s - %.3f sec. response time, %s|time=%.3f\n"),
- state_text (result), elapsed_time, buffer, elapsed_time);
+ printf (_("SMTP %s - %.3f sec. response time, %s|time=%ldus\n"),
+ state_text (result), elapsed_time, buffer, microsec);
else
- printf (_("SMTP %s - %.3f second response time|time=%.3f\n"),
- state_text (result), elapsed_time, elapsed_time);
+ printf (_("SMTP %s - %.3f second response time|time=%ldus\n"),
+ state_text (result), elapsed_time, microsec);
return result;
}