summaryrefslogtreecommitdiffstats
path: root/plugins
AgeCommit message (Collapse)AuthorFilesLines
2013-01-23check_dig: query transport selection supportVille Mattila1-3/+16
Add command line options -4 and -6 (--use-ipv4 and --use-ipv6) to check_dig. Effectively this adds no new functionality, just a shortcut for: check_dig -A "-4" check_dig -A "-6" Needed for using check_dig with the check_v46 wrapper (see e.g. https://gitorious.org/nagios-monitoring-tools/nagios-monitoring-tools/blobs/master/check_v46) which requires -4/-6 command line option support.
2013-01-23check_snmp: Don't thrash memory when using multiple label/unit argumentRobin Sonefors1-11/+11
The memory allocation mixed up number of bytes with number of pointers, meaning as soon as we'd reach (on 64 bit systems) the second argument, we'd start writing it outside of our allocated memory. Normally, this isn't too visible, but as soon as you (again, on my 64 bit system) reach argument number 8, you get a segfault. It is easily reproducible with: check_snmp -o '' -l '' -o '' -l '' -o '' -l '' -o '' -l '' \ -o '' -l '' -o '' -l '' -o '' -l '' -o '' -l '' This patch allocates the proper amount of memory, to fix the issue. Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
2012-12-28Updated check_mysql.c to take client options file and group parametersrefs/pull/32/headJonathan Milby1-4/+35
2012-12-28check_fping: IPv6 supportrefs/pull/30/headVille Mattila1-2/+29
Add command line options -4 and -6 (--use-ipv4 and --use-ipv6) to check_fping. IPv4 is used by default, maintaining backwards compatibility with older check_fping versions. IPv6 support requires the fping6 program. The implementation is really just an imitation of check_ping IPv6 support: Plugin command line option -4/-6 designates whether to run fping/fping6. Please note that especially the changes to configure.in might be all wrong - I don't know what's the proper autoconf way, patching configure.in just seemed to work for me.
2012-11-28check_ntp(_time): don't die on connect errorsSven Nierlein2-2/+10
connect errors may happen if clients check agains dual stacked ipv4/6 ntp servers.
2012-11-28unified ipv4/6 usage and help textSven Nierlein6-10/+8
2012-11-14check_procs: Remove superfluous newline characterHolger Weiss1-1/+1
2012-11-14check_procs: Added performance data to plugin output.Sebastian Harl1-0/+7
2012-11-14check_procs: Use the range/threshold support functions from libnagiosplug.Sebastian Harl1-89/+17
This adds support for @<range> and makes stuff a bit simpler by removing code duplications. Note: Previously, the compatibility code for 'check_procs <warn> <max>' accepted something like 'check_procs -w 10:-1 -c 10:-1 20 50' as well (treating it as if '-w 10:20 -c 10:50' was specified). This is no longer the case ... additional arguments are only used as warn/crit thresholds in case -w/-c is not specified at all.
2012-11-03plugins/check_snmp: Show snmp error when we fail to parse its outputAndreas Ericsson1-2/+2
Dying without a hint of what went wrong is just plain annoying. With this patch we at least get a hint. While at it, we fix the string offset so the output we're interested in doesn't keep the equal sign that snmpget prints. Signed-off-by: Andreas Ericsson <ae@op5.se>
2012-11-03Make check_snmp backwards compatible in how it parses thresholdsAndreas Ericsson1-0/+23
Once upon a time, check_snmp used to accept inverse ranges in the format of '2:1' to mean "alert if value is inside this range". Since commit 7cb3ae09334796f3b54e4e6438e38c2cc679b360, ranges such as those have instead triggered the error "Range format incorrect" and resulted in an UNKNOWN warning state. This patch attempts to fix the situation so that the old-style ranges continues to mean exactly what the once did and people with lots of snmp checks can avoid a bazillion false positives from their environments. Signed-off-by: Andreas Ericsson <ae@op5.se>
2012-10-12check_disk: option to ignore reserved spacerefs/pull/22/headchl1-4/+17
This commit add a runtime option to ignore the root-reserved space when calculating perfdata. Before / after: ./check_disk -w 2% -c 1% /home ./check_disk -w 2% -c 1% -f /home DISK CRITICAL - free space: /home 272 MB (1% inode=83%);| /home=17551MB;18401;18589;0;18777 DISK CRITICAL - free space: /home 272 MB (1% inode=83%);| /home=17551MB;17466;17644;0;17823 Well, it doesn't really give me more space :) but the perfdata are a little bit more coherent. Note that there are still a rounding issue on the percent calculation (cf calculate_percent() comments, taken from coreutils 'df' command). 272/17823 -> 1.526% Since the warning/critical/min/max data are usually not saved in RRD DB, you can activate the option without seeing landslides in the graphs.
2012-10-09Allow for configuring OpenSSLHolger Weiss1-0/+1
Let OpenSSL load its configuration file. See the OPENSSL_config(3) man page for details. (Suggested by Max Kosmach in Debian bug report #689960, forwarded by Jan Wagner.)
2012-10-03Tests for check_aptrefs/pull/20/headAlex Bradley7-3/+257
Add a hidden "--input-file" option to check_apt (modelled on check_procs) so that it can take files with sample apt output as input. Add tests for my SECURITY_RE fix (debian3) and for the include, exclude and critical options.
2012-10-03Fix SourceForge bug 1904965 - check_apt: SECURITY_RE is not correctAlex Bradley1-1/+1
For the default security upgrade detection regular expression, match "Debian-Security" in package description when it's anywhere after the first parenthesis (not just the second space-delimited word). For example: ... (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable ...
2012-10-03Don't prepend "^Inst" or append a space to the "include", "exclude", orAlex Bradley1-17/+18
"critical" regular expressions. Instead, check for lines beginning with "Inst" using strncmp and apply the regular expressions only when such lines are found. Fixes Debian bug #522812, along the lines suggested by the bug submitter, Justin T Pryzby.
2012-09-25Update plugins/check_disk.crefs/pull/19/headGianluca Varisco1-1/+1
CRITCAL -> CRITICAL typo
2012-08-10check_http: Update description of -C optionHolger Weiss1-1/+1
Mention that the -C option now accepts two comma-separated values.
2012-08-10check_http: Add missing newline to --help outputHolger Weiss1-3/+3
2012-08-10fixing bug in certificate experiation patch checking for bad warning ↵William Leibzon3-3/+3
threshold data
2012-08-10tests/check_http.t: Fix whitespace issuesHolger Weiss1-10/+8
In tests/check_http.t, tabs are used for indentation. While at it, apply another few cosmetic changes.
2012-08-10tests/check_http.t: Update the number of SSL testsHolger Weiss1-1/+1
2012-08-10tests/check_http.t: Fix test caseHolger Weiss1-1/+1
Fix the test case which is meant to make sure that check_http -C <n>,<m> [...] returns a CRITICAL state if <m> is large enough.
2012-08-06check_ntp_peer: Fix --help output for -m and -nHolger Weiss1-1/+1
Fix the threshold specifications in the example for checking the number of truechimers. Reported by Marc Haber on the "nagios-users" mailing list (Message-ID: <20120722142840.GA6931@torres.zugschlus.de>).
2012-08-06check_ntp_peer: Fix --help output for -W and -CHolger Weiss1-2/+2
Mention that the check_ntp_peer plugin checks the stratum of the synchronization peer, not the stratum of the monitored server itself. Thanks to Marc Haber for bringing this up on the "nagios-users" mailing list (Message-ID: <20120722142840.GA6931@torres.zugschlus.de>).
2012-07-18check_http: Fix whitespace issuesHolger Weiss1-10/+10
In check_http.c, tabs aren't used for indentation.
2012-07-18check_http: Fix compilation without SSL supportHolger Weiss1-3/+4
The "ssl_version" variable was undeclared when the plugins were compiled --without-openssl and --without-gnutls. Bug reported by Michael LaCorte on the "nagiosplug-help" mailing list (Message-ID: <CCD30C91-A2A8-463A-82A9-F99B54F741D3@gmail.com>).
2012-07-05check_pgsql: Determine connection time in µs-resolution.refs/pull/16/headSebastian Harl1-7/+15
… thus, treat "elapsed time" and the thresholds as floating point values.
2012-07-05check_pgsql: Leave 'min' value in query perfdata empty.Sebastian Harl1-1/+1
There is no reasonable default value for that.
2012-07-05check_pgsql: Updated copyright.Sebastian Harl1-2/+2
2012-07-05check_pgsql: Added support for the -o command line option.Sebastian Harl1-5/+22
This option may be used to specify further connection parameters to be passed to PQconnectdb(). For example, this may be used to specify a service name in pg_service.conf to be used for additional connection parameters: -o 'service=<name>' or to specify the SSL mode: -o 'sslmode=require'. See the chapter "libpq - C Library" in the PostgreSQL manual for details.
2012-07-05check_pgsql: Removed -4/-6 flags from help output.Sebastian Harl1-2/+0
These options are not currently supported.
2012-07-05check_pgsql: Allow UNIX socket directories as hostname as well.Sebastian Harl1-1/+1
PostgreSQL accepts the directory name of its UNIX socket as hostname as well, e.g. /var/run/postgresql/.
2012-07-05check_pgsql: Use PQconnectdb() rather than PQsetdbLogin().Sebastian Harl1-7/+48
This is more flexible and the recommended way to connect to a PostgreSQL database. Also, the verbose output now includes detailed information about the connection.
2012-07-05check_pgsql: Fixed query perfdata output for empty warn/crit ranges.Sebastian Harl1-1/+3
Previously, "(null)" was printed (when using GNU's libc). This has been changed to print the empty string instead.
2012-07-05check_pgsql: Added support for executing queries.Sebastian Harl1-11/+115
The query result (the double value of the first column in the first row, to be precise) will be checked against threshold ranges specified using the -C and -W options. Note that this also allows to query PostgreSQL internal values using the information available from the database daemon's "statistics collector" -- see the chapter "Monitoring Database Activity" in the PostgreSQL manual for details.
2012-07-04Merge remote-tracking branch 'github/tokkee/sh/check_dbi'Holger Weiss3-1/+923
2012-07-04Re-added missing variable declarations to check_smtp.cEric Stanley1-0/+2
A recent update removed the declarations for a couple variables in check_smtp.c that are still being used, which caused a failure in the compilation of check_smtp.c. This commit restores those variable declarations so the check_smtp.c will again compile.
2012-06-29check_smtp: Remove a comment regarding MAIL FROMHolger Weiss1-15/+4
Earlier versions of check_smtp generated an (invalid) "MAIL FROM" command without arguments by default. These days, a "MAIL FROM" command is only sent if the --from option is specified. This commit removes a comment which explains the old behaviour, and it updates a variable name accordingly.
2012-06-29check_smtp: Fix help and usage output regarding -RHolger Weiss1-2/+2
2012-06-29check_smtp: Fix strcat overflowsAnders Kaseorg1-4/+2
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29Die when asprintf failsAnders Kaseorg37-366/+395
Fixes many instances of warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29check_smtp: Strip angle brackets from -f argument, if providedAnders Kaseorg1-1/+2
Apparently some people used -f '<nagios@example.com>' to work around the bug I just fixed in the MAIL FROM: command generation. Although the resulting command wasn't RFC-compliant, it was working with some MTAs, so let's continue to support this syntax now that we generate RFC-compliant commands. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29check_smtp: Change MAIL FROM: command to comply with the SMTP standardAnders Kaseorg1-1/+1
Every version of the SMTP standard (from RFC 821 to the current RFC 5321) requires the address following MAIL FROM: to follow the colon immediately (with no space) and to be surrounded by angle brackets. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-27check_tcp: Print performance data even with -DHolger Weiss1-1/+1
When using the 1.4.15 release of the Nagios Plugins, a command such as check_tcp -H pop.example.com -p 995 -D 14 usually produced two lines of output, e.g.: OK - Certificate will expire on 12/13/2014 23:59. TCP OK - 0.009 second response time on port 995|time=0.008849s;;;0.000000;10.000000 The second line was removed by 4d06603060fc1233861b164870f0d3a2e0d8d2eb. However, as the old two-line output is a valid (though in this case unintended) way to spit out performance data, removing the second line might break current setups. Therefore, we revert to the old behaviour, at least for the moment. The issue was reported by Jochen Bern on the "nagiosplug-devel" mailing list (Message-ID: <4FEAE812.8030309@LINworks.de>).
2012-06-26check_snmp: use single quotes for perf data labelsSven Nierlein2-4/+8
2012-06-26Fix performance data label containing spaces in check_snmp (Jochen Bern)Sven Nierlein2-4/+45
Add --perf-oids option for check_snmp to retain optional 1.4.14 compatibility
2012-06-25added test case for certificate checs with both warning and critical valuesWilliam Leibzon1-0/+4
2012-06-25check_http: added test for warning thresholdsSven Nierlein3-3/+11
fixed typo in sslutils
2012-06-25applied patch that adds both critical and warning thresholds to certificate ↵William Leibzon5-33/+89
expiration checks of check_tcp, check_http, check_smtp