summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 16:39:13 +0200
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 16:39:13 +0200
commit45893377bd70fd93928d015dc1f20cd19a17c6d3 (patch)
tree66805a11c30d602d08b3dfd85476c48b49d3ca1e
parent790374c3b163003f85cf2122d437828e70b1d871 (diff)
downloadmonitoring-plugins-45893377bd70fd93928d015dc1f20cd19a17c6d3.tar.gz
check_mrtgtraf: Use C99 booleans
-rw-r--r--plugins/check_mrtgtraf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index eb66f622..bd25d47d 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -43,7 +43,7 @@ void print_usage(void);
43 43
44char *log_file = NULL; 44char *log_file = NULL;
45int expire_minutes = -1; 45int expire_minutes = -1;
46int use_average = TRUE; 46bool use_average = true;
47unsigned long incoming_warning_threshold = 0L; 47unsigned long incoming_warning_threshold = 0L;
48unsigned long incoming_critical_threshold = 0L; 48unsigned long incoming_critical_threshold = 0L;
49unsigned long outgoing_warning_threshold = 0L; 49unsigned long outgoing_warning_threshold = 0L;
@@ -137,7 +137,7 @@ main (int argc, char **argv)
137 (int) ((current_time - timestamp) / 60)); 137 (int) ((current_time - timestamp) / 60));
138 138
139 /* else check the incoming/outgoing rates */ 139 /* else check the incoming/outgoing rates */
140 if (use_average == TRUE) { 140 if (use_average) {
141 incoming_rate = average_incoming_rate; 141 incoming_rate = average_incoming_rate;
142 outgoing_rate = average_outgoing_rate; 142 outgoing_rate = average_outgoing_rate;
143 } 143 }
@@ -192,17 +192,17 @@ main (int argc, char **argv)
192 } 192 }
193 193
194 xasprintf (&error_message, _("%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"), 194 xasprintf (&error_message, _("%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"),
195 (use_average == TRUE) ? _("Avg") : _("Max"), adjusted_incoming_rate, 195 (use_average) ? _("Avg") : _("Max"), adjusted_incoming_rate,
196 incoming_speed_rating, (use_average == TRUE) ? _("Avg") : _("Max"), 196 incoming_speed_rating, (use_average) ? _("Avg") : _("Max"),
197 adjusted_outgoing_rate, outgoing_speed_rating, 197 adjusted_outgoing_rate, outgoing_speed_rating,
198 fperfdata("in", adjusted_incoming_rate, incoming_speed_rating, 198 fperfdata("in", adjusted_incoming_rate, incoming_speed_rating,
199 (int)incoming_warning_threshold, incoming_warning_threshold, 199 (int)incoming_warning_threshold, incoming_warning_threshold,
200 (int)incoming_critical_threshold, incoming_critical_threshold, 200 (int)incoming_critical_threshold, incoming_critical_threshold,
201 TRUE, 0, FALSE, 0), 201 true, 0, false, 0),
202 fperfdata("out", adjusted_outgoing_rate, outgoing_speed_rating, 202 fperfdata("out", adjusted_outgoing_rate, outgoing_speed_rating,
203 (int)outgoing_warning_threshold, outgoing_warning_threshold, 203 (int)outgoing_warning_threshold, outgoing_warning_threshold,
204 (int)outgoing_critical_threshold, outgoing_critical_threshold, 204 (int)outgoing_critical_threshold, outgoing_critical_threshold,
205 TRUE, 0, FALSE, 0)); 205 true, 0, false, 0));
206 206
207 printf (_("Traffic %s - %s\n"), state_text(result), error_message); 207 printf (_("Traffic %s - %s\n"), state_text(result), error_message);
208 208
@@ -256,9 +256,9 @@ process_arguments (int argc, char **argv)
256 break; 256 break;
257 case 'a': /* aggregation (AVE or MAX) */ 257 case 'a': /* aggregation (AVE or MAX) */
258 if (!strcmp (optarg, "MAX")) 258 if (!strcmp (optarg, "MAX"))
259 use_average = FALSE; 259 use_average = false;
260 else 260 else
261 use_average = TRUE; 261 use_average = true;
262 break; 262 break;
263 case 'c': /* warning threshold */ 263 case 'c': /* warning threshold */
264 sscanf (optarg, "%lu,%lu", &incoming_critical_threshold, 264 sscanf (optarg, "%lu,%lu", &incoming_critical_threshold,
@@ -289,11 +289,11 @@ process_arguments (int argc, char **argv)
289 } 289 }
290 290
291 if (argc > c && strcmp (argv[c], "MAX") == 0) { 291 if (argc > c && strcmp (argv[c], "MAX") == 0) {
292 use_average = FALSE; 292 use_average = false;
293 c++; 293 c++;
294 } 294 }
295 else if (argc > c && strcmp (argv[c], "AVG") == 0) { 295 else if (argc > c && strcmp (argv[c], "AVG") == 0) {
296 use_average = TRUE; 296 use_average = true;
297 c++; 297 c++;
298 } 298 }
299 299