Commit graph

2287 commits

Author SHA1 Message Date
Sebastian Harl
f3e2ebd974 check_pgsql: Use PQconnectdb() rather than PQsetdbLogin().
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-05 11:36:57 +02:00
Sebastian Harl
58ef38e2bb check_pgsql: Fixed query perfdata output for empty warn/crit ranges.
Previously, "(null)" was printed (when using GNU's libc). This has been
changed to print the empty string instead.
2012-07-05 11:36:57 +02:00
Sebastian Harl
912df3ef9b check_pgsql: Added support for executing queries.
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-05 11:36:57 +02:00
Holger Weiss
c98223f441 NEWS: Mention the new check_dbi plugin 2012-07-04 23:58:51 +02:00
Holger Weiss
800a868713 Merge remote-tracking branch 'github/tokkee/sh/check_dbi' 2012-07-04 23:50:48 +02:00
Eric Stanley
49df5964eb Re-added missing variable declarations to check_smtp.c
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-07-04 12:48:07 -05:00
Holger Weiss
b57aeb1e5f check_smtp: Remove a comment regarding MAIL FROM
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-29 15:09:34 +02:00
Holger Weiss
973d147cef check_smtp: Fix help and usage output regarding -R 2012-06-29 14:25:40 +02:00
Holger Weiss
86b72def6b NEWS, THANKS: Mention Anders Kaseorg's changes 2012-06-29 13:46:28 +02:00
Anders Kaseorg
638b596992 check_smtp: Fix strcat overflows
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
Anders Kaseorg
028d50d6f9 Die when asprintf fails
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-29 13:39:11 +02:00
Anders Kaseorg
9976876584 check_smtp: Strip angle brackets from -f argument, if provided
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-29 13:39:11 +02:00
Anders Kaseorg
dd1e9eb5ea check_smtp: Change MAIL FROM: command to comply with the SMTP standard
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-29 13:39:11 +02:00
Holger Weiss
786196d4bb Remove the package.def file
The package.def file is not included in release tarballs, and I'm not
aware of anyone (still) using it.
2012-06-28 18:46:24 +02:00
Holger Weiss
0fffa12818 Remove #990948 from the BUGS file
Issue #990948 has been fixed by commit
0892c4ac28.
2012-06-27 22:43:36 +02:00
Holger Weiss
20e0cd61c0 Prepare for the 1.4.16 release 2012-06-27 18:30:02 +02:00
Holger Weiss
cbc8a7f313 check_tcp: Print performance data even with -D
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 4d06603060.
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-27 17:29:11 +02:00
Holger Weiss
10cf77ca5c Update the BUGS file
Remove the bug reports that were closed, and add two new items.
2012-06-27 10:26:34 +02:00
Sven Nierlein
843f954056 check_snmp: use single quotes for perf data labels 2012-06-27 00:02:09 +02:00
Sven Nierlein
9c886d049d Fix performance data label containing spaces in check_snmp (Jochen Bern)
Add --perf-oids option for check_snmp to retain optional 1.4.14 compatibility
2012-06-26 20:53:13 +02:00
Holger Weiss
cf07b50a82 Remove team members from the THANKS file
The (current and past) team members are listed in the AUTHORS file.
2012-06-26 15:24:54 +02:00
Holger Weiss
a5d8d0ce37 Add Sven Nierlein to the list of AUTHORS 2012-06-26 15:11:42 +02:00
William Leibzon
181260d636 added test case for certificate checs with both warning and critical values 2012-06-25 12:54:15 +02:00
Sven Nierlein
24242f6ab7 check_http: added test for warning thresholds
fixed typo in sslutils
2012-06-25 12:53:47 +02:00
Sven Nierlein
eb2615a0ba updated changelog 2012-06-25 12:07:50 +02:00
William Leibzon
fa3d2a4074 applied patch that adds both critical and warning thresholds to certificate expiration checks of check_tcp, check_http, check_smtp 2012-06-25 12:05:16 +02:00
Holger Weiss
88fdf3a8a8 check_ping: Add missing newline to die() calls
Our die() function expects the caller to append the trailing newline
character.
2012-06-25 01:58:17 +02:00
Holger Weiss
94f4aca977 NEWS: Improve the wording a bit 2012-06-25 01:33:03 +02:00
Holger Weiss
bf7c4f95ae Merge remote-tracking branch 'github/waja/master'
Conflicts:
	NEWS
2012-06-25 01:14:12 +02:00
Holger Weiss
991054fa6e check_ping: Ignore ping(1)'s exit status
Don't return a WARNING state if the number of lost packets is greater
than zero but below the specified warning threshold.  This happened
because the check_ping plugin used the exit status of the ping(1)
utility.  (#3535140 - Tobias Brox)
2012-06-24 15:51:56 +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
e6df238350 Fix check_by_ssh test for non-Bash login shells
In the C shell and in the Z shell, the "?" character must be quoted or
backslash-escaped in order to use it verbatim.  Therefore, a command
such as

	check_by_ssh -H test.example.com -l joe echo huh?

might fail, depending on joe's login shell on test.example.com.

Just to make sure, this commit removes most punctuation characters from
our test strings.
2012-06-22 17:11:18 +02:00
Holger Weiss
4d52762732 check_dhcp: Don't misinterpret the "siaddr" field
RFC 2131 (2.) says: "DHCP clarifies the interpretation of the 'siaddr'
field as the address of the server to use in the next step of the
client's bootstrap process."  So, we shouldn't interpret this field as
the DHCP server's own address.  (#3503921 - Jason Ellison)
2012-06-14 00:39:55 +02:00
Holger Weiss
f091d59e0f check_dhcp: Fix handling of "pad" options
Don't let "pad" options[*] terminate the parsing of DHCP options.  This
bug was triggered by using check_dhcp against Windows 2003 DHCP servers
(see #3503921).

[*] Cf. RFC 2132, 3.1.
2012-06-13 12:36:42 +02:00
Holger Weiss
a80eafbf9c Improve parsing of ping6(1) output
The ping6(1) implementation provided by Debian's iputils-ping package
may produce output such as the following:

| 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms

There's a corresponding pattern in check_ping.c:458:

| "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss"

Without this fix, the pattern in check_ping.c:456 matched first (as
sscanf(3) interprets "+3" as a match for "%d"):

| "%*d packets transmitted, %*d received, %d%% loss, time"

(#1894850 - Debian bug report #514588 - Matej Vela)
2012-06-11 23:40:04 +02:00
Holger Weiss
4e9eedc8de Fix whitespace and capitalization issues
Fix indentation and whitespace issues, and correct some capitalization
errors in error messages.  The behaviour is unchanged.
2012-06-11 23:34:15 +02:00
Holger Weiss
3fd1bd97ca Don't use SSLv2 when compiling against GnuTLS
GnuTLS doesn't support SSL version 2.
2012-06-11 23:23:40 +02:00
Sebastian Harl
e056cc9d82 t/check_dbi.t: Don't use 'INSERT … VALUES (a,b), (c,d)' with SQLite3.
Older versions of SQLite3 don't seem to support that.
2012-06-08 13:18:07 +02:00
Sebastian Harl
8455419650 Added a few test cases for the check_dbi plugin.
All tests use sqlite3. A temporary database is created for the purpose of the
tests.
2012-06-08 11:14:21 +02:00
Holger Weiss
094a6fa2f3 check_users: Whitespace fixes, etc. 2012-06-07 10:43:15 +02:00
Holger Weiss
e4d9abc4e2 Update NEWS and THANKS w.r.t. check_users change 2012-06-07 10:33:57 +02:00
M. Remy
3e622f3a47 check_users: improve performance
This patch use the utxent function family to collect the user data. It improve the check speed.
Need a system conforming to POSIX.1-2001.
2012-06-07 10:14:16 +02:00
Sebastian Harl
ce75adf287 check_dbi: Hint the user about cause when dbi init fails. 2012-06-06 15:06:44 +02:00
Sebastian Harl
022ba7ea3a check_dbi: Added simple regex example to help output. 2012-06-06 14:10:55 +02:00
Sebastian Harl
14fc0f741d 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).
2012-06-06 14:10:55 +02:00
Sebastian Harl
b7e661c4ae 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.
2012-06-06 14:10:55 +02:00
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