Commit graph

3108 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
Sven Nierlein
19be129ff8 tests: enable plugins-root tests 2018-12-04 09:48:45 +01:00
Holger Weiss
c285edd2f3 Merge remote-tracking branch 'monitoring-plugins/pr/1560'
* monitoring-plugins/pr/1560:
  Add new flag --show-body/-B to print body
2018-11-10 19:22:05 +01:00
Tobias Wolf
9966ebcd84 Add new flag --show-body/-B to print body
This should help with figuring out ia problem at a glance when enabled for
healthz endpoints on web APIs, for example.

The content of the body can point to what the problem is and help with
diagnostics.

Fixes #1559
2018-11-09 23:48:56 +01:00
Holger Weiss
0863a4cb93 Merge remote-tracking branch 'monitoring-plugins/pr/1476'
* monitoring-plugins/pr/1476:
  test: Add proxy tests via proxy
  Allow user to specify HTTP method after proxy CONNECT
2018-11-06 12:49:18 +01:00
Markus Frosch
198611a3c2 test: Add proxy tests via proxy
On Travis with a local squid
2018-11-06 12:33:24 +01:00
Markus Frosch
d659f8d99f Allow user to specify HTTP method after proxy CONNECT
Simple format, avoids refactoring the CONNECT feature.
2018-11-06 11:32:27 +01:00
Sven Nierlein
82a634f7bf
Merge pull request #1552 from madpilot78/Avoid_passing_NULL_to_vprintf
Avoid passing NULL to vprintf().
2018-10-22 16:22:54 +02:00
Sven Nierlein
1c0a48bc6b
Merge pull request #1522 from Sp1l/fix-MariaDB10.2
Fix build issue with MariaDB 10.2
2018-10-22 16:21:05 +02:00
Sven Nierlein
26d84632b8
Merge pull request #1556 from TeamOfMonkeysNet/master
Added a compiled plugin script that was missing from gitignore
2018-10-13 20:16:49 +02:00
Lucas Bussey
ec4ef097c2 Added a compiled plugin script that was missing from gitignore 2018-10-13 07:44:39 -07:00
Guido Falsi
c76f59bcc0 Avoid passing NULL to vprintf(). 2018-09-29 16:22:44 +02:00
Sven Nierlein
22f13aa2f1
Merge pull request #1538 from wopfel/uptime-plugin
Uptime plugin
2018-07-26 07:31:37 +02:00
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
Bernard Spil
399cc14152
Fix build issue with MariaDB 10.2
As of 10.2 MariaDB no longer defines MYSQL_PORT.
2017-11-06 17:31:44 +01: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