summaryrefslogtreecommitdiffstats
path: root/plugins/check_users.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-09-15 13:18:17 +0200
committerGitHub <noreply@github.com>2025-09-15 13:18:17 +0200
commit8ef825d85fb4d09c32ca44c545d6eb8d995ddea4 (patch)
tree5ab7b18797dfd5849dec7827c87ca3bb5fcb0993 /plugins/check_users.c
parenta3cf9041af810770daf5d9b83f1906fa9bb0dd11 (diff)
parent204cf956f0b3db90d079321ee957b3860da7e33f (diff)
downloadmonitoring-plugins-8ef825d85fb4d09c32ca44c545d6eb8d995ddea4.tar.gz
Merge pull request #2149 from RincewindsHat/clang-format
Clang format
Diffstat (limited to 'plugins/check_users.c')
-rw-r--r--plugins/check_users.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/check_users.c b/plugins/check_users.c
index cd3bd181..2340eae4 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -128,10 +128,14 @@ int main(int argc, char **argv) {
128 128
129 switch (tmp_status) { 129 switch (tmp_status) {
130 case STATE_WARNING: 130 case STATE_WARNING:
131 xasprintf(&sc_users.output, "%d users currently logged in. This violates the warning threshold", user_wrapper.users); 131 xasprintf(&sc_users.output,
132 "%d users currently logged in. This violates the warning threshold",
133 user_wrapper.users);
132 break; 134 break;
133 case STATE_CRITICAL: 135 case STATE_CRITICAL:
134 xasprintf(&sc_users.output, "%d users currently logged in. This violates the critical threshold", user_wrapper.users); 136 xasprintf(&sc_users.output,
137 "%d users currently logged in. This violates the critical threshold",
138 user_wrapper.users);
135 break; 139 break;
136 default: 140 default:
137 xasprintf(&sc_users.output, "%d users currently logged in", user_wrapper.users); 141 xasprintf(&sc_users.output, "%d users currently logged in", user_wrapper.users);
@@ -218,7 +222,7 @@ check_users_config_wrapper process_arguments(int argc, char **argv) {
218 printf("Warning threshold missing\n"); 222 printf("Warning threshold missing\n");
219 print_usage(); 223 print_usage();
220 exit(STATE_UNKNOWN); 224 exit(STATE_UNKNOWN);
221 } 225 }
222 226
223 if (tmp.error == MP_PARSING_SUCCES) { 227 if (tmp.error == MP_PARSING_SUCCES) {
224 result.config.thresholds.warning = tmp.range; 228 result.config.thresholds.warning = tmp.range;
@@ -254,7 +258,8 @@ void print_help(void) {
254 printf(COPYRIGHT, copyright, email); 258 printf(COPYRIGHT, copyright, email);
255 259
256 printf("%s\n", _("This plugin checks the number of users currently logged in on the local")); 260 printf("%s\n", _("This plugin checks the number of users currently logged in on the local"));
257 printf("%s\n", _("system and generates an error if the number exceeds the thresholds specified.")); 261 printf("%s\n",
262 _("system and generates an error if the number exceeds the thresholds specified."));
258 263
259 printf("\n\n"); 264 printf("\n\n");
260 265
@@ -264,9 +269,11 @@ void print_help(void) {
264 printf(UT_EXTRA_OPTS); 269 printf(UT_EXTRA_OPTS);
265 270
266 printf(" %s\n", "-w, --warning=RANGE_EXPRESSION"); 271 printf(" %s\n", "-w, --warning=RANGE_EXPRESSION");
267 printf(" %s\n", _("Set WARNING status if number of logged in users violates RANGE_EXPRESSION")); 272 printf(" %s\n",
273 _("Set WARNING status if number of logged in users violates RANGE_EXPRESSION"));
268 printf(" %s\n", "-c, --critical=RANGE_EXPRESSION"); 274 printf(" %s\n", "-c, --critical=RANGE_EXPRESSION");
269 printf(" %s\n", _("Set CRITICAL status if number of logged in users violates RANGE_EXPRESSION")); 275 printf(" %s\n",
276 _("Set CRITICAL status if number of logged in users violates RANGE_EXPRESSION"));
270 printf(UT_OUTPUT_FORMAT); 277 printf(UT_OUTPUT_FORMAT);
271 278
272 printf(UT_SUPPORT); 279 printf(UT_SUPPORT);