senedsa 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/senedsa/send_nsca.rb +6 -6
- data/lib/senedsa/version.rb +1 -1
- metadata +2 -2
data/lib/senedsa/send_nsca.rb
CHANGED
@@ -16,7 +16,7 @@ module Senedsa
|
|
16
16
|
@defaults = {
|
17
17
|
:send_nsca_binary => 'send_nsca',
|
18
18
|
:send_nsca_config => nil,
|
19
|
-
:send_nsca_delim =>
|
19
|
+
:send_nsca_delim => "\t",
|
20
20
|
:send_nsca_timeout => 10,
|
21
21
|
:nsca_hostname => nil,
|
22
22
|
:nsca_port => 5667,
|
@@ -109,9 +109,9 @@ module Senedsa
|
|
109
109
|
next if [:send_nsca_config, :svc_status, :svc_output].include? option
|
110
110
|
raise ArgumentError, "missing send_nsca option #{option}" if @options[option].nil?
|
111
111
|
end
|
112
|
-
raise ArgumentError, "missing send_nsca svc_status" if svc_status.nil?
|
113
|
-
raise ArgumentError, "missing send_nsca svc_output" if svc_output.nil?
|
114
|
-
run svc_status, svc_output
|
112
|
+
raise ArgumentError, "missing send_nsca svc_status" if @options[:svc_status].nil?
|
113
|
+
raise ArgumentError, "missing send_nsca svc_output" if @options[:svc_output].nil?
|
114
|
+
run @options[:svc_status], @options[:svc_output]
|
115
115
|
end
|
116
116
|
|
117
117
|
SendNsca.defaults.keys.each do |attr|
|
@@ -134,8 +134,8 @@ module Senedsa
|
|
134
134
|
def run(svc_status,svc_output)
|
135
135
|
begin
|
136
136
|
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
|
137
|
-
payload = "%s" % [svc_hostname,svc_descr,STATUS[svc_status],svc_output].join(send_nsca_delim)
|
138
|
-
stdin.write(
|
137
|
+
payload = "%s\n" % [svc_hostname,svc_descr,STATUS[svc_status],svc_output].join(send_nsca_delim)
|
138
|
+
stdin.write(payload)
|
139
139
|
stdin.close
|
140
140
|
$stdout.write stdout.gets if STDIN.tty?
|
141
141
|
raise SendNscaError, stderr.gets.chomp unless wait_thr.value.exitstatus == 0
|
data/lib/senedsa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: senedsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Senedsa is a small utility and library wrapper for the Nagios send_nsca.
|
15
15
|
email: gerir@evernote.com
|