Commit graph

186 commits

Author SHA1 Message Date
Holger Weiss
ae24aaeefb Use FindBin consistently across Perl plugins
Use Perl's FindBin module to locate the path to utils.pm in
check_file_age.pl and check_mssql.pl, just as we do in other Perl
plugins.
2014-06-18 18:45:10 +02:00
Sam Kottler
97b0780376 Update the last remaining instance of the old FSF address 2014-03-20 10:01:31 +01:00
Holger Weiss
0c5b362c30 Disable Perl's "taint" checks
Perl's "taint" checks don't like `use lib "$FindBin::Bin"'.

Cf. http://www.perlmonks.org/?node_id=585299
2014-02-28 22:05:18 +01:00
Holger Weiss
c08d6a429b Replace "plugins-scripts/subst.in" foo
Remove the buggy and complex awk(1) magic in "plugins-scripts/subst.in"
in favor of simple sed(1) substitutions.

The plugins in the "plugins-scripts" directory now always use the PATH
specified via "./configure --trusted-path", or the default PATH
hard-coded in "configure.ac".

Fixes #1242.
2014-02-28 13:28:33 +01:00
Holger Weiss
e260efb256 Merge remote-tracking branch 'awiddersheim/fix_trusted_path'
* awiddersheim/fix_trusted_path:
  Fix trusted path

Conflicts:
	plugins-scripts/check_ntp.pl
	plugins-scripts/subst.in

Closes #1212.
2014-02-28 13:22:34 +01:00
Evgeni Golov
2d49468a25 subst.in: remove the led() function
It was only used to replace the 'use lib utils.pm' with the proper
libexec dir, which is now solved by using Perl's FinBin.

Closes #1241
2014-02-27 20:58:49 +01:00
Evgeni Golov
9408c975fe utils.pm: use FindBin instead of awk to find the path to
'use lib utils.pm' is not valid Perl syntax:
 Bareword "utils" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.
 Bareword "pm" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.

This makes it impossible to use the plugins directly from the git tree,
e.g. while hacking on them.

Using FindBin::Bin as the library path allows that, while preserving
the original behaviour of adding the libexec path when the plugin is
properly installed.
2014-02-27 20:56:50 +01:00
Evgeni Golov
1988e49fce check_mailq: add $mailq to check output, so it is easily visible what was autodetected
Closes: #1242
2014-02-27 20:44:58 +01:00
Evgeni Golov
f14ae4b99a check_mailq: document autodetection in the usage output 2014-02-27 20:33:35 +01:00
Evgeni Golov
be9aa5aba2 check_mailq: try to autodetect which mailq implementation we are using
This is done by looking at some common directories and files each
MTA installs on the system. If no known file is found, the old default
sendmail is used. Of course this still can be overridden by -M.
2014-02-27 20:33:14 +01:00
Jan Wagner
2dc150da81 check_mailq: adding nullmailer support
Adding nullmailer support to check_mailq submitted by Luca Corti

Closes: #740
Closes: #1189
2014-01-29 13:45:36 +01:00
Jan Wagner
297d0535c2 Just fixing small typo in comment 2014-01-29 10:12:31 +01: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
Thomas Guyot-Sionnest
43fbde678c Remove obsolete check_ntp.pl 2014-01-23 09:06:58 -05:00
Lars Vogdt
42e77f9f51 fix outdated Free Software Foundation address 2014-01-22 11:43:31 +01:00
Holger Weiss
01e570f4a4 Capitalize "Monitoring Plugins"
"Monitoring Plugins" is a name.
2014-01-21 16:19:20 +01: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
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
Holger Weiss
9db763963f utils.sh: Don't define $ECHO
In utils.sh, $ECHO was set to printf(1) or echo(1), depending on whether
printf(1) is available in /usr/bin.  This resulted in various bugs, as
printf(1) cannot be used in the same way as echo(1).

Thanks to Trevor Hemsley for reporting one of those bugs: If $ECHO was
set to printf(1), check_log stumbled when reporting a log line with a
"%" character.
2014-01-13 22:55:43 +01:00
Holger Weiss
3c90a370ea Update URLs and mailing list addresses
Now that we moved our infrastructure away from SourceForge, update the
URLs and mailing list addresses accordingly.
2013-10-28 23:58:36 +01:00
awiddersheim
0a3252d88d Fix trusted path
When configuring the plugins you have the option to specify a trusted path with --with-trusted-path. This option seems to have been deprecated at some point for unknown reasons and had typically had no affect. This commit makes this option work again for those who have a desire to use it. There should be no affect on those who have not chosen to specify a trusted path.
2013-10-22 10:33:56 -04:00
Jan Wagner
3e2d2fcf1f Just using the posix conform extended regular expression grep 2013-10-22 10:42:22 +02:00
Jan Wagner
facb416ef8 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)
2013-10-22 08:23:38 +02:00
Sven Nierlein
c7ea2aed74 check_disk_smb: fixed number of tests to skip 2013-09-17 10:23:08 +02:00
Sven Nierlein
63312395ee check_disk_smb: verify path to smbclient 2013-09-16 13:59:27 +02:00
Holger Weiss
4eab02cdaf Merge branch 'master' of https://github.com/rafaeldriutti/nagios-plugins
* 'master' of https://github.com/rafaeldriutti/nagios-plugins:
  Changed the smbclient command used to fetch the free space available on the samba shares. Using du instead of ls, since it's much faster, specially with shares that have a lot of files.

Closes #63.
2013-08-20 16:50:52 +02:00
Rafael
febe7b7075 Changed the smbclient command used to fetch the free space available on the samba shares. Using du instead of ls, since it's much faster, specially with shares that have a lot of files. 2013-08-12 15:52:22 -03:00
Gabriele Tozzi
774647f60c Made verbose output of check_sensors compilant 2013-05-19 04:24:21 +02:00
Brian De Wolf
b57dc1b3a0 Add option to perform real login in check_oracle
The Oracle plugin has no option for testing for a successful login.  The
closest option to this is --login, which uses a fixed set of credentials and
expects to receive the logon failure error code.

This patch adds an option called --connect.  This option takes a full SID and
returns success if it doesn't detect any error codes.  With this, we can check
that a database is allowing logins from valid credentials (and avoid filling up
DB logs with failed authentications).
2013-03-25 23:25:08 +01:00
Marc Huffnagle
0656a0e284 Added additional documentation to the check_range function 2012-10-09 09:54:03 +02:00
Holger Weiss
d61a3056c5 check_disk_smb: Add performance data
(Debian #654259 - Charles-Henri Larose)
2012-06-23 10:22:08 +02:00
Holger Weiss
804e7d878c Mention the check_range function in NEWS, etc. 2012-05-29 14:27:58 +02:00
Alex Griffin
aab6b8a16c Added check_range shell function to utils.sh.in 2012-05-29 14:07:37 +02:00
Holger Weiss
5532dbe48a check_sensors: Use symbolic exit codes
Specify the exit codes by using the constants from utils.sh.
2011-09-07 14:04:01 +02:00
Holger Weiss
f720f4a3c0 check_sensors: Minor whitespace fixes 2011-09-07 13:57:38 +02:00
Holger Weiss
276c5b98bf check_sensors: Detect FAULT status
Return an UNKNOWN status if a faulty sensor is detected.  This can be
suppressed with the new "--ignore-fault" option.

(Fixes Debian bug #615133, patch suggested by Jan Wagner.)
2011-09-07 13:55:53 +02:00
Matthias Eble
9faccbb261 add test cases for check_disk_smb 2010-11-28 22:08:54 +01:00
Matthias Eble
3c67c9cb60 check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696) 2010-11-28 21:43:48 +01:00
Matthias Eble
0892c4ac28 Make check_disk_smb accept spaces in share names (#990948, #1370031, Debian #601699) 2010-11-28 21:35:59 +01:00
Ton Voon
0205c7c0cf Allow check_ifstatus to accept version=2c 2010-07-07 09:56:21 +01:00
Holger Weiss
7a661c7aed Fix Debian bug #545940: Failure when run via ePN
If Perl's "shift" function is called outside of a subroutine and without
any argument, it usually shifts @ARGV.  However, if a plugin is executed
via ePN, such a call will shift @_ instead, so we must explicitly
specify @ARGV for this to work as expected.

This fixes Debian bug #545940, see: http://bugs.debian.org/545940

Commit de7191e342 fixed the same issue for
check_disk_smb.

(Reported by Hendrik Jaeger, forwarded by Jan Wagner.)
2010-04-12 15:36:33 +02:00
Holger Weiss
614e9dec5e Fix Debian bug #478942: Fragile argument passing
Fix some problems regarding the way check_disk_smb passes command line
arguments to smbclient(1).

| It runs:
|
| 	$res = qx/$smbclient "\/\/$host\/$share" $pass -W $workgroup \
| 	       -U $user $smbclientoptions -I $address -c ls/;
|
| [...]
|
| The documentation says that if the password is not passed, it
| defaults to "".  That is not true above, as $pass expands to
| nothing which leaves no argument at all (instead of an empty
| argument) so is different from providing with an empty password
| or with the -N option.
|
| Also, if the password starts with "-", you're in trouble, that's
| why -U $user%$pass may be prefered.
|
| Also, the doc says that if $user is not provided, then it
| defaults to "guest" but the problem is that if it is provided
| but empty, it is changed to "guest" as well, which prevents us
| from querying hosts that don't do user authentication.

[ http://bugs.debian.org/478942 ]

(Fixed by Stephane Chazelas, forwarded by Jan Wagner.)
2010-04-11 10:54:44 +02:00
Holger Weiss
de7191e342 Fix Debian bug #478906: Failure when run via ePN
| When perl plugin scripts are run with the embedded perl interpreter in
| nagios3, the "shift" perl command doesn't shift @ARGV, but @_ (which
| happens to contain the same thing as @ARGV at the time the script was
| started).
|
| [...]
|
| A fix is to replace all the instances of "shift" with "shift @ARGV".

[ http://bugs.debian.org/478906 ]

(Fixed by Stephane Chazelas, forwarded by Jan Wagner.)
2010-04-11 09:54:10 +02:00
Holger Weiss
e461341003 Fix Debian bug #425129: SMB guest mode won't work
| The check_disk_smb plugin purports to support guest users, but it
| doesn't work out, because it doesn't specify the -N command line
| option to smbclient when no password is specified, making smbclient
| stop and ask.

[ http://bugs.debian.org/425129 ]

(Fixed by Josip Rodin, forwarded by Jan Wagner.)
2010-04-11 09:39:24 +02:00
Holger Weiss
5a1babdae8 check_disk_smb: Allow for specifying an IP address
Add the "-a, --address option" which allows for specifying the IP
address of the server to connect to.  If this option is used, the IP
address will be handed over to smbclient(1)'s "-I" option.  (Contributed
by Sean Finney, forwarded by Jan Wagner.)
2010-04-11 01:57:11 +02:00
nagiosplugins
43c187a944 Allow custom versions with the release file... 2009-09-25 09:31:04 +00:00
Thomas Guyot-Sionnest
bc3c8c7cfb Fix check_ircd binding to wrong interface (#668778) 2009-09-19 02:08:51 -04: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
c66d2c6b3b renamed check_ifoperstatus' newly introdced -x to -P so it fits check_ifstatus
check_ifstatus already used -x so both plugins can use same short option, now.
to specify privacy protocol.
2009-06-11 17:24:52 +02:00