index 05830026a760d716800505d538876b8b06b8478b..21791ae9f25f7b89db2012872c87368fad8b5669 100644 (file)
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
if (incoming_rate > incoming_critical_threshold
|| outgoing_rate > outgoing_critical_threshold) {
result = STATE_CRITICAL;
- 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",
+ 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",
adjusted_outgoing_rate, outgoing_speed_rating);
}
else if (incoming_rate > incoming_warning_threshold
|| outgoing_rate > outgoing_warning_threshold) {
result = STATE_WARNING;
- 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",
+ 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",
adjusted_outgoing_rate, outgoing_speed_rating);
}
-
- 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",
+ 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",
adjusted_outgoing_rate, outgoing_speed_rating);
else
- printf ("%s\n", error_message);
+ printf ("UNKNOWN %s\n", error_message);
return result;
}
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option longopts[] = {
{"logfile", required_argument, 0, 'F'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
-#else
- c = getopt (argc, argv, "hVF:e:a:c:w:");
-#endif
+ c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
if (c == -1 || c == EOF)
break;