zabby 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/LICENSE +49 -0
- data/README.rdoc +137 -0
- data/Rakefile +8 -0
- data/bin/zabbyrb +86 -0
- data/bin/zabbysh +68 -0
- data/doc/Zabby.html +208 -0
- data/doc/Zabby/AuthenticationError.html +116 -0
- data/doc/Zabby/Config.html +414 -0
- data/doc/Zabby/ConfigurationError.html +116 -0
- data/doc/Zabby/Connection.html +1617 -0
- data/doc/Zabby/ResponseCodeError.html +116 -0
- data/doc/Zabby/Runner.html +1116 -0
- data/doc/_index.html +175 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.LICENSE.html +132 -0
- data/doc/file.README.html +234 -0
- data/doc/file_list.html +52 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +234 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +358 -0
- data/doc/top-level-namespace.html +103 -0
- data/lib/zabby.rb +25 -0
- data/lib/zabby/config.rb +38 -0
- data/lib/zabby/connection.rb +131 -0
- data/lib/zabby/exceptions.rb +10 -0
- data/lib/zabby/runner.rb +152 -0
- data/lib/zabby/version.rb +8 -0
- data/lib/zabby/zobject.rb +27 -0
- data/spec/spec_helper.rb +5 -0
- data/zabby.gemspec +31 -0
- metadata +170 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# Author:: Farzad FARID (<ffarid@pragmatic-source.com>)
|
3
|
+
# Copyright:: Copyright (c) 2011 Farzad FARID
|
4
|
+
# License:: Simplified BSD License
|
5
|
+
|
6
|
+
module Zabby
|
7
|
+
# Definition of the Zabbix Objects as provided by the Zabbix API
|
8
|
+
class ZObject
|
9
|
+
attr_reader :zname, :zmethods
|
10
|
+
|
11
|
+
def initialize(zname, zmethods)
|
12
|
+
@zname = zname
|
13
|
+
@zmethods = zmethods.map { |f| f.to_sym }
|
14
|
+
end
|
15
|
+
|
16
|
+
# Simulate methods on the object.
|
17
|
+
# For example: "host.get", "item.create"..
|
18
|
+
# @zmethods is the list of valid methods.
|
19
|
+
def method_missing(zmethod, *args, &block)
|
20
|
+
if @zmethods.include? zmethod
|
21
|
+
Zabby::Runner.instance.connection.perform_request(@zname, zmethod, args.first)
|
22
|
+
else
|
23
|
+
super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/zabby.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# Author:: Farzad FARID (<ffarid@pragmatic-source.com>)
|
3
|
+
# Copyright:: Copyright (c) 2011 Farzad FARID
|
4
|
+
# License:: Simplified BSD License
|
5
|
+
|
6
|
+
$:.push File.expand_path("../lib", __FILE__)
|
7
|
+
require "zabby/version"
|
8
|
+
|
9
|
+
Gem::Specification.new do |s|
|
10
|
+
s.name = "zabby"
|
11
|
+
s.version = Zabby::VERSION
|
12
|
+
s.platform = Gem::Platform::RUBY
|
13
|
+
s.authors = ["Farzad FARID"]
|
14
|
+
s.email = ["ffarid@pragmatic-source.com"]
|
15
|
+
s.homepage = "http://zabby.org/"
|
16
|
+
s.summary = %q{Ruby Zabbix API and command line interface}
|
17
|
+
s.description = %q{Zabby is a Zabby API and CLI. It provides a provisioning tool for
|
18
|
+
creating, updating and querying Zabbix objects (hosts, items, triggers, etc.) through the web
|
19
|
+
service.}
|
20
|
+
|
21
|
+
s.rubyforge_project = "zabby"
|
22
|
+
|
23
|
+
s.files = `git ls-files`.split("\n")
|
24
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
26
|
+
s.require_paths = ["lib"]
|
27
|
+
s.add_runtime_dependency "json"
|
28
|
+
s.add_development_dependency "bundler", ">= 1.0.0"
|
29
|
+
s.add_development_dependency "rspec", ">= 2.0.0"
|
30
|
+
s.add_development_dependency "rake", ">= 0.8.7"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zabby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Farzad FARID
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-12-21 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: json
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bundler
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 23
|
44
|
+
segments:
|
45
|
+
- 1
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
version: 1.0.0
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: rspec
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 15
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 0
|
63
|
+
- 0
|
64
|
+
version: 2.0.0
|
65
|
+
type: :development
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rake
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 49
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
- 8
|
79
|
+
- 7
|
80
|
+
version: 0.8.7
|
81
|
+
type: :development
|
82
|
+
version_requirements: *id004
|
83
|
+
description: |-
|
84
|
+
Zabby is a Zabby API and CLI. It provides a provisioning tool for
|
85
|
+
creating, updating and querying Zabbix objects (hosts, items, triggers, etc.) through the web
|
86
|
+
service.
|
87
|
+
email:
|
88
|
+
- ffarid@pragmatic-source.com
|
89
|
+
executables:
|
90
|
+
- zabbyrb
|
91
|
+
- zabbysh
|
92
|
+
extensions: []
|
93
|
+
|
94
|
+
extra_rdoc_files: []
|
95
|
+
|
96
|
+
files:
|
97
|
+
- .gitignore
|
98
|
+
- Gemfile
|
99
|
+
- LICENSE
|
100
|
+
- README.rdoc
|
101
|
+
- Rakefile
|
102
|
+
- bin/zabbyrb
|
103
|
+
- bin/zabbysh
|
104
|
+
- doc/Zabby.html
|
105
|
+
- doc/Zabby/AuthenticationError.html
|
106
|
+
- doc/Zabby/Config.html
|
107
|
+
- doc/Zabby/ConfigurationError.html
|
108
|
+
- doc/Zabby/Connection.html
|
109
|
+
- doc/Zabby/ResponseCodeError.html
|
110
|
+
- doc/Zabby/Runner.html
|
111
|
+
- doc/_index.html
|
112
|
+
- doc/class_list.html
|
113
|
+
- doc/css/common.css
|
114
|
+
- doc/css/full_list.css
|
115
|
+
- doc/css/style.css
|
116
|
+
- doc/file.LICENSE.html
|
117
|
+
- doc/file.README.html
|
118
|
+
- doc/file_list.html
|
119
|
+
- doc/frames.html
|
120
|
+
- doc/index.html
|
121
|
+
- doc/js/app.js
|
122
|
+
- doc/js/full_list.js
|
123
|
+
- doc/js/jquery.js
|
124
|
+
- doc/method_list.html
|
125
|
+
- doc/top-level-namespace.html
|
126
|
+
- lib/zabby.rb
|
127
|
+
- lib/zabby/config.rb
|
128
|
+
- lib/zabby/connection.rb
|
129
|
+
- lib/zabby/exceptions.rb
|
130
|
+
- lib/zabby/runner.rb
|
131
|
+
- lib/zabby/version.rb
|
132
|
+
- lib/zabby/zobject.rb
|
133
|
+
- spec/spec_helper.rb
|
134
|
+
- zabby.gemspec
|
135
|
+
has_rdoc: true
|
136
|
+
homepage: http://zabby.org/
|
137
|
+
licenses: []
|
138
|
+
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
hash: 3
|
150
|
+
segments:
|
151
|
+
- 0
|
152
|
+
version: "0"
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
162
|
+
requirements: []
|
163
|
+
|
164
|
+
rubyforge_project: zabby
|
165
|
+
rubygems_version: 1.4.2
|
166
|
+
signing_key:
|
167
|
+
specification_version: 3
|
168
|
+
summary: Ruby Zabbix API and command line interface
|
169
|
+
test_files:
|
170
|
+
- spec/spec_helper.rb
|