summaryrefslogtreecommitdiffstats
path: root/plugins/check_mrtgtraf.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-01-29 20:57:09 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2003-01-29 20:57:09 +0000
commita6ef25afaa4534be02e6ba1e03e86e102326087a (patch)
tree51529ba97653ca47e96426cc41487a404b599822 /plugins/check_mrtgtraf.c
parent53cbc4f81194f8766cad96755a9820d9c3a9eafd (diff)
downloadmonitoring-plugins-a6ef25afaa4534be02e6ba1e03e86e102326087a.tar.gz
Fixed error and success codes (638656 - Paul Dlug)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@271 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_mrtgtraf.c')
-rw-r--r--plugins/check_mrtgtraf.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 05830026..94e6e080 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -197,27 +197,26 @@ main (int argc, char **argv)
197 if (incoming_rate > incoming_critical_threshold 197 if (incoming_rate > incoming_critical_threshold
198 || outgoing_rate > outgoing_critical_threshold) { 198 || outgoing_rate > outgoing_critical_threshold) {
199 result = STATE_CRITICAL; 199 result = STATE_CRITICAL;
200 asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s", 200 asprintf (&error_message, "Traffic CRITICAL %s. In = %0.1f %s, %s. Out = %0.1f %s",
201 (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate, 201 (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
202 incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max", 202 incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
203 adjusted_outgoing_rate, outgoing_speed_rating); 203 adjusted_outgoing_rate, outgoing_speed_rating);
204 } 204 }
205 else if (incoming_rate > incoming_warning_threshold 205 else if (incoming_rate > incoming_warning_threshold
206 || outgoing_rate > outgoing_warning_threshold) { 206 || outgoing_rate > outgoing_warning_threshold) {
207 result = STATE_WARNING; 207 result = STATE_WARNING;
208 asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s", 208 asprintf (&error_message, "Traffic WARNING %s. In = %0.1f %s, %s. Out = %0.1f %s",
209 (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate, 209 (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
210 incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max", 210 incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
211 adjusted_outgoing_rate, outgoing_speed_rating); 211 adjusted_outgoing_rate, outgoing_speed_rating);
212 } 212 }
213 213 else if (result == STATE_OK)
214 if (result == STATE_OK) 214 printf ("Traffic OK - %s. In = %0.1f %s, %s. Out = %0.1f %s\n",
215 printf ("Traffic ok - %s. In = %0.1f %s, %s. Out = %0.1f %s\n", 215 (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
216 (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate, 216 incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
217 incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
218 adjusted_outgoing_rate, outgoing_speed_rating); 217 adjusted_outgoing_rate, outgoing_speed_rating);
219 else 218 else
220 printf ("%s\n", error_message); 219 printf ("UNKNOWN %s\n", error_message);
221 220
222 return result; 221 return result;
223} 222}