nagiosedit

This is a community-maintained plugin!

The Nagios output is used for sending passive check results to Nagios via the Nagios command file. This output currently supports Nagios 3.

For this output to work, your event must have the following Logstash event fields:

  • nagios_host
  • nagios_service

These Logstash event fields are supported, but optional:

  • nagios_annotation
  • nagios_level (overrides nagios_level configuration option)

There are two configuration options:

  • commandfile - The location of the Nagios external command file. Defaults to /var/lib/nagios3/rw/nagios.cmd
  • nagios_level - Specifies the level of the check to be sent. Defaults to CRITICAL and can be overriden by setting the "nagios_level" field to one of "OK", "WARNING", "CRITICAL", or "UNKNOWN"

        output{
          if [message] =~ /(error|ERROR|CRITICAL)/ {
            nagios {
              # your config here
            }
          }
        }

 

Synopsisedit

This plugin supports the following configuration options:

Required configuration options:

nagios {
}

Available configuration options:

Setting Input type Required Default value

codec

codec

No

"plain"

commandfile

<<,>>

No

"/var/lib/nagios3/rw/nagios.cmd"

nagios_level

string, one of ["0", "1", "2", "3"]

No

"2"

workers

number

No

1

Detailsedit

 

codecedit

  • Value type is codec
  • Default value is "plain"

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output, without needing a separate filter in your Logstash pipeline.

commandfileedit

<li> Value type is <<string,string>>
* Default value is `"/var/lib/nagios3/rw/nagios.cmd"`

The full path to your Nagios command file.

nagios_leveledit

  • Value can be any of: 0, 1, 2, 3
  • Default value is "2"

The Nagios check level. Should be one of 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN. Defaults to 2 - CRITICAL.

workersedit

  • Value type is number
  • Default value is 1

The number of workers to use for this output. Note that this setting may not be useful for all outputs.