diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-10 12:48:47 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-10 12:48:47 (GMT) |
commit | 83b727c62a463b3b15f69a390638ece27bfbbcd5 (patch) | |
tree | dee15b034dd7c237e941f97b9f25ee5dc64f360c /plugins/check_smtp.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_smtp.c')
-rw-r--r-- | plugins/check_smtp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 41ed5f3..b35ebbc 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
@@ -59,6 +59,7 @@ main (int argc, char **argv) | |||
59 | { | 59 | { |
60 | int sd; | 60 | int sd; |
61 | double elapsed_time; | 61 | double elapsed_time; |
62 | long microsec; | ||
62 | int result = STATE_UNKNOWN; | 63 | int result = STATE_UNKNOWN; |
63 | char buffer[MAX_INPUT_BUFFER]; | 64 | char buffer[MAX_INPUT_BUFFER]; |
64 | char *from_str = NULL; | 65 | char *from_str = NULL; |
@@ -155,7 +156,8 @@ main (int argc, char **argv) | |||
155 | /* reset the alarm */ | 156 | /* reset the alarm */ |
156 | alarm (0); | 157 | alarm (0); |
157 | 158 | ||
158 | elapsed_time = delta_time (tv); | 159 | microsec = deltime (tv); |
160 | elapsed_time = (double)microsec / 1.0e6; | ||
159 | 161 | ||
160 | if (check_critical_time && elapsed_time > (double) critical_time) | 162 | if (check_critical_time && elapsed_time > (double) critical_time) |
161 | result = STATE_CRITICAL; | 163 | result = STATE_CRITICAL; |
@@ -163,11 +165,11 @@ main (int argc, char **argv) | |||
163 | result = STATE_WARNING; | 165 | result = STATE_WARNING; |
164 | 166 | ||
165 | if (verbose) | 167 | if (verbose) |
166 | printf (_("SMTP %s - %.3f sec. response time, %s|time=%.3f\n"), | 168 | printf (_("SMTP %s - %.3f sec. response time, %s|time=%ldus\n"), |
167 | state_text (result), elapsed_time, buffer, elapsed_time); | 169 | state_text (result), elapsed_time, buffer, microsec); |
168 | else | 170 | else |
169 | printf (_("SMTP %s - %.3f second response time|time=%.3f\n"), | 171 | printf (_("SMTP %s - %.3f second response time|time=%ldus\n"), |
170 | state_text (result), elapsed_time, elapsed_time); | 172 | state_text (result), elapsed_time, microsec); |
171 | 173 | ||
172 | return result; | 174 | return result; |
173 | } | 175 | } |