Commit graph

1179 commits

Author SHA1 Message Date
Sebastian Harl
aebde433fb 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.
2012-06-06 14:10:55 +02:00
Sebastian Harl
eda2fe7f40 check_dbi: Added some examples to the help output. 2012-06-06 14:10:55 +02:00
Sebastian Harl
4ad6e441b6 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.
2012-06-06 14:10:55 +02:00
Sebastian Harl
d7a1f2a7a0 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.
2012-06-06 14:10:55 +02:00
Sebastian Harl
61506bd8d7 check_dbi: Fixed/improved perfdata output.
- do not use zero as 'min' value for the query result perfdata

 - added all semicolons
2012-06-06 14:10:55 +02:00
Sebastian Harl
0e02edec19 check_dbi: Check and report the time used by the query. 2012-06-06 14:10:55 +02:00
Sebastian Harl
e7dfcd4429 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.
2012-06-06 14:10:55 +02:00
Sebastian Harl
07768fa895 check_dbi: Include extra opts in help output. 2012-06-06 14:10:55 +02:00
Sebastian Harl
f9a942d2a1 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.
2012-06-06 14:10:55 +02:00
Holger Weiss
252ae618fc check_http: Fix -C/--certificate option handling
The support for specifying the desired SSL protocol version via an
optional -S/--ssl argument broke the -C/--certificate option.  This is
fixed now.
2012-05-29 12:59:16 +02:00
Holger Weiss
ec2596b92d check_http: Don't ignore SSL initialization errors
SSL initialization errors are now handled properly by check_http
(#3095106 - Eric Schoeller).
2012-05-28 21:42:48 +02:00
Holger Weiss
bc3307ed6e Add support for specifying SSL protocol version
The check_http -S/--ssl option now takes an optional argument which
specifies the desired SSL/TLS protocol version (#3285367 - Jason Lunn).
2012-05-28 17:16:04 +02:00
Holger Weiss
5a5d3d7013 Disable stateless SSL session resumption
Some versions of OpenSSL fail to negotiate the SSL connection with at
least some versions of Tomcat if stateless SSL session resumption
support (see RFC4507) is enabled:

| CRITICAL - Cannot make SSL connection
| 140099330348712:error:140943F2:SSL routines:SSL3_READ_BYTES:sslv3 alert unexpected message:s3_pkt.c:1195:SSL alert number 10

The problem is reproducible with OpenSSL 1.0.0h, but not with OpenSSL
0.9.8o-4squeeze12 (as shipped with Debian 6.0.4).  We work around it by
disabling the RFC4507 functionality when using OpenSSL versions which
support it.

Thanks to Dag Bakke for reporting the issue and for giving me access to
a server I could use to reproduce the problem.
2012-05-07 12:11:48 +02:00
Matthias Eble
4c30935850 Merge branch 'master' of ssh://nagiosplug.git.sourceforge.net/gitroot/nagiosplug/nagiosplug 2012-04-10 22:49:24 +02:00
Sven Nierlein
83655083af check_by_ssh: added -F config file to specify alternative ssh config 2012-04-09 22:16:39 +02:00
Holger Weiss
d796c16327 Clarify that check_http won't verify certificates
Add a note to the --help output which clarifies that check_http doesn't
perform certificate verification (beyond what the "-C" option does).

(Suggested by Michael Renner in Debian bug report #644627, forwarded by
Jan Wagner.)
2012-02-24 13:24:56 +01:00
Holger Weiss
b93c8eebc7 Cosmetic change
Replace all occurrences of "strstr(s, "c") == s" with "s[0] == 'c'".
2012-02-24 12:31:20 +01:00
Holger Weiss
0e3fa54782 Accept multiple labels specified with "-l"
Fix the code which accepts a comma-separated list of labels specified
via the "-l" option.

(Spotted by Oskar Liljeblad in Debian bug report #647020, forwarded by
Jan Wagner.)
2012-02-24 12:29:00 +01:00
Eric Stanley
4011599466 Enable compiling on AIX 6.1 2012-02-10 10:27:24 -06:00
Thomas Guyot-Sionnest
f917244ab5 Make GCC happy
It won't trust us about msg containing no format string, and fail miserably
when compiled with -Werror=format-security. Reported by spy6 on IRC.
2011-09-06 23:20:21 -04:00
Matthias Eble
9978b3ca74 Fix: check_ldap now correctly handles the long option --hostname for -H
The undocumented --host has been changed to --hostname which is actually
mentioned in --help. Thanks to lgarrett (#3191388)
2011-08-13 03:44:27 +02:00
Ton Voon
4d06603060 Fix check_smtp and check_tcp where duplicate messages were displayed for certificate errors (Opsview team) 2011-07-15 21:19:15 +01:00
Ton Voon
e7f6da0211 New option to check_smtp to ignore failures when sending QUIT (#3358348 - Duncan Ferguson) 2011-07-15 16:48:45 +01:00
Thomas Guyot-Sionnest
1bc7a4a198 Add perfdata to check_ssh (#3244097 - Marco Beck) 2011-03-26 15:44:38 -04:00
Holger Weiss
d16f3fb0a9 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.
2011-02-08 17:07:52 +01:00
Thomas Guyot-Sionnest
4611e41bc5 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
2011-02-04 00:54:52 -05:00
Ton Voon
1a5a83bb82 Fix for regex input of '|', being output causing problems with Nagios' parsing of
performance data. Now replaced with ','
2011-01-21 13:14:33 +00:00
Thomas Guyot-Sionnest
ae2a669137 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.
2011-01-05 23:09:54 -05:00
Thomas Guyot-Sionnest
890e0ae000 Make check_http use standard threshold functions
This enables floating point and ranges, and make the code more standard.
2011-01-01 15:29:43 -05:00
Thomas Guyot-Sionnest
a2a279e262 Fix check_ldap overriding the port when --ssl was specified after -p 2010-12-23 11:40:20 -05:00
Thomas Guyot-Sionnest
c49fed07c3 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.
2010-11-30 23:57:04 -05:00
Thomas Guyot-Sionnest
5a2814a21b Revert "check_snmp now considers strings returned by SNMP that contain just"
This reverts commit 896962a1ad.

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
2010-11-30 22:48:43 -05:00
Thomas Guyot-Sionnest
811684ffe3 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
2010-11-30 22:33:34 -05:00
Thomas Guyot-Sionnest
df88f95fca 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.
2010-11-30 22:32:33 -05:00
Matthias Eble
77f2c84d2f 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.
2010-11-15 23:59:35 +01:00
nagios
896962a1ad 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
2010-11-15 15:43:41 +00:00
Thomas Guyot-Sionnest
6989366b8d check_nt: make UPTIME accept warning/critical levels
Patch originally by Ryan Kelly
2010-10-15 01:52:29 -04:00
Ton Voon
bfe20df4a5 Fix typos in -f help text 2010-08-31 15:54:19 +01:00
Thomas Guyot-Sionnest
2527bdd4b6 Fix --help output when MAX_OIDS is altered. 2010-07-09 19:39:09 -04:00
Ton Voon
02f9207ebe Fix examples in check_disk, where it implied was possible to suffix unit values to warn/crit parameters 2010-07-07 11:03:24 +01:00
tonvoon
5c72d075de Corrected rate_multiplier calculation 2010-06-30 13:16:32 +00:00
tonvoon
3444519014 Removed suffix of "-rate" and let user decide label via --label 2010-06-30 09:37:10 +00:00
tonvoon
752dbc20b2 Tests for --rate-multiplier option 2010-06-30 07:56:05 +00:00
Ton Voon
6805fecd62 Fixed rate-multiplier option 2010-06-30 09:01:14 +01:00
tonvoon
b8e2850c1a Added option to invert search results 2010-06-23 15:56:29 +00:00
tonvoon
1252195ed5 Display missing search string and URL when failed (Duncan Ferguson #2999924) 2010-06-23 14:44:34 +00:00
Ton Voon
18f6835eda 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.
2010-06-23 13:30:34 +00:00
Thomas Guyot-Sionnest
4b42d5aff4 Add missing --fqdn help (Jan Wagner) 2010-05-08 17:41:14 -04:00
Thomas Guyot-Sionnest
a4bab0bb46 Update extra-opts help text based on ML agreement 2010-04-28 06:03:57 -04:00
Thomas Guyot-Sionnest
eaf3cb27f4 Add newline after "Usage:" in --help 2010-04-22 08:57:14 -04:00