summaryrefslogtreecommitdiffstats
path: root/web/attachments/83489-check_smtp.patch
blob: cf3fd673d05f44a278f782440999e8ac58e61ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- plugins/check_smtp.c.orig	Mon Apr 12 20:21:34 2004
+++ plugins/check_smtp.c	Mon Apr 12 22:29:17 2004
@@ -219,15 +219,16 @@
 	microsec = deltime (tv);
 	elapsed_time = (double)microsec / 1.0e6;
 
-	if (check_critical_time && elapsed_time > (double) critical_time)
-		result = STATE_CRITICAL;
-	else if (check_warning_time && elapsed_time > (double) warning_time)
-		result = STATE_WARNING;
+	if (result == STATE_OK)
+		if (check_critical_time && elapsed_time > (double) critical_time)
+			result = STATE_CRITICAL;
+		else if (check_warning_time && elapsed_time > (double) warning_time)
+			result = STATE_WARNING;
 
 	printf (_("SMTP %s - %.3f sec. response time%s%s|%s\n"),
 	        state_text (result), elapsed_time,
           verbose?", ":"", verbose?buffer:"",
-	        perfdata ("time", microsec, "us",
+	        fperfdata ("time", elapsed_time, "s",
 	                  (int)check_warning_time, warning_time,
 	                  (int)check_critical_time, critical_time,
 	                  TRUE, 0, FALSE, 0));