zabbirc 0.0.9 → 0.0.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.
- checksums.yaml +4 -4
- data/bin/zabbirc-install +10 -10
- data/lib/zabbirc/op_list.rb +1 -1
- data/lib/zabbirc/zabbix/resource/finders.rb +2 -2
- data/lib/zabbirc.rb +1 -1
- data/tmp/playground.rb +0 -37
- 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: 9709c2587dc9ede55cf578ac23dd8cdab18a0a39
|
4
|
+
data.tar.gz: 384e3abc02e685d19e1db41575ee4343cdd80753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff594056094dd32781b14022e6b87bbd1ff7981b81d73d4989c44ad8bb6018141e2f5521c09286e0dd93e05b87dbb6a3e479cba341e51359743735e3d9f66c4f
|
7
|
+
data.tar.gz: f63c3689718110f00ffde34a5cd2ca244077e4ecb147fdc58cb7acfb56ab80cf83dd3e581c8c9f9f32b4f8cdbe48552a1e79457f6cc575f39b4b96a452f97559
|
data/bin/zabbirc-install
CHANGED
@@ -14,31 +14,31 @@ require 'zabbirc'
|
|
14
14
|
require 'pry'
|
15
15
|
|
16
16
|
def chown_directory dir
|
17
|
-
puts "Using sudo to chown
|
17
|
+
puts "Using sudo to chown directory `#{dir}`"
|
18
18
|
system "sudo chown #{Process.uid}:#{Process.gid} #{dir}"
|
19
19
|
end
|
20
20
|
|
21
21
|
begin
|
22
|
-
unless Dir.exists? Zabbirc::
|
23
|
-
puts "Using sudo to create
|
24
|
-
r = system "sudo mkdir #{Zabbirc::
|
22
|
+
unless Dir.exists? Zabbirc::LIB_DATA_DIR
|
23
|
+
puts "Using sudo to create lib directory #{Zabbirc::LIB_DATA_DIR}"
|
24
|
+
r = system "sudo mkdir #{Zabbirc::LIB_DATA_DIR}"
|
25
25
|
if r
|
26
|
-
puts "Runtime directory #{Zabbirc::
|
27
|
-
chown_directory Zabbirc::
|
26
|
+
puts "Runtime directory #{Zabbirc::LIB_DATA_DIR} created"
|
27
|
+
chown_directory Zabbirc::LIB_DATA_DIR
|
28
28
|
else
|
29
|
-
puts "Could not create runtime directory #{Zabbirc::
|
29
|
+
puts "Could not create runtime directory #{Zabbirc::LIB_DATA_DIR}"
|
30
30
|
puts "Please create this directory and check if it's accesible by user, that will run zabbirc bot"
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
# Test if runtime directory is accessible
|
35
|
-
f = File.open(Zabbirc::
|
35
|
+
f = File.open(Zabbirc::LIB_DATA_DIR.join("test"), "w")
|
36
36
|
f.puts "test"
|
37
37
|
f.close
|
38
38
|
FileUtils.rm f.path
|
39
39
|
rescue Errno::EACCES
|
40
|
-
unless chown_directory Zabbirc::
|
41
|
-
puts "Could not make runtime directory `#{Zabbirc::
|
40
|
+
unless chown_directory Zabbirc::LIB_DATA_DIR
|
41
|
+
puts "Could not make runtime directory `#{Zabbirc::LIB_DATA_DIR}` accessible"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
data/lib/zabbirc/op_list.rb
CHANGED
@@ -15,7 +15,7 @@ module Zabbirc
|
|
15
15
|
else
|
16
16
|
self.new res.first
|
17
17
|
end
|
18
|
-
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError => e
|
18
|
+
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError, OpenSSL::SSL::SSLError => e
|
19
19
|
Zabbirc.logger.error "Zabbix::Resource#find: #{e}"
|
20
20
|
raise NotConnected, e
|
21
21
|
else
|
@@ -29,7 +29,7 @@ module Zabbirc
|
|
29
29
|
ret = res.collect do |obj|
|
30
30
|
self.new obj
|
31
31
|
end
|
32
|
-
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError => e
|
32
|
+
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError, OpenSSL::SSL::SSLError => e
|
33
33
|
Zabbirc.logger.error "Zabbix::Resource#get: #{e}"
|
34
34
|
raise NotConnected, e
|
35
35
|
else
|
data/lib/zabbirc.rb
CHANGED
@@ -12,7 +12,7 @@ def require_dir dir
|
|
12
12
|
end
|
13
13
|
|
14
14
|
module Zabbirc
|
15
|
-
|
15
|
+
LIB_DATA_DIR = Pathname.new("/usr/local/zabbirc") unless defined? LIB_DATA_DIR
|
16
16
|
def self.synchronize &block
|
17
17
|
@mutex ||= Mutex.new
|
18
18
|
@mutex.synchronize &block
|
data/tmp/playground.rb
CHANGED
@@ -1,37 +0,0 @@
|
|
1
|
-
/usr/local/rvm/gems/ruby-2.1.2@zabbirc-test/bin
|
2
|
-
/usr/local/rvm/gems/ruby-2.1.2@global/bin
|
3
|
-
/usr/local/rvm/rubies/ruby-2.1.2/bin
|
4
|
-
/usr/local/rvm/bin
|
5
|
-
/usr/local/heroku/bin
|
6
|
-
/usr/local/bin
|
7
|
-
/usr/local/sbin
|
8
|
-
~/bin
|
9
|
-
/usr/bin
|
10
|
-
/bin
|
11
|
-
/usr/sbin
|
12
|
-
/sbin
|
13
|
-
/usr/local/bin
|
14
|
-
/opt/X11/bin
|
15
|
-
/Applications/Server.app/Contents/ServerRoot/usr/bin
|
16
|
-
/Applications/Server.app/Contents/ServerRoot/usr/sbin
|
17
|
-
/usr/texbin
|
18
|
-
/usr/local/bin
|
19
|
-
/usr/bin
|
20
|
-
/bin
|
21
|
-
/usr/sbin
|
22
|
-
/sbin
|
23
|
-
/usr/local/bin
|
24
|
-
/opt/X11/bin
|
25
|
-
/Applications/Server.app/Contents/ServerRoot/usr/bin
|
26
|
-
/Applications/Server.app/Contents/ServerRoot/usr/sbin
|
27
|
-
/Users/wayneeseguin/.sm/bin
|
28
|
-
/Users/wayneeseguin/.sm/pkg/active/bin
|
29
|
-
/Users/wayneeseguin/.sm/pkg/active/sbin
|
30
|
-
/usr/local/mysql/bin
|
31
|
-
/usr/bin
|
32
|
-
/usr/local/bin
|
33
|
-
/Users/tulak/Documents/Android Development/android-sdk-macosx/tools
|
34
|
-
/Users/tulak/Documents/Android Development/android-sdk-macosx/platform-tools
|
35
|
-
/Users/tulak/.rvm/bin
|
36
|
-
/usr/local/sbin
|
37
|
-
/usr/local/gnat/bin
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbirc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filip Zachar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|