Commit graph

24 commits

Author SHA1 Message Date
Sven Nierlein
660e0cf4e2 tests: skip some tests if Monitoring::Plugin::Range isn't available
The check_file_age uses Monitoring::Plugin::Range internally. Skip thoses tests
if the module isn't available.
2018-12-04 14:54:12 +01:00
Bernd Arnold
558090a7d8 Added tests for range values 2018-06-13 17:26:51 +02:00
Bernd Arnold
db499b6f5b 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($)
2018-06-13 16:56:22 +02:00
Bernd Arnold
250adb31ef Added test file 2018-06-03 16:51:43 +02:00
Sven Nierlein
3b86c201a7 Merge pull request #1461 from philipowen/file-size-lessthan
Enable check_file_age to test for maximum file size
2017-04-20 16:28:15 +02:00
Sven Nierlein
4acddec00a script tests: fix relative lib path in utils test
utils.pm uses relative include ".." but the path is relativ to the current folder, so it
does not work when running "perl t/utils.t". Just add another lib of "." fixes that. We could
use FindBin but we don't want to make it unnecessarily complicated.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-13 13:27:03 +01:00
phowen
98a365d76c add range checking to check_file_age 2017-02-14 15:19:18 +00:00
Sven Nierlein
d6baf9dbce change exit code to unknown on help and version info
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Jonas Genannt
3b02d7fafb check_file_age: Provide performance data 2014-10-06 20:16:00 +02:00
Sven Nierlein
d832030e38 tests: check_disk_smb may exit with critical for unresponsive hosts too
Unknown (ex. debian 7)
%> ./check_disk_smb -H 1.1.1.1 -s np_foobar -vvv
/usr/bin/smbclient //1.1.1.1/np_foobar -U guest% -c du
No Answer from Client

Critical (ex. debian 8)
%> ./check_disk_smb -H 1.1.1.1 -s np_foobar -vvv
/usr/bin/smbclient //1.1.1.1/np_foobar -U guest% -c du
Connection to 1.1.1.1 failed
CRITICAL

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-31 11:43:47 +02:00
Jan Wagner
0b9b300f85 check_file_age: support for --ignore-missing
Patch to provide for a -i | --ignore-missing option. This allows files that
don't exist to be monitored for without causing an error. The use case is:

* one process periodically pushes files to an "input" queue for a second
  process
* the second process, when running cleanly will "consume" (process and remove)
  these files

So the conditions to meet are:
1. If the file doesn't exist, that's fine (OK)
2. If the file exists, but is less than X seconds, that's fine (OK)
3. If the file exists, but greater than X seconds, no good (CRITICAL)

Since now check_file_age doesn't permit this behavior, as a non-existent file
is considered CRITICAL.

Test case was contributed by our lovely Holger.

Closes #1181, Closes #989, Closes #862, Closes #1187, Closes #845
Closes Debian Bug #496307
2014-01-24 20:43:01 +01:00
Sven Nierlein
c7ea2aed74 check_disk_smb: fixed number of tests to skip 2013-09-17 10:23:08 +02:00
Matthias Eble
9faccbb261 add test cases for check_disk_smb 2010-11-28 22:08:54 +01:00
Matthias Eble
38e20a1a33 Fixed testcases for check_snmp, check_ifstatus and check_ifoperstatus when no snmp community is specified
The checks for invalid/unavailable hosts need a complete command line.
They failed on hosts where no community was specified. Now, an invalid community is used so
the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway.
2009-06-13 18:13:49 +02:00
Matthias Eble
05b801284c Further test parameters and skip blocks for check_ifoperstatus.t. getTestparam changes for check_ifstatus.t and ifoperstatus.t
Added snmp_interface and snmp_ifxtable test parameters to check_ifoperstatus.t.
Also getTestParameter calls for both plugins were converted to use three arguments
instead of undocumented >3 arg behaviour which led to redundant data in NPTest.cache.
2009-06-13 11:10:32 +02:00
Matthias Eble
edda2536e5 Fixed SNMPv3 behaviour of check_ifstatus. Added -P to define privprotocol (#2343438 - Robin Schroeder)
check_ifstatus didn't function correctly with SNMPv3. This is fixed now.
Created argument-hash for SNMP session creation. This removes redundant code.
Session creation was moved out of process_arguments() and now takes place
after setting the timeout handler.

Additionally the -P argument was added to specify the privprotocol.
2009-06-11 17:20:55 +02:00
Matthias Eble
e16b35b2ca Added testcases for check_ifoperstatus
Added testcases for check_ifoperstatus. No SNMPv3 testing
included for now.
2009-06-11 16:27:15 +02:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
Ton Voon
287cd311a2 Enhanced test for single letters in fqdn
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1549 f882894a-f735-0410-b71e-b25c423dba1c
2006-12-12 12:59:06 +00:00
Ton Voon
6c61b8c7bf More edge testcases. Allow anything if ends with a . as long as correct
characters


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1531 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-27 15:37:31 +00:00
Ton Voon
6728e60669 Fixed regression where hostnames with hyphens were rejected (1581402 - Holger Weiss)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1528 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-26 21:02:21 +00:00
Ton Voon
73b77a44c4 Allow directories and links to be tested by check_file_age. Sanitise output.
Added tests


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1297 f882894a-f735-0410-b71e-b25c423dba1c
2005-12-15 15:17:49 +00:00
Peter Bray
cdc06cc3e2 [1185704] New Testing Infrastructure.
Complete rewrite of the original testing infrastructure and
all test cases (to use the new infrastructure)
See NPTest.pm and issue 1185704 for more details.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1207 f882894a-f735-0410-b71e-b25c423dba1c
2005-07-25 01:47:15 +00:00
Ethan Galstad
44a321cb8a Initial revision
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2 f882894a-f735-0410-b71e-b25c423dba1c
2002-02-28 06:42:51 +00:00