Commit graph

194 commits

Author SHA1 Message Date
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
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
Jan Wagner
3fc149f499 Merge remote-tracking branch 'upstream/pr/1457' 2017-01-04 14:53:16 +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
Jan Wagner
6d0c111631 Creating and mounting randisk to make use of check_disk tests 2016-11-20 20:38:41 +01:00
Sven Nierlein
9e02d0c3e6 check_http: add host header tests
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-11 10:32:19 +01:00
Sven Nierlein
85cfc7b1aa tests: enable snmp tests
Enabled snmp tests against snmpd on localhost. It was installed already
in the travis file, we just need to enable the tests by setting the
parameters in the answers file.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-08 00:50:03 +01:00
Sven Nierlein
b838b75366 check_snmp: fix number of tests skiped 2016-11-08 00:38:55 +01:00
Sven Nierlein
1d4874240a check_snmp: add testcase for no datatype
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-08 00:29:42 +01:00
Sven Nierlein
948db2e3a2 tests: adjust check_http to new output format
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-07 22:46:06 +01:00
Sven Nierlein
aa7ed88c54 check_users: add new test cases
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-07 21:49:40 +01:00
Holger Weiss
0960239981 Let check_http test use HTTP/1.1 2016-02-22 21:59:58 +01:00
Holger Weiss
37928b52a5 Merge branch 'maint'
* maint:
  sslutils: Remove superfluous parenthesis for sslv3 function too
  sslutils: remove superfluous parenthesis
  check_snmp: modified tests
  check_snmp.c: switched DEFAULT_TIMEOUT to DEFAULT_SOCKET_TIMEOUT (provided by utils.h), already used by help description, see issue #1318
  install snmpd on travis tests
  enable libtab on travis builds
  add perl snmp to travis dependencies
  NEWS: Mention check_ups performance data fix
  Fix incorrect performance data thresholds
  check_dhcp: Fix option parsing
  Fixes segfaults when running via monitoring worker (off-by-one)
  travis: fix http test host
  sslutils: Check if OpenSSL supports SSLv3.

Conflicts:
	NEWS
	plugins/sslutils.c
2015-10-08 12:52:10 +02:00
Oliver Skibbe
2d677b19ed check_snmp: modified tests
(Closes #1325)
2015-10-04 13:40:04 +02:00
Sven Nierlein
1784b0ac0c add faketime based tests for check_http 2015-10-02 15:56:19 +02:00
Sven Nierlein
1c0ec88152 travis: fix http test host
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-02 10:30:01 +02:00
Sven Nierlein
d73c57aa06 travis: fix http test host
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-01 17:05:47 +02:00
Sven Nierlein
82e28411c8 check_ldap: fix number of skipable tests
Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2015-04-23 09:51:26 +02:00
Sven Nierlein
d309b1d2e9 add check_ldap test
install openldap on travis and grep base dn from slapcat.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-04-22 12:51:29 +02:00
Sven Nierlein
8e8d2d4243 tests: negate test fails when not run from plugins folder
Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-31 14:56:16 +02:00
Sven Nierlein
559d11b1fb tests: get current directory the perl way
instead of hoping to have it in the environment. This at
least broke tests on solaris.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-31 13:47:19 +02:00
Sven Nierlein
2acf9a63d3 check_dns: added test for nonresponsive dns server (#982)
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-07-30 11:49:50 +02:00
Holger Weiss
c5a64eeef8 plugins/t/check_dns.t: Fix Perl warning
Perl said: "Unrecognized escape \d passed through at ./t/check_dns.t
line 57."
2014-07-21 13:59:22 +02:00
Jan Wagner
71063655e5 travis-ci: Adding ports for check_hpjd 2014-07-20 23:36:18 +02:00
abrist
479509ad59 added tests for check_hpjd port options
---
Closes #1160 and #973
2014-07-20 23:36:05 +02:00
abrist
78d00d338a check_ntp.t - fixed tests for new status output
closes #1236 and #1239
2014-07-20 23:35:03 +02:00
Mikael Falkvidd
f54d10fe9b check_procs: Add delay after forking in test
Forking raises a race condition, where the parent might run the
test before the child has had time to fork. If that happens,
an error similar to this is produced:
 Failed test 'Output correct'
 at ./t/check_procs.t line 32.
                 'PROCS OK: 0 processes with args 'sleep 7' | processes=0;;;0;'
   doesn't match '/^PROCS OK: 1 process?/'

Sleeping a bit should avoid the problem. It might be enough to
sleep less than a second, but perl's built-in sleep function only
supports integer seconds.

In our build environment, the build failed 3 of 4 times before
this patch. After the patch it failed 0 of 7 times.

Signed-off-by: Mikael Falkvidd <mfalkvidd@op5.com>
2014-07-10 21:10:48 +02:00
Jan Wagner
b62f2c14fb Merge PR #1265 from waja/check_tcp_server_addr 2014-06-30 15:13:39 +02:00
abrist
4277f47bff check_jabber.t - fixed tests for new status output including hostname 2014-06-30 13:55:42 +02:00
Sven Nierlein
e566021a54 tests: added check_dns performance data test
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-06-28 22:05:25 +02:00
Sven Nierlein
b35d12e931 tests: always build and test on travis
also make test is now working on travis-ci

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-06-24 15:07:44 +02:00
Sven Nierlein
93901d5ff1 tests: fping checks require being root or setuid root
on the fping binary. Check this before running the test.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13 15:23:18 +02:00
Anton Lofgren
4e0da0216d check_snmp: Handle SNMPv3 noAuthNoPriv properly
The SNMPv3 noAuthNoPriv security level, somewhat unintuitively, requires
a security name to be passed along together with the request. Check_snmp
previously did not do this, causing snmpget to throw an error:

"External command error: No log handling enabled - turning on stderr
logging
snmpget: No securityName specified"

This patch fixes the issue by always providing the security name when
noAuthNoPriv is specified.

See also:
https:://bugs.op5.com/view.php?id=8385.

Signed-off-by: Anton Lofgren <alofgren@op5.com>
2014-04-24 08:49:54 +02:00
Thomas Guyot-Sionnest
fc9fbe1e89 Typo 2014-01-29 02:16:47 -05:00
Thomas Guyot-Sionnest
c30be5877c Clarify check_mysql test prompts
Also default to "-u test -ptest" which are default MySQL accounts only
missing the prescribed privileges.

The database is no longer specified as it is not used.
If wanted is should be its own parameter/tests.
2014-01-28 02:35:09 -05:00
Holger Weiss
7ee3525423 Merge branch 'maint'
* maint:
  check_ssh: Get rid of sshd: Read from socket failed: Connection reset by peer
  fixed tests when there is no direct internet connection
  NEWS: Mention fix for check_http's -S option
  Fix for SSL Versioning when multiple options are used.
  Fix #1217 spec file fails to build due to duplicate files and unused files
  check_http: Don't let "-N" expect an argument
  README: Change GitHub URL
  README: Clarify license notice
  Update URLs and mailing list addresses
  Just using the posix conform extended regular expression grep
  check_oracle: --db +ASM bad string matching check_oracle doesn't correctly check for pmon +ASM instance from at least Oracle 11 as the pmon proces was renamed from ora_pmon_.* to asm_pmon_.*. -- Just turning attached patch of github issue #1207 into a push request. (Closes #1207)
  Update web site URLs

Conflicts:
	FAQ
	NEWS
	README
	SUPPORT
	configure.in
	monitoring-plugins.spec.in
	pkg/solaris/pkginfo.in
	plugins-root/check_dhcp.c
	plugins-root/check_icmp.c
	plugins-scripts/check_ifoperstatus.pl
	plugins-scripts/check_mssql.pl
	plugins/check_apt.c
	plugins/check_by_ssh.c
	plugins/check_cluster.c
	plugins/check_dbi.c
	plugins/check_dig.c
	plugins/check_disk.c
	plugins/check_dns.c
	plugins/check_dummy.c
	plugins/check_fping.c
	plugins/check_game.c
	plugins/check_hpjd.c
	plugins/check_http.c
	plugins/check_ide_smart.c
	plugins/check_ldap.c
	plugins/check_load.c
	plugins/check_mrtg.c
	plugins/check_mrtgtraf.c
	plugins/check_mysql.c
	plugins/check_mysql_query.c
	plugins/check_nagios.c
	plugins/check_nt.c
	plugins/check_ntp.c
	plugins/check_ntp_peer.c
	plugins/check_ntp_time.c
	plugins/check_nwstat.c
	plugins/check_overcr.c
	plugins/check_pgsql.c
	plugins/check_ping.c
	plugins/check_procs.c
	plugins/check_radius.c
	plugins/check_real.c
	plugins/check_smtp.c
	plugins/check_snmp.c
	plugins/check_ssh.c
	plugins/check_swap.c
	plugins/check_tcp.c
	plugins/check_time.c
	plugins/check_ups.c
	plugins/check_users.c
	plugins/negate.c
	plugins/urlize.c
	plugins/utils.h
	po/Makevars
	po/de.po
	po/fr.po
	po/monitoring-plugins.pot
2014-01-21 16:07:38 +01:00
Holger Weiss
a8c9b696f4 Minor fixes to be amended into "rename" commit 2014-01-20 03:01:55 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Sven Nierlein
d8354ec15d fixed tests when there is no direct internet connection
- check http had wrong number of skipped tests
 - check tcp did not use the 'no internet' flag at all
2013-12-27 01:14:50 +01:00
Sven Nierlein
4ab4c8dd32 make testing check_proc not rely on bash
also grandparents make this test fail but is not a problem in real live.
NPTest->testCmd uses "sh -c" already, so there is no need to do that twice.
2013-11-20 21:42:25 +01:00
Anton Lofgren
77fc3548ae check_procs: ignore plugin parent process
This fixes an issue that appears when running check_procs over NRPE,
where the default shell is configured to (for example) dash, as is the
case on Debian.

dash (and tcsh, and mksh, and probably others), when invoked with -c forks an additional process
to execute the argument string. Contrast this with bash, which does not
do this, provided that the argument string simply can be exec()'d as-is.

To demonstrate:
$ bash -c pstree
init─┬ ..
    ...
	├─sshd─-─sshd───pstree

versus
$ dash -c pstree
init─┬ ..
    ...
	├─sshd─-─sshd───dash───pstree

The consequence of this fork is that the following invocation:
    /opt/plugins/check_procs -a init

will result in this output:

    PROCS OK: 2 processes with args 'init' | processes=2;;;0;

because the check_procs, in addition to finding the actual init process,
finds its parent shell as well.

This example is a bit contrived, but I think it illustrates the
point.

This wouldn't really be a problem, and normally isn't, if it weren't
for the fact that NRPE uses a call to popen() which does exactly the
above (executes '/bin/sh -c ...'), causing inconsistent behaviour
between distributions and much confusion for end users.

The argument may be made that the dash process spawned by NRPE is just a
process like any other, and should therefore be included in the process
count just like any other. However, this is not very intuitive, because
of the previously mentioned inconsistencies.

The argument might also well be made that we're _never_ interested in the
immediate ancestor of the plugin, and while it is unknown how many
installations have already made the necessary modifications to their
setups to make up for the fact that the plugin behaves the way it does,
it is not deemed worthwhile to entertain such workarounds.

Thus, this patch ignores the parent process.

See also these bug reports:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626913
http://sourceforge.net/p/nagiosplug/bugs/512/
https://github.com/nagios-plugins/nagios-plugins/issues/999
https://bugs.op5.com/view.php?id=4398
2013-11-19 23:57:27 +01:00
Holger Weiss
aac0980edb Change default host names for some tests
Testing "nagiosplugins.org" will currently not work.
2013-09-29 00:14:17 +02:00
Sven Nierlein
065905e900 check_disk: die with a reasonable error message if one mount point hits average value 2013-09-17 20:12:32 +02:00
Sven Nierlein
9090beb058 check_ssh: added test case 2013-09-17 12:13:51 +02:00
Sven Nierlein
b83904c528 check_by_ssh: tests expand key and config path
some systems do not expand the path automatically.
2013-09-17 11:34:06 +02:00