lib/logstash/outputs/nagios_nsca.rb in logstash-output-nagios_nsca-3.0.6 vs lib/logstash/outputs/nagios_nsca.rb in logstash-output-nagios_nsca-3.0.7
- old
+ new
@@ -15,11 +15,10 @@
# [source,ruby]
# output {
# nagios_nsca {
# # specify the hostname or ip of your nagios server
# host => "nagios.example.com"
-#
# # specify the port to connect to
# port => 5667
# }
# }
@@ -91,11 +90,11 @@
msg = "status '#{status}' is not numeric"
status = 2
else
status = status.to_i
if status > 3 || status < 0
- msg "status must be > 0 and <= 3, not #{status}"
+ msg = "status must be > 0 and <= 3, not #{status}"
status = 2
end
end
# build the command
@@ -124,10 +123,10 @@
File.exists?(@send_nsca_bin)
end
def cmd
return @cmd if @cmd
- @cmd = [@send_nsca_bin, "-H", @host, "-p", @port, "-d", ":"]
+ @cmd = [@send_nsca_bin, "-H", @host, "-p", @port.to_s, "-d", ":"]
@cmd = @cmd + ["-c", @send_nsca_config] if @send_nsca_config
@cmd
end
def send_to_nagios(cmd, message)