From db499b6f5b82aff65171ac4cfa5b936ba1e5e5ad Mon Sep 17 00:00:00 2001 From: Bernd Arnold Date: Wed, 13 Jun 2018 16:56:22 +0200 Subject: Introducing ranges for warning and critical Works as before: -w 1w -c 2w New (as before, but also warn if uptime < 5m, and crit if uptime < 2m): -w 5m:1w -c 2m:2w (idea by @sni) Also refactored the time calculation, if a suffix is present: New sub calc_as_seconds($) --- plugins-scripts/t/check_uptime.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-scripts/t') diff --git a/plugins-scripts/t/check_uptime.t b/plugins-scripts/t/check_uptime.t index 410a0800..4606718a 100644 --- a/plugins-scripts/t/check_uptime.t +++ b/plugins-scripts/t/check_uptime.t @@ -26,7 +26,7 @@ $result = NPTest->testCmd( "./check_uptime -w 5 -c 2" ); cmp_ok( $result->return_code, '==', 3, "Warning greater than critical" ); -like ( $result->output, '/^Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" ); +like ( $result->output, '/^Upper Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" ); $result = NPTest->testCmd( "./check_uptime -c 1000 -W 100 2>&1" -- cgit v1.2.3