1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
--- check_mrtgtraf.c Thu Nov 14 15:48:42 2002
+++ check_mrtgtraf.c.orig Thu Nov 14 16:06:15 2002
@@ -197,26 +197,27 @@
if (incoming_rate > incoming_critical_threshold
|| outgoing_rate > outgoing_critical_threshold) {
result = STATE_CRITICAL;
- asprintf (&error_message, "Traffic CRITICAL %s. In = %0.1f %s, %s. Out = %0.1f %s",
- (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
- incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
+ asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s",
+ (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
+ incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
adjusted_outgoing_rate, outgoing_speed_rating);
}
else if (incoming_rate > incoming_warning_threshold
|| outgoing_rate > outgoing_warning_threshold) {
result = STATE_WARNING;
- asprintf (&error_message, "Traffic WARNING %s. In = %0.1f %s, %s. Out = %0.1f %s",
- (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
- incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
+ asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s",
+ (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
+ incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
adjusted_outgoing_rate, outgoing_speed_rating);
}
- else if (result == STATE_OK)
- printf ("Traffic OK - %s. In = %0.1f %s, %s. Out = %0.1f %s\n",
- (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
- incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
+
+ if (result == STATE_OK)
+ printf ("Traffic ok - %s. In = %0.1f %s, %s. Out = %0.1f %s\n",
+ (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
+ incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
adjusted_outgoing_rate, outgoing_speed_rating);
else
- printf ("UNKNOWN %s\n", error_message);
+ printf ("%s\n", error_message);
return result;
}
|