Code

nagiosplug.git
13 years agocheck_dbi: Added simple regex example to help output. sh/check_dbi
Sebastian Harl [Mon, 18 Apr 2011 11:47:26 +0000 (13:47 +0200)]
check_dbi: Added simple regex example to help output.

13 years agocheck_dbi: Added SERVER_VERSION metric.
Sebastian Harl [Mon, 18 Apr 2011 11:33:41 +0000 (13:33 +0200)]
check_dbi: Added SERVER_VERSION metric.

This metric compares the database engine server version with the specified
ranges. The version string [[[[A.]B.]C.]D.]E[.] is returned as E + D*100 +
C*10000 + B*1000000 + A*100000000 (see libdbi's dbi_conn_get_engine_version()
documentation).

13 years agocheck_dbi: Added -r and -R options.
Sebastian Harl [Mon, 18 Apr 2011 11:04:28 +0000 (13:04 +0200)]
check_dbi: Added -r and -R options.

These options may be used to specify an extended POSIX regular expression that
is applied to the query result. When using -R, a case-insensitive match is
done.

The options may not be mixed with -w/-c/-e.

13 years agocheck_dbi: Added -e option.
Sebastian Harl [Fri, 15 Apr 2011 14:19:16 +0000 (16:19 +0200)]
check_dbi: Added -e option.

This option may be used to specify a string that is expected as the query
return value. The string is compared to the query result using strcmp().

The option may not be mixed with -w/-c.

13 years agocheck_dbi: Added some examples to the help output.
Sebastian Harl [Fri, 15 Apr 2011 13:02:48 +0000 (15:02 +0200)]
check_dbi: Added some examples to the help output.

13 years agocheck_dbi: Added QUERY_TIME metric.
Sebastian Harl [Fri, 15 Apr 2011 12:37:21 +0000 (14:37 +0200)]
check_dbi: Added QUERY_TIME metric.

This metric checks the execution time of the specified query. In case the
query does not return any (parsable) data, this is not treated as an error
when using this metric.

13 years agocheck_dbi: Replaced -W/-C with -m.
Sebastian Harl [Fri, 15 Apr 2011 11:35:09 +0000 (13:35 +0200)]
check_dbi: Replaced -W/-C with -m.

The -m option may be used to specify a metric to check the thresholds against.
This is more flexible than --conntime-warning/--conntime-critical (-W/-C) as
it may be extended to support further metrics without introducing tons of
arguments. Also, it does not make much sense to check the conntime and query
result at the same time.

Currently, the metrics CONN_TIME and QUERY_RESULT are available.

A query is no longer required unless QUERY_RESULT (the default) is used.

13 years agocheck_dbi: Fixed/improved perfdata output.
Sebastian Harl [Fri, 8 Apr 2011 08:58:00 +0000 (10:58 +0200)]
check_dbi: Fixed/improved perfdata output.

 - do not use zero as 'min' value for the query result perfdata

 - added all semicolons

13 years agocheck_dbi: Check and report the time used by the query.
Sebastian Harl [Thu, 7 Apr 2011 16:09:33 +0000 (18:09 +0200)]
check_dbi: Check and report the time used by the query.

13 years agocheck_dbi: Added threshold ranges for the connection time.
Sebastian Harl [Thu, 7 Apr 2011 15:59:24 +0000 (17:59 +0200)]
check_dbi: Added threshold ranges for the connection time.

The -W and -C options are used for that. The plugin return value is determined
by the worst check result.

13 years agocheck_dbi: Include extra opts in help output.
Sebastian Harl [Thu, 7 Apr 2011 15:37:10 +0000 (17:37 +0200)]
check_dbi: Include extra opts in help output.

13 years agoInitial version of the 'check_dbi' plugin.
Sebastian Harl [Thu, 7 Apr 2011 15:24:23 +0000 (17:24 +0200)]
Initial version of the 'check_dbi' plugin.

This plugin connects to an SQL database using libdbi, thus supporting all
database backends supported by libdbi. It will then issue the specified SQL
query and check the result (the numeric value of the first column of the first
row to be precise) against the specified warning/critical ranges.

The performance data includes the connection time (µs-resolution as provided
by gettimeofday()) and the query result.

13 years agoAdd perfdata to check_ssh (#3244097 - Marco Beck)
Thomas Guyot-Sionnest [Sat, 26 Mar 2011 19:44:38 +0000 (15:44 -0400)]
Add perfdata to check_ssh (#3244097 - Marco Beck)

13 years agocheck_smtp: Abort on missing/unexpected greeting
Holger Weiss [Tue, 8 Feb 2011 16:07:52 +0000 (17:07 +0100)]
check_smtp: Abort on missing/unexpected greeting

Abort immediately if we don't receive a server greeting or if the
greeting doesn't contain the "--expect"ed string (by default: "220")
instead of blindly sending the EHLO/HELO line.

Spotted by Daniel Piddock, see Debian bug report #611914.

13 years agocheck_http: check for and print the certificate cn
Thomas Guyot-Sionnest [Fri, 4 Feb 2011 05:54:52 +0000 (00:54 -0500)]
check_http: check for and print the certificate cn

This patch adds a check for the certificate cn (hostname) to normal
certificate checks. It returns CRITICAL if th cn is missing, otherwise it
prints it in the normal output.

Patch by Stéphane Urbanovski

13 years agoFix for regex input of '|', being output causing problems with Nagios' parsing of
Ton Voon [Fri, 21 Jan 2011 13:14:33 +0000 (13:14 +0000)]
Fix for regex input of '|', being output causing problems with Nagios' parsing of
performance data. Now replaced with ','

13 years agoTest updates...
Thomas Guyot-Sionnest [Thu, 6 Jan 2011 04:09:54 +0000 (23:09 -0500)]
Test updates...

1. Timetick test could fail with uptime > 115 days. Thresholds are
double type, so it's safe to put a large number even for 32bit systems.
2. Add a test based on an invalid bug report, worthy anyway.

13 years agoUpdate the README text
Thomas Guyot-Sionnest [Sat, 1 Jan 2011 21:21:56 +0000 (16:21 -0500)]
Update the README text

13 years agoMake check_http use standard threshold functions
Thomas Guyot-Sionnest [Sat, 1 Jan 2011 20:29:43 +0000 (15:29 -0500)]
Make check_http use standard threshold functions

This enables floating point and ranges, and make the code more standard.

13 years agoFix check_ldap overriding the port when --ssl was specified after -p
Thomas Guyot-Sionnest [Thu, 23 Dec 2010 16:40:20 +0000 (11:40 -0500)]
Fix check_ldap overriding the port when --ssl was specified after -p

13 years agoFix minor test issues
Thomas Guyot-Sionnest [Wed, 1 Dec 2010 04:57:04 +0000 (23:57 -0500)]
Fix minor test issues

My Test::More wouldn't print the total number of tests anymore, moving
the plan at the top appears to fix it.

At the same time I made check-http.t eval the special modules so it can
skip the tests instead of failing.

13 years agoRevert "check_snmp now considers strings returned by SNMP that contain just"
Thomas Guyot-Sionnest [Wed, 1 Dec 2010 03:48:43 +0000 (22:48 -0500)]
Revert "check_snmp now considers strings returned by SNMP that contain just"

This reverts commit 896962a1ad1b7d7c75d42c565b06cc799feb0a7c.

Conflicts:

NEWS
plugins/tests/check_snmp.t

Notes:
Reverting because I rebased a patch that was doing the same thing, plus
fixing more related regressions, and both didn't work together.
I kept the tests intact except for one that wouldn't pass on 1.4.14
either

13 years agoState-based tests enhancements
Thomas Guyot-Sionnest [Wed, 1 Dec 2010 03:28:19 +0000 (22:28 -0500)]
State-based tests enhancements

- Use /var/tmp for state if no state dir environment variable is set,
  this avoid the need for a writable localstatedir during tests.
- Use "rm -f", mostly to avoid printing out garbage of the directory
  doesn't exists

13 years agocheck_snmp: Remove that is_numeric madness
Thomas Guyot-Sionnest [Wed, 1 Dec 2010 02:02:23 +0000 (21:02 -0500)]
check_snmp: Remove that is_numeric madness

Original patch to make Timeticks works as in check_snmp v1.4.14, it turns
out is_numeric isn't so useful and treating all types as numeric works
best for backwards-compatibility. This is how it used to work in 1.4.14.

As a special case, I also make calculate_rate look up for numeric values
as it would otherwise return the last value instead.

13 years agoadd test cases for check_disk_smb
Matthias Eble [Sun, 28 Nov 2010 21:08:54 +0000 (22:08 +0100)]
add test cases for check_disk_smb

13 years agocheck_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696)
Matthias Eble [Sun, 28 Nov 2010 20:43:48 +0000 (21:43 +0100)]
check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696)

13 years agoMake check_disk_smb accept spaces in share names (#990948, #1370031, Debian #601699)
Matthias Eble [Sun, 28 Nov 2010 20:35:59 +0000 (21:35 +0100)]
Make check_disk_smb accept spaces in share names (#990948, #1370031, Debian #601699)

13 years agoFix check_disk free space calculation if blocksizes differ within a disk group (Bekar...
Matthias Eble [Mon, 15 Nov 2010 22:59:35 +0000 (23:59 +0100)]
Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603)

Various values (dused_pct, dfree_pct, inodes_free, inodes_total, ...) are now carried in
the parameter_list structure. Assignments have been moved to a subroutine preventing
code redundancies.
Group metrics are now calculated based on units rather than blocks. This fixes freespace calculation
when blocksizes differ within a group.

13 years agocheck_snmp now considers strings returned by SNMP that contain just
nagios [Mon, 15 Nov 2010 15:43:41 +0000 (15:43 +0000)]
check_snmp now considers strings returned by SNMP that contain just
numbers (according to strtod) to be a numeric value for threshold and
performance data

13 years agoUpdate NEWS for last commit
Thomas Guyot-Sionnest [Sat, 16 Oct 2010 05:22:32 +0000 (01:22 -0400)]
Update NEWS for last commit

13 years agocheck_nt: make UPTIME accept warning/critical levels
Thomas Guyot-Sionnest [Wed, 13 Oct 2010 04:10:25 +0000 (00:10 -0400)]
check_nt: make UPTIME accept warning/critical levels

Patch originally by Ryan Kelly

13 years agosfsnapshotgit: Better handling of remote refs
Thomas Guyot-Sionnest [Tue, 12 Oct 2010 01:38:42 +0000 (21:38 -0400)]
sfsnapshotgit: Better handling of remote refs

This commit allow to track branches from unusually-named remote refs and
makes possible using external remotes (other than origin) for snapshots.

13 years agoPatch for check_linux_raid with on linear/raid0 arrays
Thomas Guyot-Sionnest [Wed, 6 Oct 2010 03:19:03 +0000 (23:19 -0400)]
Patch for check_linux_raid with on linear/raid0 arrays

Fixes bug #3049988, Debian bug #579049

13 years agoFix typos in -f help text
Ton Voon [Tue, 31 Aug 2010 14:54:19 +0000 (15:54 +0100)]
Fix typos in -f help text

13 years agoUpdate the COPYING file to the GPLv3
Holger Weiss [Tue, 27 Jul 2010 21:06:23 +0000 (23:06 +0200)]
Update the COPYING file to the GPLv3

We switched to the GPLv3 early in 2008, but we forgot to update the
COPYING file accordingly.

13 years ago1.4.15 prep
Ton Voon [Tue, 27 Jul 2010 20:45:20 +0000 (21:45 +0100)]
1.4.15 prep

13 years agoMerge branch 'master' of ssh://tonvoon@nagiosplug.git.sourceforge.net/gitroot/nagiosp...
Ton Voon [Wed, 14 Jul 2010 13:22:51 +0000 (14:22 +0100)]
Merge branch 'master' of ssh://tonvoon@nagiosplug.git.sourceforge.net/gitroot/nagiosplug/nagiosplug

13 years agoAdded text re: MD5SUM updates in nightlies, but tarballs not
Ton Voon [Wed, 14 Jul 2010 13:22:04 +0000 (14:22 +0100)]
Added text re: MD5SUM updates in nightlies, but tarballs not

13 years agoFix --help output when MAX_OIDS is altered.
Thomas Guyot-Sionnest [Fri, 9 Jul 2010 23:28:44 +0000 (19:28 -0400)]
Fix --help output when MAX_OIDS is altered.

13 years agoFix examples in check_disk, where it implied was possible to suffix unit values to...
Ton Voon [Wed, 7 Jul 2010 10:03:24 +0000 (11:03 +0100)]
Fix examples in check_disk, where it implied was possible to suffix unit values to warn/crit parameters

13 years agoAllow check_ifstatus to accept version=2c
Ton Voon [Wed, 7 Jul 2010 08:56:21 +0000 (09:56 +0100)]
Allow check_ifstatus to accept version=2c

13 years agoFix cmd_run overwriting the environment
Thomas Guyot-Sionnest [Fri, 2 Jul 2010 16:55:19 +0000 (12:55 -0400)]
Fix cmd_run overwriting the environment

Some commands need the environment to function properly. One such
example is check_ssh and check_by_ssh when a SOCKS proxy is required.

This patch use setenv and extern char **environ to alter and pass the
new environment to the child process Those modules have been added to
Gnulib for portability.

13 years agoImport the environ module from gnulib (86ba51)
Thomas Guyot-Sionnest [Fri, 2 Jul 2010 16:34:55 +0000 (12:34 -0400)]
Import the environ module from gnulib (86ba51)

13 years agogit-notify: Be careful with "--no-merge"
Holger Weiss [Fri, 2 Jul 2010 13:28:35 +0000 (15:28 +0200)]
git-notify: Be careful with "--no-merge"

The "-X" option (which asks git-notify to not report merge commits) was
implemented by setting the "--no-merge" option on each invocation of
git-rev-list(1).  However, we do not only use git-rev-list(1) to get the
list of new commits, but also to check whether the old branch head (or
tag) is a parent of the new branch head (or tag).  For this latter
check, the "--no-merge" option should not be set; otherwise, git-notify
would be fooled to believe that the branch has been rewritten if the old
head was a merge commit.

13 years agoCorrected rate_multiplier calculation
tonvoon [Wed, 30 Jun 2010 13:16:32 +0000 (13:16 +0000)]
Corrected rate_multiplier calculation

13 years agoRemoved suffix of "-rate" and let user decide label via --label
tonvoon [Wed, 30 Jun 2010 09:37:10 +0000 (09:37 +0000)]
Removed suffix of "-rate" and let user decide label via --label

13 years agoTests for --rate-multiplier option
tonvoon [Wed, 30 Jun 2010 07:56:05 +0000 (07:56 +0000)]
Tests for --rate-multiplier option

13 years agoMerge branch 'master' of ssh://tonvoon@nagiosplug.git.sourceforge.net/gitroot/nagiosp...
Ton Voon [Wed, 30 Jun 2010 08:01:42 +0000 (09:01 +0100)]
Merge branch 'master' of ssh://tonvoon@nagiosplug.git.sourceforge.net/gitroot/nagiosplug/nagiosplug

13 years agoFixed rate-multiplier option
Ton Voon [Wed, 30 Jun 2010 08:01:14 +0000 (09:01 +0100)]
Fixed rate-multiplier option

13 years agoAdd test file directory
tonvoon [Fri, 25 Jun 2010 07:52:59 +0000 (07:52 +0000)]
Add test file directory

13 years agoCleanup some warnings displayed from IRIX tinderbox server
Ton Voon [Thu, 24 Jun 2010 09:08:13 +0000 (10:08 +0100)]
Cleanup some warnings displayed from IRIX tinderbox server

13 years agoAdded unsetenv and setenv from gnulib
Ton Voon [Thu, 24 Jun 2010 09:02:31 +0000 (10:02 +0100)]
Added unsetenv and setenv from gnulib

13 years agoAdded strsep to gnulib, for check_snmp.c
Ton Voon [Thu, 24 Jun 2010 08:57:07 +0000 (09:57 +0100)]
Added strsep to gnulib, for check_snmp.c

13 years agoAdded option to invert search results
tonvoon [Wed, 23 Jun 2010 15:56:29 +0000 (15:56 +0000)]
Added option to invert search results

13 years agoDisplay missing search string and URL when failed (Duncan Ferguson #2999924)
tonvoon [Wed, 23 Jun 2010 14:44:34 +0000 (14:44 +0000)]
Display missing search string and URL when failed (Duncan Ferguson #2999924)

13 years agoAdded state retention APIs. Implemented for check_snmp with --rate option.
Ton Voon [Thu, 17 Jun 2010 09:16:43 +0000 (10:16 +0100)]
Added state retention APIs. Implemented for check_snmp with --rate option.

See http://nagiosplugin.org/c-api-private for more details on the API.

Also updated check_snmp -l option to change the perfdata label.

13 years agoNEWS entry for last commit
Thomas Guyot-Sionnest [Fri, 18 Jun 2010 11:30:07 +0000 (07:30 -0400)]
NEWS entry for last commit

13 years agoAttempt at detecting 64bit compilation flags between gcc, old, and new versions of...
Thomas Guyot-Sionnest [Wed, 5 Aug 2009 05:32:02 +0000 (01:32 -0400)]
Attempt at detecting 64bit compilation flags between gcc, old, and new versions of sun cc

Gcc accepts -m64, just as newer version of Suncc.
Older Suncc required -xarch=v9 (SPARC) or -xarch=amd64 (x86-64) to generate 64bit code.

13 years agoAdd missing --fqdn help (Jan Wagner)
Thomas Guyot-Sionnest [Sat, 8 May 2010 21:41:14 +0000 (17:41 -0400)]
Add missing --fqdn help (Jan Wagner)

13 years agoUpdate extra-opts help text based on ML agreement
Thomas Guyot-Sionnest [Wed, 28 Apr 2010 10:03:57 +0000 (06:03 -0400)]
Update extra-opts help text based on ML agreement

13 years agotools/distclean: use git-clean when possible
Thomas Guyot-Sionnest [Wed, 28 Apr 2010 09:28:22 +0000 (05:28 -0400)]
tools/distclean: use git-clean when possible

git-clean is much faster and more reliable...

Also add confdefs.h in gitignore, although this file is normally removed
at the end of the configure script.

13 years agoUpdate libtool
Thomas Guyot-Sionnest [Wed, 28 Apr 2010 09:01:43 +0000 (05:01 -0400)]
Update libtool

Nagios-plugins wouldn't compile on Ubuntu 10.04 (Lucid) with the old libtool

14 years agoAdd newline after "Usage:" in --help
Thomas Guyot-Sionnest [Thu, 22 Apr 2010 12:57:14 +0000 (08:57 -0400)]
Add newline after "Usage:" in --help

14 years agoSplit long line in check_cluster --help
Thomas Guyot-Sionnest [Thu, 22 Apr 2010 12:50:55 +0000 (08:50 -0400)]
Split long line in check_cluster --help

14 years agoUpdate French translations with extra-opts change
Thomas Guyot-Sionnest [Thu, 22 Apr 2010 03:40:09 +0000 (23:40 -0400)]
Update French translations with extra-opts change

14 years agoStandardize the extra-opts notes
Thomas Guyot-Sionnest [Thu, 22 Apr 2010 03:29:18 +0000 (23:29 -0400)]
Standardize the extra-opts notes

14 years agoFix tests and update NEWS file
Thomas Guyot-Sionnest [Thu, 22 Apr 2010 03:04:06 +0000 (23:04 -0400)]
Fix tests and update NEWS file

14 years agoReplace the lousy multiline parser with a robust one.
Thomas Guyot-Sionnest [Thu, 15 Apr 2010 14:41:21 +0000 (10:41 -0400)]
Replace the lousy multiline parser with a robust one.

This one counts double quotes and backslashes so it should handle any
level of escaping.

14 years agoAttempt at fixing check_snmp multiline output:
Thomas Guyot-Sionnest [Thu, 17 Sep 2009 04:49:56 +0000 (00:49 -0400)]
Attempt at fixing check_snmp multiline output:

This patch tries to detect and output nicely multi-line strings. This
method is broken by design; only a count of double-quotes and escapes
could work in every situation.

14 years agoUpdated Nagios::Plugin library
tonvoon [Thu, 15 Apr 2010 10:44:01 +0000 (10:44 +0000)]
Updated Nagios::Plugin library

14 years agogit-notify: Fix the ordering of commits
Holger Weiss [Wed, 14 Apr 2010 14:22:21 +0000 (16:22 +0200)]
git-notify: Fix the ordering of commits

If notifications for multiple commits are created, sort them
chronologically instead of in reverse chronological order.

14 years agoFix translations when extra-opts aren't enabled
Thomas Guyot-Sionnest [Wed, 14 Apr 2010 10:11:45 +0000 (06:11 -0400)]
Fix translations when extra-opts aren't enabled

Bug #2832884 reported problem with translations outputting pot file
headers. This is caused by "" matching the header of the translation
files.

This patch moves gettext macros inside utils macros and update some
french translations.

14 years agoUpdate french translation (fix all fuzzy's)
Thomas Guyot-Sionnest [Wed, 14 Apr 2010 09:48:41 +0000 (05:48 -0400)]
Update french translation  (fix all fuzzy's)

14 years agoFix check_radius returning OK on unexpected results
Thomas Guyot-Sionnest [Wed, 14 Apr 2010 07:38:52 +0000 (03:38 -0400)]
Fix check_radius returning OK on unexpected results

REJECT_RC is defined on some radiusclient versions and differenciates
between auth errors and bad responses. This patch will affect only the
behaviour of those clients exporting REJECT_RC.

In addition, unexpected return codes are now handled properly and
return UNKNOWN.

14 years agoTypo
Thomas Guyot-Sionnest [Wed, 14 Apr 2010 07:15:19 +0000 (03:15 -0400)]
Typo

14 years agopst3.c must not use nagiosplug/gnulib includes
Thomas Guyot-Sionnest [Thu, 8 Apr 2010 04:30:10 +0000 (00:30 -0400)]
pst3.c must not use nagiosplug/gnulib includes

14 years agoSync with the latest Gnulib code (177f525)
Thomas Guyot-Sionnest [Thu, 8 Apr 2010 01:11:46 +0000 (21:11 -0400)]
Sync with the latest Gnulib code (177f525)

Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>
14 years agoFix typo
Holger Weiss [Mon, 12 Apr 2010 23:02:07 +0000 (01:02 +0200)]
Fix typo

14 years agoFix Debian bug #574612: Return WARNING on rebuild
Holger Weiss [Mon, 12 Apr 2010 13:55:18 +0000 (15:55 +0200)]
Fix Debian bug #574612: Return WARNING on rebuild

Let check_linux_raid return a WARNING instead of an OK state during
volume recovery.

See: http://bugs.debian.org/574612

(Fixed by Christoph Martin, forwarded by Jan Wagner.)

14 years agoFix Debian bug #534604: Checking md10 and above
Holger Weiss [Mon, 12 Apr 2010 13:49:24 +0000 (15:49 +0200)]
Fix Debian bug #534604: Checking md10 and above

| check_linux_raid malfunctions if system has software RAID devices with
| two or more digits.  For example, for system having /dev/md10,
| /dev/md11 etc, the plugin returns 'UNKNOWN' in automatic mode (if RAID
| devices are manually specified it works).  Also, if system has both
| one-digit, and two-digit RAID devices, the two-digit devices are
| silently ignored in checks, which is even more problematic.

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

(Fixed by Matija Nalis, forwarded by Jan Wagner.)

14 years agoFix Debian bug #545940: Failure when run via ePN
Holger Weiss [Mon, 12 Apr 2010 13:36:33 +0000 (15:36 +0200)]
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 de7191e3424e02ba278a39b86e8b1906a25d0362 fixed the same issue for
check_disk_smb.

(Reported by Hendrik Jaeger, forwarded by Jan Wagner.)

14 years agoFix Debian bug #482947: No --nas-ip-address option
Holger Weiss [Sun, 11 Apr 2010 14:33:44 +0000 (16:33 +0200)]
Fix Debian bug #482947: No --nas-ip-address option

| check_radius doesn't seem to provide any way to modify the
| NAS-IP-Address attribute that it uses in the packets it sends, but it
| does so for NAS-Identifier.
|
| Instead, it hardcodes the IP address that it gets from the
| rc_own_ipaddress() library call, and that in turn translates into
| calling gethostbyname() on the result of uname(). This call can easily
| fail, and its result can easily be unsuitable - for example when the
| Nagios instance uses its own virtual host, and you don't want the
| original system hostname leaked to the RADIUS servers you monitor with
| this.
|
| Furthermore, this behaviour is inconsistent with RFC 2865, which
| defines the two attributes as analogous and never suggests hardcoding
| the value of either of them in client software.

Therefore, this commit adds the "-N, --nas-ip-address" option which
allows for specifying the value of the NAS-IP-Address attribute.

| I've also noticed that the original code for NAS-IP-Address hardcoding
| is broken in its error handling - it does "return (ERROR_PC)", which
| is meaningless in the context of check_radius.c. That actually seems
| to be copy&waste from radiusclient-0.3.2/src/radexample.c. :) I fixed
| that.
|
| While debugging, I also took the opportunity to decouple the
| nas-identifier rc_avpair_add() instance from the initial three,
| because this is just bad practice to lump a fourth optional attribute
| into the same block with the required attributes, the error handling
| for which is throwing the same daft message "Out of Memory?"...

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

(Contributed by Josip Rodin, forwarded by Jan Wagner.)

14 years agoFix Debian bug #479984: Allow empty LDAP base
Holger Weiss [Sun, 11 Apr 2010 09:28:02 +0000 (11:28 +0200)]
Fix Debian bug #479984: Allow empty LDAP base

The check_ldap plugin did not allow for specifying an empty LDAP base.

See: http://bugs.debian.org/479984

(Fixed by Stephane Chazelas, forwarded by Jan Wagner.)

14 years agoFix Debian bug #460097: check_http -M broken
Holger Weiss [Sun, 11 Apr 2010 09:05:49 +0000 (11:05 +0200)]
Fix Debian bug #460097: check_http -M broken

See: http://bugs.debian.org/460097

One instance of this bug has already been fixed in commit
888358122004b9571c8fbdfa52ceee1ba5e5f4f2.

(Fixed by Hilko Bengen, forwarded by Jan Wagner.)

14 years agoFix Debian bug #478942: Fragile argument passing
Holger Weiss [Sun, 11 Apr 2010 08:54:44 +0000 (10:54 +0200)]
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.)

14 years agoFix Debian bug #478906: Failure when run via ePN
Holger Weiss [Sun, 11 Apr 2010 07:54:10 +0000 (09:54 +0200)]
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.)

14 years agoFix Debian bug #463322: Use deprecated libldap API
Holger Weiss [Sun, 11 Apr 2010 07:51:21 +0000 (09:51 +0200)]
Fix Debian bug #463322: Use deprecated libldap API

| Our automated build log filter[1] detected a problem that is likely to
| cause your package to segfault on architectures where the size of a
| pointer is greater than the size of an integer, such as ia64 and
| amd64.
|
| This is often due to a missing function prototype definition.  For
| more information, see [2].
|
|  Function `ldap_init' implicitly converted to pointer at
|  check_ldap.c:124
|
| [1] http://people.debian.org/~dannf/check-implicit-pointer-functions
| [2] http://wiki.debian.org/ImplicitPointerConversions
|
| The libldap API has been updated and many functions used by the ldap
| plugin are now deprecated.  This package should either update to the
| new API or define LDAP_DEPRECATED to continue using the deprecated
| interfaces.
|
| This patch implements the lazy solution.

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

(Contributed by Dann Frazier, forwarded by Jan Wagner.)

14 years agoFix Debian bug #425129: SMB guest mode won't work
Holger Weiss [Sun, 11 Apr 2010 07:39:24 +0000 (09:39 +0200)]
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.)

14 years agoFix Debian bug #307905: Incorrect usage output
Holger Weiss [Sun, 11 Apr 2010 06:45:16 +0000 (08:45 +0200)]
Fix Debian bug #307905: Incorrect usage output

The usage output of check_game was wrong, see:

http://bugs.debian.org/307905

(Fixed by Sean Finney, forwarded by Jan Wagner.)

14 years agocheck_disk_smb: Allow for specifying an IP address
Holger Weiss [Sat, 10 Apr 2010 23:57:11 +0000 (01:57 +0200)]
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.)

14 years agocheck_http: Add warning about SNI not enabled by default anymore
Thomas Guyot-Sionnest [Tue, 6 Apr 2010 14:17:45 +0000 (10:17 -0400)]
check_http: Add warning about SNI not enabled by default anymore

14 years agoFix regression in check_http ssl checks on some servers
Thomas Guyot-Sionnest [Tue, 6 Apr 2010 01:06:22 +0000 (21:06 -0400)]
Fix regression in check_http ssl checks on some servers

The fix is making SNI an option.

14 years agocheck_snmp: Update last patch to copy value verbatim
Thomas Guyot-Sionnest [Wed, 31 Mar 2010 06:45:45 +0000 (02:45 -0400)]
check_snmp: Update last patch to copy value verbatim

Rework last patch, copying the converted portion of the string rather
than re-converting it. This is safer for backwards-compatibility as the
value is never modified.

14 years agocheck_snmp: Fix regression introduced in #1867716
Thomas Guyot-Sionnest [Wed, 31 Mar 2010 02:31:20 +0000 (22:31 -0400)]
check_snmp: Fix regression introduced in #1867716

Bug #1867716 fixed what it meant to fix: broken perfdata strings.
Unfortunately some users relied on half-broken perfdata string where at
least the first token was OK. This patch do a two-way conversion
(string to double then back to string) instead and use the conversion
result for the performance data.

A possible caveat is that the string may change where it normally
shouldn't but the result should be somewhat similar.

14 years agoFix compilation with GCC 2.96 (Konstantin Khomoutov - #2977105)
Thomas Guyot-Sionnest [Sat, 27 Mar 2010 04:13:38 +0000 (00:13 -0400)]
Fix compilation with GCC 2.96 (Konstantin Khomoutov - #2977105)

14 years agoLet check_ntp_peer check the number of truechimers
Holger Weiss [Wed, 17 Mar 2010 23:34:14 +0000 (00:34 +0100)]
Let check_ntp_peer check the number of truechimers

Add support for checking the number of usable time sources (i.e., the
number of peers which are classified as so-called "truechimers" by NTP's
intersection algorithm).  The new "-m" and "-n" options allow for
specifying the according WARNING and CRITICAL thresholds (and thereby
activating the truechimers check), respectively.

14 years agoTypo in NEWS
Thomas Guyot-Sionnest [Tue, 16 Mar 2010 07:41:05 +0000 (03:41 -0400)]
Typo in NEWS

14 years agoCorrected example
Ton Voon [Mon, 15 Mar 2010 19:44:25 +0000 (19:44 +0000)]
Corrected example

14 years agoFix memory leak in check_http for large pages (Jimmy Bergman - #2957455)
Ton Voon [Fri, 26 Feb 2010 12:47:38 +0000 (12:47 +0000)]
Fix memory leak in check_http for large pages (Jimmy Bergman - #2957455)

14 years agogit-notify: Pipe e-mails directly to sendmail(8)
Holger Weiss [Mon, 7 Dec 2009 00:58:21 +0000 (01:58 +0100)]
git-notify: Pipe e-mails directly to sendmail(8)

Use sendmail(8) instead of mail(1) in order to be able to set the
"Content-Type" header field on systems where the available mail(1)
command doesn't allow for setting it.  This makes the "-H" flag (cf.
commit 71350c5a) unnecessary.