summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 14:37:36 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 14:37:36 (GMT)
commit790374c3b163003f85cf2122d437828e70b1d871 (patch)
treea61156b5e458f5d0fe7bc01b7149c27993ffc7f0
parent82f391085d46d207870864c7ab6332914bdd3681 (diff)
downloadmonitoring-plugins-790374c3b163003f85cf2122d437828e70b1d871.tar.gz
check_mrtg: Use C99 booleans
-rw-r--r--plugins/check_mrtg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 1fda549..826b77e 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -43,7 +43,7 @@ void print_usage (void);
43 43
44char *log_file = NULL; 44char *log_file = NULL;
45int expire_minutes = 0; 45int expire_minutes = 0;
46int use_average = TRUE; 46bool use_average = true;
47int variable_number = -1; 47int variable_number = -1;
48unsigned long value_warning_threshold = 0L; 48unsigned long value_warning_threshold = 0L;
49unsigned long value_critical_threshold = 0L; 49unsigned long value_critical_threshold = 0L;
@@ -138,7 +138,7 @@ main (int argc, char **argv)
138 } 138 }
139 139
140 /* else check the incoming/outgoing rates */ 140 /* else check the incoming/outgoing rates */
141 if (use_average == TRUE) 141 if (use_average)
142 rate = average_value_rate; 142 rate = average_value_rate;
143 else 143 else
144 rate = maximum_value_rate; 144 rate = maximum_value_rate;
@@ -149,7 +149,7 @@ main (int argc, char **argv)
149 result = STATE_WARNING; 149 result = STATE_WARNING;
150 150
151 printf("%s. %s = %lu %s|%s\n", 151 printf("%s. %s = %lu %s|%s\n",
152 (use_average == TRUE) ? _("Avg") : _("Max"), 152 (use_average) ? _("Avg") : _("Max"),
153 label, rate, units, 153 label, rate, units,
154 perfdata(label, (long) rate, units, 154 perfdata(label, (long) rate, units,
155 (int) value_warning_threshold, (long) value_warning_threshold, 155 (int) value_warning_threshold, (long) value_warning_threshold,
@@ -211,9 +211,9 @@ process_arguments (int argc, char **argv)
211 break; 211 break;
212 case 'a': /* port */ 212 case 'a': /* port */
213 if (!strcmp (optarg, "MAX")) 213 if (!strcmp (optarg, "MAX"))
214 use_average = FALSE; 214 use_average = false;
215 else 215 else
216 use_average = TRUE; 216 use_average = true;
217 break; 217 break;
218 case 'v': 218 case 'v':
219 variable_number = atoi (optarg); 219 variable_number = atoi (optarg);
@@ -258,11 +258,11 @@ process_arguments (int argc, char **argv)
258 } 258 }
259 259
260 if (argc > c && strcmp (argv[c], "MAX") == 0) { 260 if (argc > c && strcmp (argv[c], "MAX") == 0) {
261 use_average = FALSE; 261 use_average = false;
262 c++; 262 c++;
263 } 263 }
264 else if (argc > c && strcmp (argv[c], "AVG") == 0) { 264 else if (argc > c && strcmp (argv[c], "AVG") == 0) {
265 use_average = TRUE; 265 use_average = true;
266 c++; 266 c++;
267 } 267 }
268 268