Commit graph

2539 commits

Author SHA1 Message Date
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
Holger Weiss
1fec8fb294 NEWS: Add WARNING regarding the check_procs change
Closes #1205.
2013-11-20 00:10:30 +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
dc3fc90e2a developer-guidelines.sgml: Fix URL
Fix the Test::Simple tutorial URL.
2013-10-28 16:48:48 +01:00
Holger Weiss
22de59d0ef developer-guidelines.sgml: Remove Tinderbox link
We don't run a Tinderbox instance anymore.  (Noted by "zathras" on IRC.)
2013-10-28 16:10:31 +01:00
Holger Weiss
f6576c6db4 NEWS: Mention "contrib" removal
Add a note regarding the removal of the "contrib" directory to the NEWS
file.  This note is missing from the NEWS file shipped with the 1.5
release, though.
2013-10-03 03:20:51 +02:00
Holger Wei
c38a0b8a03 Prepare for the 1.5 release 2013-10-02 17:21:01 +02:00
Holger Weiss
aebdf1890a FAQ: Update CVS references
We moved from CVS to Git.
2013-10-02 10:55:44 +02:00
Jan Wagner
c54625ecc1 tools: Update CVS references
We moved our stuff from CVS/SourceForge to Git/GitHub.
2013-10-02 09:54:15 +02:00
Jan Wagner
3052b7856e doc: Updated CVS references
We moved our stuff from CVS/SourceForge to Git/GitHub.
2013-10-02 09:54:11 +02:00
Holger Weiss
503f61c0f6 README: Update URLs
We moved the Nagios Plugins site from SourceForge to our project server.
2013-10-02 01:40:50 +02:00
Holger Weiss
1797356e5c SUPPORT: Update CVS/SourceForge references
We moved our stuff from CVS/SourceForge to Git/GitHub.
2013-10-02 01:37:21 +02:00
Holger Weiss
c188965c3c Update THANKS file
Add all new Git commit authors to the THANKS.in file.
2013-09-30 11:04:38 +02:00
Holger Weiss
5e06edebf4 AUTHORS: Tiny cosmetic change 2013-09-30 11:04:04 +02:00
Holger Weiss
ffcef17dde Add Jan Wagner to the list of AUTHORS 2013-09-30 09:56:32 +02:00
Holger Weiss
a5ba45544e Add Eric Stanley to the list of AUTHORS 2013-09-30 09:51:38 +02: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
Holger Weiss
4ad0f80ec3 Add tools/generate-change-log
Add the tools/generate-change-log script for auto-generating the
ChangeLog file from the Git history when running "make dist".
2013-09-28 00:58:02 +02:00
Holger Weiss
9ae1cd8f91 tools: Remove Drupal/SourceForge scripts
We moved our web site away from Drupal and the snapshots/guidelines away
from SourceForge.  The new infrastructure scripts will be maintained in
a separate repository together with the Markdown source of the new web
site.
2013-09-27 23:10:53 +02:00
Holger Weiss
983d10e060 Remove tools/git2svn.pl
We no longer mirror out Git repositories into Subversion.
2013-09-27 22:43:08 +02:00
awiddersheim
d4c5730464 Die on SSL initialization errors
Fixes issue where if an SSL initialization error occurs on a redirect
using -f follow the plugin still returns an OK state.

Closes #1159.
2013-09-26 17:01:28 +02:00
Holger Weiss
7193db3c41 developer-guidelines.sgml: Normalize spelling
- Write "plugin" instead of "plug-in".
- Write "development guidelines" instead of "developer guidelines"
- Capitalize "Nagios Plugin Development Guidelines".
2013-09-25 09:49:18 +02:00
Holger Weiss
7b6288d4f4 README: Minor cosmetic change 2013-09-22 14:37:46 +02:00
Holger Weiss
04a8f40a96 README: Apply another few cosmetic changes 2013-09-20 17:08:03 +02:00
Holger Weiss
95468ffe47 Add symlink: README.md -> README
Add a symlink so that GitHub renders the README file as Markdown.
2013-09-20 17:00:40 +02:00
Holger Weiss
1a5d2f24f6 README: Use code blocks for commands 2013-09-20 16:58:17 +02:00
Holger Weiss
bce7e739cc Remove the BUGS file
The BUGS file wasn't maintained properly anymore.  And doing so makes no
sense.  That's what the bug tracker is for.
2013-09-20 16:53:55 +02:00
Holger Weiss
a7d50ec713 README: Convert to Markdown and apply cleanups
Use the Markdown format for the README file and apply various minor
cosmetic changes.
2013-09-20 16:50:49 +02:00
Holger Weiss
08a9ac3d80 README: Remove outdated information 2013-09-20 16:31:18 +02:00
Holger Weiss
6f0366c8b8 check_pgsql: Don't exit UNKNOWN instead of OK
Since commit 912df3ef9b, check_pgsql
exited UNKNOWN instead of OK if the new --query option was *not*
specified.  This bug is fixed now.
2013-09-19 12:41:42 +02:00
Sven Nierlein
843bbfb75a tests: only write cache file if it changed
Tests sometimes fila when running multiple parallel tests using the
same cache file because it is written everytime a test parameter
is read. Since there is no locking, this might fail from time to time.
2013-09-18 11:03:00 +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
6e9d16809e check_dhcp: fix mac address and interface number detection on solaris
newer (or x86) solaris implementations have interface names like e1000g0
which includes numbers. So we reverse the interface number detection to
get the last number, instead of the first number.
2013-09-17 19:56:55 +02:00
Sven Nierlein
08d554ada1 check_dhcp: fix tests interface detection 2013-09-17 13:13:26 +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
Sven Nierlein
ddff48fb25 check_udp: skip tests which rely on udp listen
solaris netcat does not listen in udp mode due to
http://sourceforge.net/p/netcat/bugs/27/
2013-09-17 11:23:12 +02:00
Sven Nierlein
c7ea2aed74 check_disk_smb: fixed number of tests to skip 2013-09-17 10:23:08 +02:00
Sven Nierlein
982cbeea00 check_disk: get_fs_usage hasn't been run if using groups
the reason why it still worked sometimes was fsu_blocks beeing uninitialized
which resulted in a true test sometimes.
2013-09-16 15:30:56 +02:00
Sven Nierlein
63312395ee check_disk_smb: verify path to smbclient 2013-09-16 13:59:27 +02:00
Sven Nierlein
adc9d71b4b check_procs: fix test with sleeping processes
at least on freebsd, there are a processes with state 'S', they always
use two character status.
2013-09-16 13:49:44 +02:00
Sven Nierlein
c001fb98ff check_http: tests use supplied value if possible 2013-09-16 13:49:44 +02:00
Sven Nierlein
2b23caf3d1 check_dhcp: fix tests for machines with default interace != eth0 2013-09-16 13:49:44 +02:00
Sven Nierlein
0b656ecd2f tests: don't skip utils test 2013-09-16 08:59:37 +02:00
Sven Nierlein
095e2e5db5 check_dhcp test: skip subtests if no variable is set 2013-09-16 08:51:04 +02:00
Sven Nierlein
5d58592cfe check_dhcp: add test file 2013-09-15 22:15:21 +02:00
Sven Nierlein
3c958ac738 check_icmp: tests do not require sudo if run by root 2013-09-15 21:57:27 +02:00
Sven Nierlein
a7f5e8a765 plugins-root: include t folder in release tarball 2013-09-15 21:33:29 +02:00
Sven Nierlein
cb8390aec9 check_tcp: use receive timeout for checks that expect response
if check_imap expects a string that never occurs, it currently waits forever
because thats how the imap protocoll works. Use a receive timeout in that case
so we can exit early with a proper error message.
2013-09-15 20:49:36 +02:00
Sven Nierlein
c900ee2772 check_ping: increase test timeout
freebsds ping takes a few seconds till it returns, so a 1 second timeout does
not work for the test.
2013-09-14 21:06:26 +02:00