logstash-output-nagios_nsca 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +3 -0
- data/lib/logstash/outputs/nagios_nsca.rb +11 -8
- data/logstash-output-nagios_nsca.gemspec +1 -1
- data/spec/outputs/nagios_nsca_spec.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a18665fc36fb79c963745ef609ad4ac9aa4881f0
|
4
|
+
data.tar.gz: 0743254bc9ebbda143ee02a67bf1ca94cb1693ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d312e59c957e02fa5906864ab3867cee8d3d8e0f8b5776a73d2486a97449cf9f642273f3aaf30cb0b8dbab1d138e951b22ea3d2a8487917d0c4f952129dc8a13
|
7
|
+
data.tar.gz: 9cb350477c3fef7d2cb357c9f51587af78873e7d076035a7d805414e41fcb3ddc566fa421850c7227deab609fa68e314d1d59886a8c344bc12ce4e8a6ab66155
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 2.0.3
|
2
|
+
- Fix plugin command to nagios and command format, fixes #3
|
3
|
+
- Fix the nagios command format, fixes #3
|
1
4
|
## 2.0.0
|
2
5
|
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
6
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
+
[![Build
|
4
|
+
Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-nagios_nsca-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-nagios_nsca-unit/)
|
5
|
+
|
3
6
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
4
7
|
|
5
8
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
@@ -66,8 +66,6 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
|
|
66
66
|
public
|
67
67
|
def receive(event)
|
68
68
|
# exit if type or tags don't match
|
69
|
-
|
70
|
-
|
71
69
|
# catch logstash shutdown
|
72
70
|
return if event == LogStash::SHUTDOWN
|
73
71
|
|
@@ -104,14 +102,12 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
|
|
104
102
|
# syntax: echo '<server>!<nagios_service>!<status>!<text>' | \
|
105
103
|
# /usr/sbin/send_nsca -H <nagios_host> -d '!' -c <nsca_config>"
|
106
104
|
|
107
|
-
|
108
|
-
cmd = cmd + ["-c", @send_nsca_config] if @send_nsca_config
|
109
|
-
message = "#{nagios_host}~#{nagios_service}~#{status}~#{msg}"
|
105
|
+
message = "#{nagios_host}:#{nagios_service}:#{status}:#{msg}"
|
110
106
|
|
111
107
|
@logger.debug("Running send_nsca command", :nagios_nsca_command => cmd.join(" "), :message => message)
|
112
108
|
|
113
109
|
begin
|
114
|
-
send_to_nagios(cmd)
|
110
|
+
send_to_nagios(cmd, message)
|
115
111
|
rescue => e
|
116
112
|
@logger.warn(
|
117
113
|
"Skipping nagios_nsca output; error calling send_nsca",
|
@@ -128,9 +124,16 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
|
|
128
124
|
File.exists?(@send_nsca_bin)
|
129
125
|
end
|
130
126
|
|
131
|
-
def
|
127
|
+
def cmd
|
128
|
+
return @cmd if @cmd
|
129
|
+
@cmd = [@send_nsca_bin, "-H", @host, "-p", @port, "-d", ":"]
|
130
|
+
@cmd = @cmd + ["-c", @send_nsca_config] if @send_nsca_config
|
131
|
+
@cmd
|
132
|
+
end
|
133
|
+
|
134
|
+
def send_to_nagios(cmd, message)
|
132
135
|
Open3.popen3(*cmd) do |i, o, e|
|
133
|
-
i.puts(message)
|
136
|
+
i.puts(message)
|
134
137
|
i.close
|
135
138
|
end
|
136
139
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-nagios_nsca'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This output is used for sending passive check results to Nagios through the NSCA protocol."
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
@@ -22,7 +22,7 @@ describe LogStash::Outputs::NagiosNsca do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "send the event to nagios" do
|
25
|
-
expect(subject).to receive(:send_to_nagios)
|
25
|
+
expect(subject).to receive(:send_to_nagios).with(subject.cmd, instance_of(String))
|
26
26
|
subject.receive(event)
|
27
27
|
end
|
28
28
|
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-nagios_nsca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
14
|
+
name: logstash-core
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - '>='
|
17
18
|
- !ruby/object:Gem::Version
|
@@ -19,10 +20,7 @@ dependencies:
|
|
19
20
|
- - <
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 3.0.0
|
22
|
-
|
23
|
-
prerelease: false
|
24
|
-
type: :runtime
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
25
|
- - '>='
|
28
26
|
- !ruby/object:Gem::Version
|
@@ -30,34 +28,36 @@ dependencies:
|
|
30
28
|
- - <
|
31
29
|
- !ruby/object:Gem::Version
|
32
30
|
version: 3.0.0
|
31
|
+
prerelease: false
|
32
|
+
type: :runtime
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
+
name: logstash-codec-plain
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
34
40
|
requirement: !ruby/object:Gem::Requirement
|
35
41
|
requirements:
|
36
42
|
- - '>='
|
37
43
|
- !ruby/object:Gem::Version
|
38
44
|
version: '0'
|
39
|
-
name: logstash-codec-plain
|
40
45
|
prerelease: false
|
41
46
|
type: :runtime
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: logstash-devutils
|
42
49
|
version_requirements: !ruby/object:Gem::Requirement
|
43
50
|
requirements:
|
44
51
|
- - '>='
|
45
52
|
- !ruby/object:Gem::Version
|
46
53
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
54
|
requirement: !ruby/object:Gem::Requirement
|
49
55
|
requirements:
|
50
56
|
- - '>='
|
51
57
|
- !ruby/object:Gem::Version
|
52
58
|
version: '0'
|
53
|
-
name: logstash-devutils
|
54
59
|
prerelease: false
|
55
60
|
type: :development
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - '>='
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
61
61
|
description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
|
62
62
|
email: info@elastic.co
|
63
63
|
executables: []
|