Merge pull request #1135 from kurtado/doc/output/nagios

alert: nagios
This commit is contained in:
Kurt Hurtado 2014-02-28 12:00:59 -08:00
commit 76cd72f98b

View file

@ -2,27 +2,26 @@
require "logstash/namespace" require "logstash/namespace"
require "logstash/outputs/base" require "logstash/outputs/base"
# The nagios output is used for sending passive check results to nagios via the # The Nagios output is used for sending passive check results to Nagios via the
# nagios command file. # Nagios command file. This output currently supports Nagios 3.
# #
# For this output to work, your event must have the following fields: # For this output to work, your event _must_ have the following Logstash event fields:
# #
# * "nagios_host" # * `nagios\_host`
# * "nagios_service" # * `nagios\_service`
# #
# These fields are supported, but optional: # These Logstash event fields are supported, but optional:
# #
# * "nagios_annotation" # * `nagios\_annotation`
# * "nagios_level" # * `nagios\_level` (overrides `nagios\_level` configuration option)
# #
# There are two configuration options: # There are two configuration options:
# #
# * commandfile - The location of the Nagios external command file # * `commandfile` - The location of the Nagios external command file. Defaults
# * nagios_level - Specifies the level of the check to be sent. Defaults to # to '/var/lib/nagios3/rw/nagios.cmd'
# CRITICAL and can be overriden by setting the "nagios_level" field to one # * `nagios\_level` - Specifies the level of the check to be sent. Defaults to
# of "OK", "WARNING", "CRITICAL", or "UNKNOWN" # CRITICAL and can be overriden by setting the "nagios\_level" field to one
# # of "OK", "WARNING", "CRITICAL", or "UNKNOWN"
# match => [ "message", "(error|ERROR|CRITICAL)" ]
# #
# output{ # output{
# if [message] =~ /(error|ERROR|CRITICAL)/ { # if [message] =~ /(error|ERROR|CRITICAL)/ {
@ -31,12 +30,13 @@ require "logstash/outputs/base"
# } # }
# } # }
# } # }
#
class LogStash::Outputs::Nagios < LogStash::Outputs::Base class LogStash::Outputs::Nagios < LogStash::Outputs::Base
config_name "nagios" config_name "nagios"
milestone 2 milestone 2
# The path to your nagios command file # The full path to your Nagios command file.
config :commandfile, :validate => :path, :default => "/var/lib/nagios3/rw/nagios.cmd" config :commandfile, :validate => :path, :default => "/var/lib/nagios3/rw/nagios.cmd"
# The Nagios check level. Should be one of 0=OK, 1=WARNING, 2=CRITICAL, # The Nagios check level. Should be one of 0=OK, 1=WARNING, 2=CRITICAL,