nagios_nsca

edit
  • Version: 3.0.2
  • Released on: 2016-07-14
  • Changelog
  • Compatible: 5.1.1.1, 5.0.0, 2.4.1, 2.4.0, 2.3.4

This plugin does not ship with Logstash by default, but it is easy to install by running bin/logstash-plugin install logstash-output-nagios_nsca.

The nagios_nsca output is used for sending passive check results to Nagios through the NSCA protocol.

This is useful if your Nagios server is not the same as the source host from where you want to send logs or alerts. If you only have one server, this output is probably overkill # for you, take a look at the nagios output instead.

Here is a sample config using the nagios_nsca output:

    output {
      nagios_nsca {
        # specify the hostname or ip of your nagios server
        host => "nagios.example.com"
    # specify the port to connect to
    port => 5667
  }
}

 

Synopsis

edit

This plugin supports the following configuration options:

Required configuration options:

nagios_nsca {
    nagios_status => ...
}

Available configuration options:

Setting Input type Required Default value

codec

codec

No

"plain"

enable_metric

boolean

No

true

host

string

No

"localhost"

id

string

No

message_format

string

No

"%{@timestamp} %{host}: %{message}"

nagios_host

string

No

"%{host}"

nagios_service

string

No

"LOGSTASH"

nagios_status

string

Yes

port

number

No

5667

send_nsca_bin

string

No

"/usr/sbin/send_nsca"

send_nsca_config

a valid filesystem path

No

workers

<<,>>

No

1

Details

edit

 

codec

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

enable_metric

edit
  • Value type is boolean
  • Default value is true

Disable or enable metric logging for this specific plugin instance by default we record all the metrics we can, but you can disable metrics collection for a specific plugin.

host

edit
  • Value type is string
  • Default value is "localhost"

The nagios host or IP to send logs to. It should have a NSCA daemon running.

  • Value type is string
  • There is no default value for this setting.

Add a unique ID to the plugin instance, this ID is used for tracking information for a specific configuration of the plugin.

output {
 stdout {
   id => "ABC"
 }
}

If you don’t explicitely set this variable Logstash will generate a unique name.

message_format

edit
  • Value type is string
  • Default value is "%{@timestamp} %{host}: %{message}"

The format to use when writing events to nagios. This value supports any string and can include %{name} and other dynamic strings.

nagios_host

edit
  • Value type is string
  • Default value is "%{host}"

The nagios host you want to submit a passive check result to. This parameter accepts interpolation, e.g. you can use @source_host or other logstash internal variables.

nagios_service

edit
  • Value type is string
  • Default value is "LOGSTASH"

The nagios service you want to submit a passive check result to. This parameter accepts interpolation, e.g. you can use @source_host or other logstash internal variables.

nagios_status

edit
  • This is a required setting.
  • Value type is string
  • There is no default value for this setting.

The status to send to nagios. Should be 0 = OK, 1 = WARNING, 2 = CRITICAL, 3 = UNKNOWN

port

edit
  • Value type is number
  • Default value is 5667

The port where the NSCA daemon on the nagios host listens.

send_nsca_bin

edit
  • Value type is string
  • Default value is "/usr/sbin/send_nsca"

The path to the send_nsca binary on the local host.

send_nsca_config

edit
  • Value type is path
  • There is no default value for this setting.

The path to the send_nsca config file on the local host. Leave blank if you don’t want to provide a config file.

workers

edit
  • Value type is string
  • Default value is 1

TODO remove this in Logstash 6.0 when we no longer support the :legacy type This is hacky, but it can only be herne