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.
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.
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.
check_pgsql: Allow UNIX socket directories as hostname as well.

PostgreSQL accepts the directory name of its UNIX socket as hostname as well,
e.g. /var/run/postgresql/.
check_pgsql: Removed -4/-6 flags from help output.

These options are not currently supported.
check_pgsql: Added support for the -o command line option.

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.
check_pgsql: Updated copyright.
check_pgsql: Leave 'min' value in query perfdata empty.

There is no reasonable default value for that.
check_pgsql: Determine connection time in µs-resolution.

… thus, treat "elapsed time" and the thresholds as floating point values.
Don't prepend "^Inst" or append a space to the "include", "exclude", or
"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.
Fix SourceForge bug 1904965 - check_apt: SECURITY_RE is not correct

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 ...
Tests for check_apt

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.
check_disk: option to ignore reserved space

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.
check_fping: IPv6 support

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.
Updated check_mysql.c to take client options file and group parameters
check_snmp: Don't thrash memory when using multiple label/unit argument

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>
updated changelog and thanks file for previous patch
check_dig: query transport selection support

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.
updated check dig tests

nagios.com seems to have changed their ip address. Also added tests
about -4/-6 option.
Merge pull request #20 from abradley/aptcritical

Fixes for check_apt handling of -i/-e/-c regexps and SECURITY_RE, plus tests