diff options
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 41ed5f38..b35ebbc0 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 | } |