zabbix-monitor 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zabbix.rb +1 -1
- data/lib/zabbix/config.rb +0 -2
- data/lib/zabbix/monitor.rb +1 -0
- data/spec/config_spec.rb +0 -14
- data/spec/monitor_spec.rb +1 -1
- data/zabbix-monitor.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bae7b9235c377bf9f4d2afefbe1ec6931d93f97
|
4
|
+
data.tar.gz: 87cd0f3ec5028abfc70bc90f0e818d9fcb87dfb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da101cbd010d4b74674633328432e7c6dc76785745ac24c71df4c65469b913b723cd30238b22c81090be14108ba773df2886f50dcc0882417f708835097ea89d
|
7
|
+
data.tar.gz: 278e327299e5c08aeb1107754fe0db5876d3d993d411d5dd93a5973fd335fc3f92cfe1754acbfb3ff59fa727743bdfe70628ad45f56248bf45f93fdde5b29faf
|
data/lib/zabbix.rb
CHANGED
@@ -41,7 +41,7 @@ module Zabbix
|
|
41
41
|
# @return [Yell] creates a new or returns the +Yell+ logger instance
|
42
42
|
def logger
|
43
43
|
@logger ||= Yell.new do |l|
|
44
|
-
l.adapter :datefile, :filename => self.config.log_file_path, :symlink =>
|
44
|
+
l.adapter :datefile, :filename => self.config.log_file_path, :symlink => false
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/zabbix/config.rb
CHANGED
@@ -46,10 +46,8 @@ module Zabbix
|
|
46
46
|
def mode= value
|
47
47
|
allowed_modes = [:push, :file, :stdout].freeze
|
48
48
|
if allowed_modes.include?(value)
|
49
|
-
Zabbix.logger.info "[Config] setting mode to '#{value}'"
|
50
49
|
@mode = value
|
51
50
|
else
|
52
|
-
Zabbix.logger.error "[Config] failed setting mode to '#{value}'"
|
53
51
|
raise "Unsupported mode: #{value}"
|
54
52
|
end
|
55
53
|
end
|
data/lib/zabbix/monitor.rb
CHANGED
data/spec/config_spec.rb
CHANGED
@@ -6,25 +6,11 @@ describe Zabbix::Config do
|
|
6
6
|
let(:config) { Zabbix::Config.new }
|
7
7
|
|
8
8
|
describe '#mode' do
|
9
|
-
it 'allows setting mode to push' do
|
10
|
-
expect(logger).to receive(:info).with(/setting mode to 'push'/)
|
11
|
-
config.mode = :push
|
12
|
-
end
|
13
|
-
it 'allows setting mode to file' do
|
14
|
-
expect(logger).to receive(:info).with(/setting mode to 'file'/)
|
15
|
-
config.mode = :file
|
16
|
-
end
|
17
|
-
it 'allows setting mode to stdout' do
|
18
|
-
expect(logger).to receive(:info).with(/setting mode to 'stdout'/)
|
19
|
-
config.mode = :stdout
|
20
|
-
end
|
21
9
|
it 'raises an unsupported mode for a invalid mode' do
|
22
|
-
expect(logger).to receive(:error).with(/failed setting mode to 'wrong'/)
|
23
10
|
expect { config.mode = :wrong }
|
24
11
|
.to raise_error(StandardError, 'Unsupported mode: wrong')
|
25
12
|
end
|
26
13
|
it 'raises an unsupported mode for a empty mode' do
|
27
|
-
expect(logger).to receive(:error).with(/failed setting mode to ''/)
|
28
14
|
expect { config.mode = '' }
|
29
15
|
.to raise_error(StandardError, 'Unsupported mode: ')
|
30
16
|
end
|
data/spec/monitor_spec.rb
CHANGED
@@ -96,7 +96,7 @@ describe Zabbix::Monitor do
|
|
96
96
|
monitor.send(:to_zabbix, 'key', 'value')
|
97
97
|
end
|
98
98
|
it 'outputs BUMMER if the command is executed with an error' do
|
99
|
-
monitor.stub(:'`') { `(exit
|
99
|
+
monitor.stub(:'`') { `(exit 1)` }
|
100
100
|
expect(logger).to receive(:error).with(/failed sending rule: 'key' with value: 'value' to zabbix server: 'servername'/)
|
101
101
|
monitor.send(:to_zabbix, 'key', 'value')
|
102
102
|
end
|
data/zabbix-monitor.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'zabbix-monitor'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.7'
|
8
8
|
spec.authors = ['Robert Jan de Gelder', 'Manuel van Rijn']
|
9
9
|
spec.email = ['r.degelder@sping.nl', 'm.vanrijn@sping.nl']
|
10
10
|
spec.description = 'Zabbix application monitoring'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbix-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Jan de Gelder
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rufus-scheduler
|