diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-09-15 16:16:14 +0200 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-09-15 16:16:14 +0200 |
| commit | ff7305bdfe2f682857ba888c70aec2fc7cee798e (patch) | |
| tree | b5b3bdcf41d42d525906b6e8d82cdf143e74ec5d /plugins/check_users.c | |
| parent | f07f96c3cfaeb30f95eb1898d6cc58b200e70831 (diff) | |
| parent | 601a48a63e745817cf2a4c7f3ca526e393dd3fb8 (diff) | |
| download | monitoring-plugins-ff7305bdfe2f682857ba888c70aec2fc7cee798e.tar.gz | |
Merge branch 'master' into refactor/check_apt
Diffstat (limited to 'plugins/check_users.c')
| -rw-r--r-- | plugins/check_users.c | 19 |
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); |
