.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "COLLECTD-NAGIOS 1" .TH COLLECTD-NAGIOS 1 2024-02-04 5.12.0.git collectd .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME collectd\-nagios \- Nagios plugin for querying collectd .SH SYNOPSIS .IX Header "SYNOPSIS" collectd-nagios \fB\-s\fR \fIsocket\fR \fB\-n\fR \fIvalue_spec\fR \fB\-H\fR \fIhostname\fR \fI[options]\fR .SH DESCRIPTION .IX Header "DESCRIPTION" This small program is the glue between collectd and nagios. collectd collects various performance statistics which it provides via the \f(CW\*(C`unixsock plugin\*(C'\fR, see \fBcollectd\-unixsock\fR\|(5). This program is called by Nagios, connects to the UNIX socket and reads the values from collectd. It then returns \fBOKAY\fR, \&\fBWARNING\fR or \fBCRITICAL\fR depending on the values and the ranges provided by Nagios. .SH "ARGUMENTS AND OPTIONS" .IX Header "ARGUMENTS AND OPTIONS" The following arguments and options are required and understood by collectd-nagios. The order of the arguments generally doesn't matter, as long as no argument is passed more than once. .IP "\fB\-s\fR \fIsocket\fR" 4 .IX Item "-s socket" Path of the UNIX socket opened by collectd's \f(CW\*(C`unixsock plugin\*(C'\fR. .IP "\fB\-n\fR \fIvalue_spec\fR" 4 .IX Item "-n value_spec" The value to read from collectd. The argument is in the form \&\f(CW\*(C`plugin[\-instance]/type[\-instance]\*(C'\fR. .IP "\fB\-H\fR \fIhostname\fR" 4 .IX Item "-H hostname" Hostname to query the values for. .IP "\fB\-d\fR \fIdata_source\fR" 4 .IX Item "-d data_source" Each \fIvalue_spec\fR may be made of multiple "data sources". With this option you can select one or more data sources. To select multiple data sources simply specify this option again. If multiple data sources are examined they are handled according to the consolidation function given with the \fB\-g\fR option. .IP "\fB\-g\fR \fBnone\fR\fI|\fR\fBaverage\fR\fI|\fR\fBsum\fR" 4 .IX Item "-g none|average|sum" When multiple data sources are selected from a value spec, they can be handled differently depending on this option. The values of the following meaning: .RS 4 .IP \fBnone\fR 4 .IX Item "none" No consolidation if done and the warning and critical regions are applied to each value independently. .IP \fBaverage\fR 4 .IX Item "average" The warning and critical ranges are applied to the average of all values. .IP \fBsum\fR 4 .IX Item "sum" The warning and critical ranges are applied to the sum of all values. .IP \fBpercentage\fR 4 .IX Item "percentage" The warning and critical ranges are applied to the ratio (in percent) of the first value and the sum of all values. A warning is returned if the first value is not defined or if all values sum up to zero. .RE .RS 4 .RE .IP "\fB\-c\fR \fIrange\fR" 4 .IX Item "-c range" .PD 0 .IP "\fB\-w\fR \fIrange\fR" 4 .IX Item "-w range" .PD Set the critical (\fB\-c\fR) and warning (\fB\-w\fR) ranges. These options mostly follow the normal syntax of Nagios plugins. The general format is "\fImin\fR\fB:\fR\fImax\fR". If a value is smaller than \fImin\fR or bigger than \fImax\fR, a \&\fIwarning\fR or \fIcritical\fR status is returned, otherwise the status is \&\fIsuccess\fR. .Sp The tilde sign (\fB~\fR) can be used to explicitly specify infinity. If \fB~\fR is used as a \fImin\fR value, negative infinity is used. In case of \fImax\fR, it is interpreted as positive infinity. .Sp If the first character of the \fIrange\fR is the at\ sign (\fB@\fR), the meaning of the range will be inverted. I.\ e. all values \fIwithin\fR the range will yield a \fIwarning\fR or \fIcritical\fR status, while all values \fIoutside\fR the range will result in a \fIsuccess\fR status. .Sp \&\fImin\fR (and the colon) may be omitted, \&\fImin\fR is then assumed to be zero. If \fImax\fR (but not the trailing colon) is omitted, \fImax\fR is assumed to be positive infinity. .IP \fB\-m\fR 4 .IX Item "-m" If this option is given, "Not a Number" (NaN) is treated as \fIcritical\fR. By default, the \fInone\fR consolidation reports NaNs as \fIwarning\fR. Other consolidations simply ignore NaN values. .SH "RETURN VALUE" .IX Header "RETURN VALUE" As usual for Nagios plugins, this program writes a short, one line status message to STDOUT and signals success or failure with its return value. It exits with a return value of \fB0\fR for \fIsuccess\fR, \fB1\fR for \fIwarning\fR and \fB2\fR for \fIcritical\fR. If the values are not available or some other error occurred, it returns \fB3\fR for \fIunknown\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBcollectd\fR\|(1), \&\fBcollectd.conf\fR\|(5), \&\fBcollectd\-unixsock\fR\|(5), .SH AUTHOR .IX Header "AUTHOR" Florian Forster