| 1 |
=encoding UTF-8 |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
collectd-nagios - Nagios plugin for querying collectd |
| 6 |
|
| 7 |
=head1 SYNOPSIS |
| 8 |
|
| 9 |
collectd-nagios B<-s> I<socket> B<-n> I<value_spec> B<-H> I<hostname> I<[options]> |
| 10 |
|
| 11 |
=head1 DESCRIPTION |
| 12 |
|
| 13 |
This small program is the glue between collectd and nagios. collectd collects |
| 14 |
various performance statistics which it provides via the C<unixsock plugin>, |
| 15 |
see L<collectd-unixsock(5)>. This program is called by Nagios, connects to the |
| 16 |
UNIX socket and reads the values from collectd. It then returns B<OKAY>, |
| 17 |
B<WARNING> or B<CRITICAL> depending on the values and the ranges provided by |
| 18 |
Nagios. |
| 19 |
|
| 20 |
=head1 ARGUMENTS AND OPTIONS |
| 21 |
|
| 22 |
The following arguments and options are required and understood by |
| 23 |
collectd-nagios. The order of the arguments generally doesn't matter, as long |
| 24 |
as no argument is passed more than once. |
| 25 |
|
| 26 |
=over 4 |
| 27 |
|
| 28 |
=item B<-s> I<socket> |
| 29 |
|
| 30 |
Path of the UNIX socket opened by collectd's C<unixsock plugin>. |
| 31 |
|
| 32 |
=item B<-n> I<value_spec> |
| 33 |
|
| 34 |
The value to read from collectd. The argument is in the form |
| 35 |
C<plugin[-instance]/type[-instance]>. |
| 36 |
|
| 37 |
=item B<-H> I<hostname> |
| 38 |
|
| 39 |
Hostname to query the values for. |
| 40 |
|
| 41 |
=item B<-d> I<data_source> |
| 42 |
|
| 43 |
Each I<value_spec> may be made of multiple "data sources". With this option you |
| 44 |
can select one or more data sources. To select multiple data sources simply |
| 45 |
specify this option again. If multiple data sources are examined they are |
| 46 |
handled according to the consolidation function given with the B<-g> option. |
| 47 |
|
| 48 |
=item B<-g> B<none>I<|>B<average>I<|>B<sum> |
| 49 |
|
| 50 |
When multiple data sources are selected from a value spec, they can be handled |
| 51 |
differently depending on this option. The values of the following meaning: |
| 52 |
|
| 53 |
=over 4 |
| 54 |
|
| 55 |
=item B<none> |
| 56 |
|
| 57 |
No consolidation if done and the warning and critical regions are applied to |
| 58 |
each value independently. |
| 59 |
|
| 60 |
=item B<average> |
| 61 |
|
| 62 |
The warning and critical ranges are applied to the average of all values. |
| 63 |
|
| 64 |
=item B<sum> |
| 65 |
|
| 66 |
The warning and critical ranges are applied to the sum of all values. |
| 67 |
|
| 68 |
=item B<percentage> |
| 69 |
|
| 70 |
The warning and critical ranges are applied to the ratio (in percent) of the |
| 71 |
first value and the sum of all values. A warning is returned if the first |
| 72 |
value is not defined or if all values sum up to zero. |
| 73 |
|
| 74 |
=back |
| 75 |
|
| 76 |
=item B<-c> I<range> |
| 77 |
|
| 78 |
=item B<-w> I<range> |
| 79 |
|
| 80 |
Set the critical (B<-c>) and warning (B<-w>) ranges. These options mostly |
| 81 |
follow the normal syntax of Nagios plugins. The general format is |
| 82 |
"I<min>B<:>I<max>". If a value is smaller than I<min> or bigger than I<max>, a |
| 83 |
I<warning> or I<critical> status is returned, otherwise the status is |
| 84 |
I<success>. |
| 85 |
|
| 86 |
The tilde sign (B<~>) can be used to explicitly specify infinity. If B<~> is |
| 87 |
used as a I<min> value, negative infinity is used. In case of I<max>, it is |
| 88 |
interpreted as positive infinity. |
| 89 |
|
| 90 |
If the first character of the I<range> is the atE<nbsp>sign (B<@>), the meaning |
| 91 |
of the range will be inverted. I.E<nbsp>e. all values I<within> the range will |
| 92 |
yield a I<warning> or I<critical> status, while all values I<outside> the range |
| 93 |
will result in a I<success> status. |
| 94 |
|
| 95 |
I<min> (and the colon) may be omitted, |
| 96 |
I<min> is then assumed to be zero. If I<max> (but not the trailing colon) is |
| 97 |
omitted, I<max> is assumed to be positive infinity. |
| 98 |
|
| 99 |
=item B<-m> |
| 100 |
|
| 101 |
If this option is given, "Not a Number" (NaN) is treated as I<critical>. By |
| 102 |
default, the I<none> consolidation reports NaNs as I<warning>. Other |
| 103 |
consolidations simply ignore NaN values. |
| 104 |
|
| 105 |
=back |
| 106 |
|
| 107 |
=head1 RETURN VALUE |
| 108 |
|
| 109 |
As usual for Nagios plugins, this program writes a short, one line status |
| 110 |
message to STDOUT and signals success or failure with its return value. It |
| 111 |
exits with a return value of B<0> for I<success>, B<1> for I<warning> and B<2> |
| 112 |
for I<critical>. If the values are not available or some other error occurred, |
| 113 |
it returns B<3> for I<unknown>. |
| 114 |
|
| 115 |
=head1 SEE ALSO |
| 116 |
|
| 117 |
L<collectd(1)>, |
| 118 |
L<collectd.conf(5)>, |
| 119 |
L<collectd-unixsock(5)>, |
| 120 |
L<http://nagios.org/> |
| 121 |
|
| 122 |
=head1 AUTHOR |
| 123 |
|
| 124 |
Florian Forster E<lt>octoE<nbsp>atE<nbsp>collectd.orgE<gt> |
| 125 |
|
| 126 |
=cut |