nagios

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
        }
      }
    }

 

Synopsis

This plugin supports the following configuration options:

Required configuration options:

nagios {
}

Available configuration options:

Setting Input typeRequiredDefault value

codec

codec

No

"plain"

commandfile

a valid filesystem path

No

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

nagios_level

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

No

"2"

workers

number

No

1

Details

 

codec

  • 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.

commandfile

  • Value type is path
  • Default value is "/var/lib/nagios3/rw/nagios.cmd"

The full path to your Nagios command file.

exclude_tags (DEPRECATED)

  • DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
  • Value type is array
  • Default value is []

Only handle events without any of these tags. Note this check is additional to type and tags.

nagios_level

  • 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.

tags (DEPRECATED)

  • DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
  • Value type is array
  • Default value is []

Only handle events with all of these tags. Note that if you specify a type, the event must also match that type. Optional.

type (DEPRECATED)

  • DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
  • Value type is string
  • Default value is ""

The type to act on. If a type is given, then this output will only act on messages with the same type. See any input plugin’s type attribute for more. Optional.

workers

  • 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.