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