Commit graph

3094 commits

Author SHA1 Message Date
Bernd Arnold
6a8564fb44 Fixed error message, added comment 2018-06-17 09:42:25 +02:00
Bernd Arnold
37f9b45266 Drop uptime binary call
No need to call /bin/uptime, since the string can be generated with strftime(...).
2018-06-17 09:36:13 +02:00
Bernd Arnold
28f4d144f2 Added help text for range support 2018-06-17 09:20:16 +02:00
Bernd Arnold
b40d660bb3 Remove useless (empty) print 2018-06-17 09:19:55 +02:00
Sven Nierlein
0b9c85109b fix typo in check_uptime 2018-06-13 20:23:21 +02:00
Sven Nierlein
ae7c16306c add check_uptime to makefile 2018-06-13 20:23:07 +02:00
Bernd Arnold
cf157ef845 Refactoring
Better alignment.
Avoid duplications ("Exceeds ... threshold").
2018-06-13 17:28:53 +02: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
a784b19d6f Modified alignment 2018-06-13 16:10:17 +02:00
Bernd Arnold
9ee884b3de Fix: Use macro for perl binary
I've messed that up in the previous commit 554b702f9d.
2018-06-13 15:57:16 +02:00
Bernd Arnold
5a73671ec6 Fix: Initialize values
Otherwise, there's a warning about unitialized values:
Use of uninitialized value $hours in numeric gt (>) at ...
Use of uninitialized value $days in numeric gt (>) at ...
2018-06-09 10:02:23 +02:00
Bernd Arnold
554b702f9d Fix: uptime_file variable was declared too late
When called with --help, the following error was shown:
Use of uninitialized value $uptime_file in concatenation (.) or string at
2018-06-03 20:55:42 +02:00
Bernd Arnold
250adb31ef Added test file 2018-06-03 16:51:43 +02:00
Bernd Arnold
d5fbf8ae93 Added suffix "s" for seconds in perfdata output 2018-06-03 16:42:34 +02:00
Bernd Arnold
44816b4979 Rename to .pl
All other check script also have the .pl ending
2018-06-03 16:05:54 +02:00
Bernd Arnold
de0872e2d7 Replaced my values with macros 2018-05-30 19:11:06 +02:00
Bernd Arnold
96c8dd8935 My version of check_uptime
Derived from check_mailq
2018-05-30 19:03:43 +02:00
Sven Nierlein
9661ee7488 Merge pull request #1505 from m-kraus/patch-1
Output plugin's stderr to stderr
2017-09-04 16:56:56 +02:00
Michael Kraus
6e67b638f8 Output plugin's stderr to stderr
Output plugin's stderr to stderr and do  not exit with WARNING in that case
2017-09-04 16:36:19 +02:00
Sven Nierlein
b3d39e605e Merge pull request #1474 from odenbach/vport
Added tests for virtual port behaviour. Separated from all other test…
2017-05-04 23:19:51 +02:00
Sven Nierlein
d0e03032f1 Merge pull request #1485 from kbabioch/fix/spelling
plugins: check_dig: Fix spelling
2017-04-21 11:49:17 +02:00
Karol Babioch
e0b8ebaa77 plugins: check_dig: Fix spelling 2017-04-21 01:38:39 +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
phowen
d332ee1fa0 resolve issues from code review 2017-04-05 10:27:37 +01:00
Christopher Odenbach
9326543c2e Added tests for virtual port behaviour. Separated from all other tests this time. 2017-03-26 22:36:58 +02:00
Sven Nierlein
8306e76c32 Merge pull request #1471 from sni/master
script tests: fix relative lib path in utils test
2017-03-13 16:00:24 +01: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
Sven Nierlein
c810dd0dfc Merge pull request #1469 from sni/master
make tests more reliable
2017-03-13 11:47:52 +01:00
Sven Nierlein
77aa6d4ebf udp test: prefer nc over netcat syntax
sles 12 systems have netcat symlinked to nc and so expect nc syntax for netcat.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
e90c63712e check_disk test: increase assumed thresholds
The check_disk fails if the build system has more than 100GB of free disk
space. Lets make this 100TB and we are safe for a couple more years.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
0cff5f2d93 remove hardcoded verisign.com tests
and make it configurable

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
d721efc10b make travis tests more reliable
- add-apt-repository might be missing, so install it to be sure
- killing ntp might fail if there is none
- removing ipv6 from etc/hosts should not fail

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
3b962208e7 fix timeout issue with check_disk_smb
check_disk_smb hangs if the smbclient is still running. So send a sigint to all
childs and exit cleanly.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
b3dee5c4bf make snmp tests more reliable
snmp tests fail if the snmp daemon runs systemd, then the process with 1 has arguments. Convert
the test into a regex which works for sysv and systemd.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
9daeceaed3 check_dns: fix error detection on sles nslookup
on sles (ex. 11sp1) systems the nslookup output for not found was not parsed correctly
and interpreted as ok when it should be critical:

./check_dns -H nosuchhost.nodomain -t 1 -vvv
/usr/bin/nslookup -sil nosuchhost.nodomain Server:         10.0.2.3
Address:        10.0.2.3#53
Non-authoritative answer:
*** Can't find nosuchhost.nodomain: No answer
DNS OK: 0.011 seconds response time. nosuchhost.nodomain returns |time=0.010892s;;;0.000000

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 21:02:58 +01:00
phowen
98a365d76c add range checking to check_file_age 2017-02-14 15:19:18 +00:00
Jan Wagner
0d73b499dd NEWS: Add missing changes 2017-01-17 16:34:32 +01:00
Jan Wagner
711a6aa2ff Merge remote-tracking branch 'upstream/pr/1427'
Closes: #1256
Closes: #1458
2017-01-17 16:25:11 +01:00
Valentin Vidic
43ce70bcdb check_apt: Add -l/--list option to print packages 2017-01-16 17:54:00 +01:00
Holger Weiss
89d00d1c00 Apply another spelling fix 2017-01-10 21:34:58 +01:00
Jan Wagner
10fa79a97a Merge branch 'spell_fix' 2017-01-10 20:33:16 +01:00
Jan Wagner
3fc149f499 Merge remote-tracking branch 'upstream/pr/1457' 2017-01-04 14:53:16 +01:00
Jan Wagner
d9a1fb15dd Merge remote-tracking branch 'upstream/pr/1456' 2017-01-04 13:29:00 +01:00
Christian Schmidt
bf18dc42dd Add --only-critical switch to check_apt 2016-12-31 12:00:46 +01:00
Nicolai
6a0f4fe275 check_dns: Small test cleanup 2016-12-23 22:59:42 +01:00
Nicolai
b9f00386a1 check_dns: Fix travis tests
(or try to fix it...)
2016-12-23 21:04:36 +01:00
Nicolai
ea756ac4ad check_dns: Tests and info 2016-12-23 20:44:45 +01:00
Nicolai Søborg
22e78763ea check_dns: Accept CIDR 2016-12-21 17:24:29 +01:00
Patrick Rauscher
f524b15e57 check_dns: allow for IPv6 RDNS 2016-12-20 21:59:58 +01:00