diff options
-rw-r--r-- | plugins/check_users.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/check_users.c b/plugins/check_users.c index 7cf7a2cc..916a691d 100644 --- a/plugins/check_users.c +++ b/plugins/check_users.c | |||
@@ -227,18 +227,23 @@ process_arguments (int argc, char **argv) | |||
227 | } | 227 | } |
228 | 228 | ||
229 | c = optind; | 229 | c = optind; |
230 | |||
230 | if (warning_range == NULL && argc > c) | 231 | if (warning_range == NULL && argc > c) |
231 | warning_range = argv[c++]; | 232 | warning_range = argv[c++]; |
233 | |||
232 | if (critical_range == NULL && argc > c) | 234 | if (critical_range == NULL && argc > c) |
233 | critical_range = argv[c++]; | 235 | critical_range = argv[c++]; |
234 | 236 | ||
235 | /* this will abort in case of invalid ranges */ | 237 | /* this will abort in case of invalid ranges */ |
236 | set_thresholds (&thlds, warning_range, critical_range); | 238 | set_thresholds (&thlds, warning_range, critical_range); |
237 | 239 | ||
238 | if (thlds->warning->end < 0) | 240 | if (!thlds->warning) { |
239 | usage4 (_("Warning threshold must be a positive integer")); | 241 | usage4 (_("Warning threshold must be a valid range expression")); |
240 | if (thlds->critical->end < 0) | 242 | } |
241 | usage4 (_("Critical threshold must be a positive integer")); | 243 | |
244 | if (!thlds->critical) { | ||
245 | usage4 (_("Critical threshold must be a valid range expression")); | ||
246 | } | ||
242 | 247 | ||
243 | return OK; | 248 | return OK; |
244 | } | 249 | } |