diff options
| author | Bernd Arnold <wopfel@gmail.com> | 2018-06-13 16:56:22 +0200 | 
|---|---|---|
| committer | Bernd Arnold <wopfel@gmail.com> | 2018-06-13 16:56:22 +0200 | 
| commit | db499b6f5b82aff65171ac4cfa5b936ba1e5e5ad (patch) | |
| tree | 4148af2ebf8c8a7c67f65a9961bbf668127c97a6 /plugins-scripts/t | |
| parent | a784b19d6fc193e4c98ec6b2248bf4e252a9a0d7 (diff) | |
| download | monitoring-plugins-db499b6.tar.gz | |
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($)
Diffstat (limited to 'plugins-scripts/t')
| -rw-r--r-- | plugins-scripts/t/check_uptime.t | 2 | 
1 files changed, 1 insertions, 1 deletions
| 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( | |||
| 26 | "./check_uptime -w 5 -c 2" | 26 | "./check_uptime -w 5 -c 2" | 
| 27 | ); | 27 | ); | 
| 28 | cmp_ok( $result->return_code, '==', 3, "Warning greater than critical" ); | 28 | cmp_ok( $result->return_code, '==', 3, "Warning greater than critical" ); | 
| 29 | like ( $result->output, '/^Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" ); | 29 | like ( $result->output, '/^Upper Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" ); | 
| 30 | 30 | ||
| 31 | $result = NPTest->testCmd( | 31 | $result = NPTest->testCmd( | 
| 32 | "./check_uptime -c 1000 -W 100 2>&1" | 32 | "./check_uptime -c 1000 -W 100 2>&1" | 
