zbxapi 0.3.10 → 0.3.11
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/api_classes/dsl_host.rb +2 -2
- data/api_classes/dsl_proxy.rb +3 -0
- data/zbxapi.rb +4 -4
- data/zbxapi/zdebug.rb +2 -2
- metadata +27 -28
- data/api_classes/dsl_maintenance.rb +0 -30
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6475db0edaa6bdf50e0348b91f18f291e604a817
|
|
4
|
+
data.tar.gz: cc004b2291b2d7a0025f61d50aff0a1b231bdd45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bdf51cfb6f86e50805f4becc2910aa7f4fddb1c1b539593f36213d480126b1feba367cfade04446ddafe26e0b0cbeb1180686d0de26445c873a5ae1b4f00e9cf
|
|
7
|
+
data.tar.gz: 5c0832cf76268c09b068e4c61804f0edc8084ac5c138b91767f0428cd96ebecc76109dde6a510d2ee909d5dbff74ea60400d500a34c44a30e0f7d4744b47ee85
|
data/api_classes/dsl_host.rb
CHANGED
|
@@ -106,7 +106,7 @@ class Host < ZabbixAPI_Base
|
|
|
106
106
|
action :delete do
|
|
107
107
|
add_arg_processor "0" do |params|
|
|
108
108
|
retval=nil
|
|
109
|
-
if params.is_a?(
|
|
109
|
+
if params.is_a?(Integer)
|
|
110
110
|
retval=[{"hostid"=>params}]
|
|
111
111
|
else
|
|
112
112
|
retval=params
|
|
@@ -139,7 +139,7 @@ class Host < ZabbixAPI_Base
|
|
|
139
139
|
"ipmi_privilege","ipmi_username","jmx_available","jmx_disable_until",
|
|
140
140
|
"jmx_error","jmx_errors_from","maintenance_from","maintenance_status",
|
|
141
141
|
"maintenance_type","maintenanceid","name","proxy_hostid","snmp_available",
|
|
142
|
-
"snmp_disable_until","snmp_error","snmp_errors_from","status"
|
|
142
|
+
"snmp_disable_until","snmp_error","snmp_errors_from","status", "templates", "groups"
|
|
143
143
|
requires "host"
|
|
144
144
|
end
|
|
145
145
|
end
|
data/api_classes/dsl_proxy.rb
CHANGED
data/zbxapi.rb
CHANGED
|
@@ -92,7 +92,7 @@ class ZabbixAPI
|
|
|
92
92
|
def initialize(url,*args)
|
|
93
93
|
options=args[0]
|
|
94
94
|
options ||= {}
|
|
95
|
-
if options.is_a?(
|
|
95
|
+
if options.is_a?(Integer)
|
|
96
96
|
warn "WARNING: Initialization has changed, backwards compatability is being used."
|
|
97
97
|
warn "WARNING: Use ZabbixAPI.new(url,:debug=>n,:returntype=>:result) to have the"
|
|
98
98
|
warn "WARNING: same capability as previous versions."
|
|
@@ -136,7 +136,7 @@ class ZabbixAPI
|
|
|
136
136
|
|
|
137
137
|
#Generate the list of sub objects dynamically, from all objects
|
|
138
138
|
#derived from ZabbixAPI_Base
|
|
139
|
-
objects=
|
|
139
|
+
objects=true
|
|
140
140
|
silence_warnings do
|
|
141
141
|
objects=Object.constants.map do |i|
|
|
142
142
|
obj=Object.const_get(i.intern)
|
|
@@ -251,7 +251,7 @@ class ZabbixAPI
|
|
|
251
251
|
@auth=result['result']
|
|
252
252
|
|
|
253
253
|
#setup the version variables
|
|
254
|
-
@major,@minor=do_request(json_obj('
|
|
254
|
+
@major,@minor=do_request(json_obj('apiinfo.version',{}))['result'].split('.')
|
|
255
255
|
@major=@major.to_i
|
|
256
256
|
@minor=@minor.to_i
|
|
257
257
|
rescue ZbxAPI_ExceptionLoginPermission => e
|
|
@@ -420,7 +420,7 @@ class ZabbixAPI
|
|
|
420
420
|
when 301
|
|
421
421
|
puts "Redirecting to #{response['location']}"
|
|
422
422
|
@url=URI.parse(response['location'])
|
|
423
|
-
|
|
423
|
+
raise Redirect
|
|
424
424
|
when 500
|
|
425
425
|
raise ZbxAPI_GeneralError.new("Zabbix server returned an internal error\n Call: #{json_obj}", :retry=>true)
|
|
426
426
|
end
|
data/zbxapi/zdebug.rb
CHANGED
|
@@ -61,10 +61,10 @@ module ZDebug
|
|
|
61
61
|
facility=args[:facility] || nil
|
|
62
62
|
raise "Facility must be a symbol" if facility && facility.class!=Symbol
|
|
63
63
|
truncate=args[:truncate] || 0
|
|
64
|
-
raise "Truncate must be an Integer" if truncate.class!=
|
|
64
|
+
raise "Truncate must be an Integer" if truncate.class!=Integer
|
|
65
65
|
overload=(!args[:overload].nil? && args[:overload]==true) || false
|
|
66
66
|
stack_pos=args[:stack_pos] || 0
|
|
67
|
-
raise ":stack_pos must be an Integer" if stack_pos.class!=
|
|
67
|
+
raise ":stack_pos must be an Integer" if stack_pos.class!=Integer
|
|
68
68
|
backtrace_depth=args[:trace_depth] || 0
|
|
69
69
|
|
|
70
70
|
return if overload
|
metadata
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zbxapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- A. Nelson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
description: Provides a straight forward interface to manipulate Zabbix servers using
|
|
@@ -32,36 +32,35 @@ extensions: []
|
|
|
32
32
|
extra_rdoc_files: []
|
|
33
33
|
files:
|
|
34
34
|
- LICENSE
|
|
35
|
-
- zbxapi.rb
|
|
36
|
-
- zbxapi/zdebug.rb
|
|
37
|
-
- zbxapi/api_exceptions.rb
|
|
38
|
-
- zbxapi/exceptions.rb
|
|
39
|
-
- zbxapi/utils.rb
|
|
40
|
-
- zbxapi/result.rb
|
|
41
35
|
- api_classes/api_dsl.rb
|
|
42
36
|
- api_classes/dsl_action.rb
|
|
43
|
-
- api_classes/dsl_event.rb
|
|
44
37
|
- api_classes/dsl_alert.rb
|
|
45
|
-
- api_classes/
|
|
46
|
-
- api_classes/dsl_drule.rb
|
|
47
|
-
- api_classes/dsl_host.rb
|
|
48
|
-
- api_classes/dsl_trigger.rb
|
|
38
|
+
- api_classes/dsl_configuration.rb
|
|
49
39
|
- api_classes/dsl_dcheck.rb
|
|
40
|
+
- api_classes/dsl_dhost.rb
|
|
41
|
+
- api_classes/dsl_drule.rb
|
|
42
|
+
- api_classes/dsl_dservice.rb
|
|
43
|
+
- api_classes/dsl_event.rb
|
|
44
|
+
- api_classes/dsl_graph.rb
|
|
50
45
|
- api_classes/dsl_history.rb
|
|
51
|
-
- api_classes/
|
|
46
|
+
- api_classes/dsl_host.rb
|
|
52
47
|
- api_classes/dsl_hostgroup.rb
|
|
53
|
-
- api_classes/
|
|
54
|
-
- api_classes/dsl_dservice.rb
|
|
48
|
+
- api_classes/dsl_hostinterface.rb
|
|
55
49
|
- api_classes/dsl_item.rb
|
|
50
|
+
- api_classes/dsl_mediatype.rb
|
|
56
51
|
- api_classes/dsl_proxy.rb
|
|
57
52
|
- api_classes/dsl_template.rb
|
|
58
|
-
- api_classes/
|
|
59
|
-
- api_classes/
|
|
60
|
-
- api_classes/dsl_configuration.rb
|
|
53
|
+
- api_classes/dsl_trigger.rb
|
|
54
|
+
- api_classes/dsl_user.rb
|
|
61
55
|
- api_classes/dsl_usergroup.rb
|
|
62
|
-
- api_classes/dsl_hostinterface.rb
|
|
63
56
|
- api_classes/dsl_usermacro.rb
|
|
64
|
-
- api_classes/
|
|
57
|
+
- api_classes/dsl_usermedia.rb
|
|
58
|
+
- zbxapi.rb
|
|
59
|
+
- zbxapi/api_exceptions.rb
|
|
60
|
+
- zbxapi/exceptions.rb
|
|
61
|
+
- zbxapi/result.rb
|
|
62
|
+
- zbxapi/utils.rb
|
|
63
|
+
- zbxapi/zdebug.rb
|
|
65
64
|
homepage: https://github.com/red-tux/zbxapi
|
|
66
65
|
licenses:
|
|
67
66
|
- LGPL 2.1
|
|
@@ -69,22 +68,22 @@ metadata: {}
|
|
|
69
68
|
post_install_message:
|
|
70
69
|
rdoc_options: []
|
|
71
70
|
require_paths:
|
|
72
|
-
- .
|
|
71
|
+
- "."
|
|
73
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
73
|
requirements:
|
|
75
|
-
- -
|
|
74
|
+
- - ">="
|
|
76
75
|
- !ruby/object:Gem::Version
|
|
77
76
|
version: '0'
|
|
78
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
|
-
- -
|
|
79
|
+
- - ">="
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
81
|
version: '0'
|
|
83
82
|
requirements:
|
|
84
83
|
- Requires json
|
|
85
84
|
rubyforge_project: zbxapi
|
|
86
|
-
rubygems_version: 2.
|
|
85
|
+
rubygems_version: 2.5.2
|
|
87
86
|
signing_key:
|
|
88
|
-
specification_version:
|
|
87
|
+
specification_version: 3
|
|
89
88
|
summary: Ruby wrapper to the Zabbix API
|
|
90
89
|
test_files: []
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Title:: Zabbix API Ruby Library
|
|
2
|
-
# License:: LGPL 2.1 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
|
3
|
-
# Copyright:: Copyright (C) 2009,2010 Andrew Nelson nelsonab(at)red-tux(dot)net
|
|
4
|
-
#
|
|
5
|
-
# This library is free software; you can redistribute it and/or
|
|
6
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
7
|
-
# License as published by the Free Software Foundation; either
|
|
8
|
-
# version 2.1 of the License, or (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# This library is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
-
# Lesser General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
16
|
-
# License along with this library; if not, write to the Free Software
|
|
17
|
-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18
|
-
|
|
19
|
-
require "api_classes/api_dsl"
|
|
20
|
-
|
|
21
|
-
class Maintenance < ZabbixAPI_Base
|
|
22
|
-
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
Maintenance.create
|
|
26
|
-
Maintenance.delete
|
|
27
|
-
Maintenance.exists
|
|
28
|
-
Maintenance.get
|
|
29
|
-
Maintenance.update
|
|
30
|
-
|