zabbix_manager 5.0.6 → 5.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -4
- data/LICENSE.txt +1 -1
- data/README.md +48 -21
- data/lib/zabbix_manager/classes/errors.rb +7 -8
- data/lib/zabbix_manager/classes/graphs.rb +2 -2
- data/lib/zabbix_manager/classes/items.rb +43 -39
- data/lib/zabbix_manager/classes/roles.rb +2 -2
- data/lib/zabbix_manager/classes/triggers.rb +41 -27
- data/lib/zabbix_manager/classes/usermacros.rb +19 -20
- data/lib/zabbix_manager/client.rb +2 -2
- data/lib/zabbix_manager/version.rb +1 -1
- data/zabbix_manager.gemspec +43 -0
- metadata +143 -24
- data/.idea/vcs.xml +0 -6
- data/.idea/workspace.xml +0 -67
- data/.rubocop.yml +0 -13
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -10
- data/Rakefile +0 -8
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/zabbix_manager-5.0.1.gem +0 -0
- data/zabbix_manager-5.0.2.gem +0 -0
- data/zabbix_manager-5.0.3.gem +0 -0
- data/zabbix_manager-5.0.4.gem +0 -0
- data/zabbix_manager-5.0.5.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7ff849a0ec2572c10d2e6eb1a8ce94df38c6e716298fa15538d273297a3c35
|
4
|
+
data.tar.gz: 8f4e57119f3cb0ac456dbf080ac67e3714ad0b284ee987e8928ba617e3f8f22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deb4da81d4d1c569e5a6104b04247fbccee040cdd5d18b12a019386b2223452aadc6074a73c6ae51058205221b922fd1f4f2d9d8768f44e7443093d17152d265
|
7
|
+
data.tar.gz: 986ad45b15688e1913ab5861c85b5104608efbe6be1aaf3c0a9a6607c7eeb8450eeec969c37492d1f1c0345fdd8bd1097c37909cf402bc088002cba01488a77f
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,41 +1,68 @@
|
|
1
|
-
#
|
1
|
+
# Ruby Zabbix Api Module
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/zabbix_manager.svg)][gem]
|
4
4
|
|
5
|
-
|
5
|
+
[gem]: https://rubygems.org/gems/zabbix_manager
|
6
|
+
|
7
|
+
Most codes borrowed from zabbixapi, but fit for my everyday works well!
|
8
|
+
Simple and lightweight ruby module for working with [Zabbix][Zabbix] via the [Zabbix API][Zabbix API]
|
6
9
|
|
7
|
-
|
10
|
+
## Installation
|
11
|
+
```sh
|
12
|
+
# latest
|
13
|
+
gem install zabbix_manager
|
8
14
|
|
9
|
-
|
10
|
-
gem
|
15
|
+
# specific version
|
16
|
+
gem install zabbix_manager -v 4.2.0
|
11
17
|
```
|
12
18
|
|
13
|
-
|
19
|
+
## Documentation
|
20
|
+
[http://rdoc.info/gems/zabbix_manager][documentation]
|
14
21
|
|
15
|
-
|
22
|
+
[documentation]: http://rdoc.info/gems/zabbix_manager
|
16
23
|
|
17
|
-
|
24
|
+
## Examples
|
18
25
|
|
19
|
-
$ gem install zabbix_manager
|
20
26
|
|
21
|
-
##
|
27
|
+
## Supported Ruby Versions
|
28
|
+
This library aims to support and is [tested against][github-ci] the following Ruby
|
29
|
+
versions:
|
22
30
|
|
23
|
-
|
31
|
+
* Ruby 2.5
|
32
|
+
* Ruby 2.6
|
33
|
+
* Ruby 2.7
|
34
|
+
* JRuby 9.2.10.0
|
24
35
|
|
25
|
-
|
36
|
+
If something doesn't work on one of these versions, it's a bug.
|
26
37
|
|
27
|
-
|
38
|
+
This library may inadvertently work (or seem to work) on other Ruby versions,
|
39
|
+
however support will only be provided for the versions listed above.
|
28
40
|
|
29
|
-
|
41
|
+
If you would like this library to support another Ruby version or
|
42
|
+
implementation, you may volunteer to be a maintainer. Being a maintainer
|
43
|
+
entails making sure all tests run and pass on that implementation. When
|
44
|
+
something breaks on your implementation, you will be responsible for providing
|
45
|
+
patches in a timely fashion. If critical issues for a particular implementation
|
46
|
+
exist at the time of a major release, support for that Ruby version may be
|
47
|
+
dropped.
|
30
48
|
|
31
|
-
##
|
49
|
+
## Dependencies
|
50
|
+
|
51
|
+
* net/http
|
52
|
+
* json
|
32
53
|
|
33
|
-
|
54
|
+
## Contributing
|
34
55
|
|
35
|
-
|
56
|
+
* Fork the project.
|
57
|
+
* Base your work on the master branch.
|
58
|
+
* Make your feature addition or bug fix, write tests, write documentation/examples.
|
59
|
+
* Commit, do not mess with rakefile, version.
|
60
|
+
* Make a pull request.
|
36
61
|
|
37
|
-
|
62
|
+
## Zabbix documentation
|
38
63
|
|
39
|
-
|
64
|
+
* [Zabbix Project Homepage][Zabbix]
|
65
|
+
* [Zabbix API docs][Zabbix API]
|
40
66
|
|
41
|
-
|
67
|
+
[Zabbix]: https://www.zabbix.com
|
68
|
+
[Zabbix API]: https://www.zabbix.com/documentation/5.2/manual/api
|
@@ -12,14 +12,13 @@ class ZabbixManager
|
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
15
|
+
def set_error!
|
16
|
+
@error = @response["error"]
|
17
|
+
@error_message = "#{@error["message"]}: #{@error["data"]}"
|
18
|
+
rescue StandardError
|
19
|
+
@error = nil
|
20
|
+
@error_message = nil
|
21
|
+
end
|
23
22
|
end
|
24
23
|
|
25
24
|
class ManagerError < BaseError
|
@@ -53,13 +53,13 @@ class ZabbixManager
|
|
53
53
|
}
|
54
54
|
)
|
55
55
|
|
56
|
-
result.
|
56
|
+
result.filter_map do |graph|
|
57
57
|
num = graph["graphid"]
|
58
58
|
name = graph["name"]
|
59
59
|
filter = data[:filter]
|
60
60
|
|
61
61
|
num if filter.nil? || /#{filter}/ =~ name
|
62
|
-
end
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
# Get Graph Item object using Zabbix API
|
@@ -21,38 +21,38 @@ class ZabbixManager
|
|
21
21
|
# @return [Hash]
|
22
22
|
def default_options
|
23
23
|
{
|
24
|
-
name:
|
25
|
-
key_:
|
26
|
-
hostid:
|
27
|
-
delay:
|
28
|
-
history:
|
29
|
-
status:
|
30
|
-
type:
|
31
|
-
snmp_community:
|
32
|
-
snmp_oid:
|
33
|
-
value_type:
|
34
|
-
data_type:
|
35
|
-
trapper_hosts:
|
36
|
-
snmp_port:
|
37
|
-
units:
|
38
|
-
multiplier:
|
39
|
-
delta:
|
40
|
-
snmpv3_securityname:
|
41
|
-
snmpv3_securitylevel:
|
24
|
+
name: nil,
|
25
|
+
key_: nil,
|
26
|
+
hostid: nil,
|
27
|
+
delay: 60,
|
28
|
+
history: 3600,
|
29
|
+
status: 0,
|
30
|
+
type: 7,
|
31
|
+
snmp_community: "",
|
32
|
+
snmp_oid: "",
|
33
|
+
value_type: 3,
|
34
|
+
data_type: 0,
|
35
|
+
trapper_hosts: "localhost",
|
36
|
+
snmp_port: 161,
|
37
|
+
units: "",
|
38
|
+
multiplier: 0,
|
39
|
+
delta: 0,
|
40
|
+
snmpv3_securityname: "",
|
41
|
+
snmpv3_securitylevel: 0,
|
42
42
|
snmpv3_authpassphrase: "",
|
43
43
|
snmpv3_privpassphrase: "",
|
44
|
-
formula:
|
45
|
-
trends:
|
46
|
-
logtimefmt:
|
47
|
-
valuemapid:
|
48
|
-
delay_flex:
|
49
|
-
authtype:
|
50
|
-
username:
|
51
|
-
password:
|
52
|
-
publickey:
|
53
|
-
privatekey:
|
54
|
-
params:
|
55
|
-
ipmi_sensor:
|
44
|
+
formula: 0,
|
45
|
+
trends: 86_400,
|
46
|
+
logtimefmt: "",
|
47
|
+
valuemapid: 0,
|
48
|
+
delay_flex: "",
|
49
|
+
authtype: 0,
|
50
|
+
username: "",
|
51
|
+
password: "",
|
52
|
+
publickey: "",
|
53
|
+
privatekey: "",
|
54
|
+
params: "",
|
55
|
+
ipmi_sensor: ""
|
56
56
|
}
|
57
57
|
end
|
58
58
|
|
@@ -93,13 +93,17 @@ class ZabbixManager
|
|
93
93
|
method: "item.get",
|
94
94
|
params: {
|
95
95
|
# output: ["itemid", "name", "snmp_oid", "key_", "triggerids"],
|
96
|
-
output:
|
96
|
+
output: "extend",
|
97
97
|
hostids: hostid,
|
98
|
-
search:
|
98
|
+
search: {
|
99
99
|
name: iface
|
100
100
|
}
|
101
101
|
}
|
102
|
-
).select {
|
102
|
+
).select {
|
103
|
+
|item| item["snmp_oid"].match?(/(1.3.6.1.2.1.31.1.1.1.(6|10|15)|1.3.6.1.2.1.2.2.1.8)./)
|
104
|
+
}.sort_by {
|
105
|
+
|item| item["key_"]
|
106
|
+
}
|
103
107
|
|
104
108
|
# 检查是是否存在
|
105
109
|
result.empty? ? nil : result
|
@@ -116,17 +120,17 @@ class ZabbixManager
|
|
116
120
|
method: "item.create",
|
117
121
|
params: {
|
118
122
|
hostid: hostid,
|
119
|
-
name:
|
120
|
-
key_:
|
123
|
+
name: item_name,
|
124
|
+
key_: item_key_,
|
121
125
|
# 代表 zabbix_agent
|
122
126
|
type: 0,
|
123
127
|
# 代表字符串
|
124
128
|
value_type: 1,
|
125
129
|
# 固定参数
|
126
|
-
delay:
|
127
|
-
history:
|
130
|
+
delay: "1m",
|
131
|
+
history: "90d",
|
128
132
|
lifetime: "30d",
|
129
|
-
timeout:
|
133
|
+
timeout: "3s"
|
130
134
|
}
|
131
135
|
)
|
132
136
|
p "成功创建 dns监控 #{dns_name}"
|
@@ -139,7 +143,7 @@ class ZabbixManager
|
|
139
143
|
result = @client.api_request(
|
140
144
|
method: "item.get",
|
141
145
|
params: {
|
142
|
-
output:
|
146
|
+
output: "extend",
|
143
147
|
hostids: "16914"
|
144
148
|
}
|
145
149
|
)
|
@@ -28,11 +28,11 @@ class ZabbixManager
|
|
28
28
|
@client.api_request(
|
29
29
|
method: "trigger.get",
|
30
30
|
params: {
|
31
|
-
filter:
|
31
|
+
filter: {
|
32
32
|
keys.to_sym => data[keys.to_sym]
|
33
33
|
},
|
34
|
-
output:
|
35
|
-
select_items:
|
34
|
+
output: "extend",
|
35
|
+
select_items: "extend",
|
36
36
|
select_functions: "extend"
|
37
37
|
}
|
38
38
|
)
|
@@ -72,8 +72,8 @@ class ZabbixManager
|
|
72
72
|
# disable old trigger
|
73
73
|
log "[DEBUG] disable :" + @client.api_request(method: "#{method_name}.update",
|
74
74
|
params: [{
|
75
|
-
|
76
|
-
|
75
|
+
triggerid: data[:triggerid], status: "1"
|
76
|
+
}]).inspect
|
77
77
|
# create new trigger
|
78
78
|
data.delete(:triggerid)
|
79
79
|
create(data)
|
@@ -110,11 +110,11 @@ class ZabbixManager
|
|
110
110
|
# 测试数据
|
111
111
|
def mojo_data
|
112
112
|
data = {
|
113
|
-
comments:
|
114
|
-
opdata:
|
115
|
-
priority:
|
116
|
-
description:
|
117
|
-
expression:
|
113
|
+
comments: "MOJO1",
|
114
|
+
opdata: "MOJO_OPDATA",
|
115
|
+
priority: 1,
|
116
|
+
description: "MOJO1",
|
117
|
+
expression: "{SZX1-ISP-SW7:net.if.in[ifHCInOctets.1].avg(15m)}>=450000000 or {SZX1-ISP-SW7:net.if.out[ifHCOutOctets.1].avg(15m)}>=450000000",
|
118
118
|
recovery_expression: "{SZX1-ISP-SW7:net.if.in[ifHCInOctets.1].avg(15m)}<=350000000 or {SZX1-ISP-SW7:net.if.out[ifHCOutOctets.1].avg(15m)}<=350000000"
|
119
119
|
}
|
120
120
|
|
@@ -128,15 +128,15 @@ class ZabbixManager
|
|
128
128
|
result = @client.api_request(
|
129
129
|
method: "trigger.create",
|
130
130
|
params: {
|
131
|
-
comments:
|
132
|
-
priority:
|
133
|
-
description:
|
134
|
-
expression:
|
131
|
+
comments: data["comments"],
|
132
|
+
priority: data["priority"],
|
133
|
+
description: data["description"],
|
134
|
+
expression: data["expression"],
|
135
135
|
recovery_expression: data["recovery_expression"],
|
136
|
-
opdata:
|
137
|
-
recovery_mode:
|
138
|
-
type:
|
139
|
-
manual_close:
|
136
|
+
opdata: data["opdata"],
|
137
|
+
recovery_mode: 1,
|
138
|
+
type: 0,
|
139
|
+
manual_close: 1
|
140
140
|
}
|
141
141
|
)
|
142
142
|
# 检查是是否存在
|
@@ -150,21 +150,35 @@ class ZabbixManager
|
|
150
150
|
result = @client.api_request(
|
151
151
|
method: "trigger.update",
|
152
152
|
params: {
|
153
|
-
triggerid:
|
154
|
-
comments:
|
155
|
-
priority:
|
156
|
-
description:
|
157
|
-
expression:
|
153
|
+
triggerid: triggerid,
|
154
|
+
comments: data["comments"],
|
155
|
+
priority: data["priority"],
|
156
|
+
description: data["description"],
|
157
|
+
expression: data["expression"],
|
158
158
|
recovery_expression: data["recovery_expression"],
|
159
|
-
opdata:
|
160
|
-
recovery_mode:
|
161
|
-
type:
|
162
|
-
manual_close:
|
159
|
+
opdata: data["opdata"],
|
160
|
+
recovery_mode: 1,
|
161
|
+
type: 0,
|
162
|
+
manual_close: 1
|
163
163
|
}
|
164
164
|
)
|
165
165
|
# ap result
|
166
166
|
# 检查是是否存在
|
167
167
|
result.empty? ? nil : result["triggerids"]
|
168
168
|
end
|
169
|
+
|
170
|
+
# 添加触发器依赖项
|
171
|
+
def add_trigger_dependency(triggerid, depend_on_trigger_id)
|
172
|
+
log "[DEBUG] Call add_trigger_dependency with parameters: #{triggerid} #{depend_on_trigger_id}"
|
173
|
+
# 请求生成触发器
|
174
|
+
result = @client.api_request(
|
175
|
+
method: "trigger.adddependencies",
|
176
|
+
params: {
|
177
|
+
triggerid: triggerid,
|
178
|
+
dependsOnTriggerid: depend_on_trigger_id
|
179
|
+
}
|
180
|
+
)
|
181
|
+
result.empty? ? nil : result["triggerids"]
|
182
|
+
end
|
169
183
|
end
|
170
184
|
end
|
@@ -203,28 +203,27 @@ class ZabbixManager
|
|
203
203
|
end
|
204
204
|
|
205
205
|
private
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
206
|
+
# Custom request method to handle both User and Global macros in one
|
207
|
+
#
|
208
|
+
# @param data [Hash] Needs to include macro and hostid to properly identify Global macros via Zabbix API
|
209
|
+
# @param method [String] Zabbix API method to use for the request
|
210
|
+
# @param result_key [String] Which key to use for parsing results based on User vs Global macros
|
211
|
+
# @raise [ManagerError] Error returned when there is a problem with the Zabbix API call.
|
212
|
+
# @raise [HttpError] Error raised when HTTP status from Zabbix Server response is not a 200 OK.
|
213
|
+
# @return [Integer] Zabbix object id
|
214
|
+
def request(data, method, result_key)
|
215
|
+
# Zabbix has different result formats for gets vs updates
|
216
|
+
if method.include?(".get")
|
217
|
+
if result_key.include?("global")
|
218
|
+
@client.api_request(method: method, params: { globalmacro: true, filter: data })
|
219
|
+
else
|
220
|
+
@client.api_request(method: method, params: { filter: data })
|
221
|
+
end
|
220
222
|
else
|
221
|
-
@client.api_request(method: method, params:
|
222
|
-
end
|
223
|
-
else
|
224
|
-
result = @client.api_request(method: method, params: data)
|
223
|
+
result = @client.api_request(method: method, params: data)
|
225
224
|
|
226
|
-
|
225
|
+
result.key?(result_key) && !result[result_key].empty? ? result[result_key][0].to_i : nil
|
226
|
+
end
|
227
227
|
end
|
228
|
-
end
|
229
228
|
end
|
230
229
|
end
|
@@ -45,7 +45,7 @@ class ZabbixManager
|
|
45
45
|
# Initializes a new Client object
|
46
46
|
#
|
47
47
|
# @param options [Hash]
|
48
|
-
# @option opts [String] :url The url of
|
48
|
+
# @option opts [String] :url The url of zabbix_manager(example: 'http://localhost/zabbix/api_jsonrpc.php')
|
49
49
|
# @option opts [String] :user
|
50
50
|
# @option opts [String] :password
|
51
51
|
# @option opts [String] :http_user A user for basic auth.(optional)
|
@@ -63,7 +63,7 @@ class ZabbixManager
|
|
63
63
|
end
|
64
64
|
|
65
65
|
if api_version.match?(/^7\.\d+\.\d+$/)
|
66
|
-
message = "Zabbix API version: #{api_version} is not supported by this version of
|
66
|
+
message = "Zabbix API version: #{api_version} is not supported by this version of zabbix_manager"
|
67
67
|
if @options[:ignore_version]
|
68
68
|
puts "[WARNING] #{message}" if @options[:debug]
|
69
69
|
else
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path("../lib", __FILE__)
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
|
8
|
+
require "zabbix_manager/version"
|
9
|
+
|
10
|
+
Gem::Specification.new do |spec|
|
11
|
+
spec.add_dependency "http", "~> 4.0"
|
12
|
+
spec.add_dependency "json", "~> 2.0"
|
13
|
+
spec.add_development_dependency "bundler", "~> 2.3", ">= 2.3.9"
|
14
|
+
|
15
|
+
spec.add_development_dependency "rspec", "~> 3.11"
|
16
|
+
spec.add_development_dependency "yard", "~> 0.9.27"
|
17
|
+
spec.add_development_dependency "yardstick", "~> 0.9.9"
|
18
|
+
spec.add_development_dependency "rubocop", "~> 1.25", ">= 1.25.1"
|
19
|
+
spec.add_development_dependency "rubocop-minitest", "~> 0.18.0"
|
20
|
+
spec.add_development_dependency "rubocop-performance", "~> 1.13"
|
21
|
+
spec.add_development_dependency "rubocop-rails", "~> 2.13", ">= 2.13.2"
|
22
|
+
spec.add_development_dependency "rubocop-packaging", "~> 0.5.1"
|
23
|
+
|
24
|
+
spec.name = "zabbix_manager"
|
25
|
+
spec.version = ZabbixManager::VERSION
|
26
|
+
spec.authors = ["WENWU YAN"]
|
27
|
+
spec.email = ["careline@foxmail.com"]
|
28
|
+
|
29
|
+
spec.summary = "Simple and lightweight ruby module for working with the Zabbix API, support 4.0 5.0 6.0"
|
30
|
+
spec.description = "Most codes borrowed from ZabbixApi, But changed some logic for everyday jobs."
|
31
|
+
spec.homepage = "https://github.com/snmpd/zabbix_manager"
|
32
|
+
spec.licenses = "MIT"
|
33
|
+
|
34
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
35
|
+
|
36
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
37
|
+
spec.metadata["source_code_uri"] = "https://github.com/snmpd/zabbix_manager"
|
38
|
+
spec.metadata["changelog_uri"] = "https://github.com/snmpd/zabbix_manager"
|
39
|
+
|
40
|
+
spec.files = %w[CHANGELOG.md LICENSE.txt README.md zabbix_manager.gemspec] + Dir["lib/**/*.rb"]
|
41
|
+
spec.require_paths = "lib"
|
42
|
+
spec.required_ruby_version = ">= 2.7.0"
|
43
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbix_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WENWU YAN
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.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
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,35 +42,157 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.3'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 2.3.9
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '2.3'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 2.3.9
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.11'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.11'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: yard
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.9.27
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.9.27
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: yardstick
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.9.9
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.9.9
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rubocop
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.25'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.25.1
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '1.25'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.25.1
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rubocop-minitest
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 0.18.0
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 0.18.0
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rubocop-performance
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '1.13'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '1.13'
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
name: rubocop-rails
|
153
|
+
requirement: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - "~>"
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '2.13'
|
45
158
|
- - ">="
|
46
159
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
160
|
+
version: 2.13.2
|
48
161
|
type: :development
|
49
162
|
prerelease: false
|
50
163
|
version_requirements: !ruby/object:Gem::Requirement
|
51
164
|
requirements:
|
165
|
+
- - "~>"
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '2.13'
|
52
168
|
- - ">="
|
53
169
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
|
56
|
-
|
170
|
+
version: 2.13.2
|
171
|
+
- !ruby/object:Gem::Dependency
|
172
|
+
name: rubocop-packaging
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - "~>"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 0.5.1
|
178
|
+
type: :development
|
179
|
+
prerelease: false
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - "~>"
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: 0.5.1
|
185
|
+
description: Most codes borrowed from ZabbixApi, But changed some logic for everyday
|
186
|
+
jobs.
|
57
187
|
email:
|
58
188
|
- careline@foxmail.com
|
59
189
|
executables: []
|
60
190
|
extensions: []
|
61
191
|
extra_rdoc_files: []
|
62
192
|
files:
|
63
|
-
- ".idea/vcs.xml"
|
64
|
-
- ".idea/workspace.xml"
|
65
|
-
- ".rubocop.yml"
|
66
193
|
- CHANGELOG.md
|
67
|
-
- CODE_OF_CONDUCT.md
|
68
|
-
- Gemfile
|
69
194
|
- LICENSE.txt
|
70
195
|
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- bin/console
|
73
|
-
- bin/setup
|
74
196
|
- lib/zabbix_manager.rb
|
75
197
|
- lib/zabbix_manager/basic/basic_alias.rb
|
76
198
|
- lib/zabbix_manager/basic/basic_extend.rb
|
@@ -105,11 +227,7 @@ files:
|
|
105
227
|
- lib/zabbix_manager/classes/valuemaps.rb
|
106
228
|
- lib/zabbix_manager/client.rb
|
107
229
|
- lib/zabbix_manager/version.rb
|
108
|
-
- zabbix_manager
|
109
|
-
- zabbix_manager-5.0.2.gem
|
110
|
-
- zabbix_manager-5.0.3.gem
|
111
|
-
- zabbix_manager-5.0.4.gem
|
112
|
-
- zabbix_manager-5.0.5.gem
|
230
|
+
- zabbix_manager.gemspec
|
113
231
|
homepage: https://github.com/snmpd/zabbix_manager
|
114
232
|
licenses:
|
115
233
|
- MIT
|
@@ -126,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
244
|
requirements:
|
127
245
|
- - ">="
|
128
246
|
- !ruby/object:Gem::Version
|
129
|
-
version: 2.
|
247
|
+
version: 2.7.0
|
130
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
249
|
requirements:
|
132
250
|
- - ">="
|
@@ -136,5 +254,6 @@ requirements: []
|
|
136
254
|
rubygems_version: 3.3.3
|
137
255
|
signing_key:
|
138
256
|
specification_version: 4
|
139
|
-
summary:
|
257
|
+
summary: Simple and lightweight ruby module for working with the Zabbix API, support
|
258
|
+
4.0 5.0 6.0
|
140
259
|
test_files: []
|
data/.idea/vcs.xml
DELETED
data/.idea/workspace.xml
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="AutoImportSettings">
|
4
|
-
<option name="autoReloadType" value="SELECTIVE" />
|
5
|
-
</component>
|
6
|
-
<component name="ChangeListManager">
|
7
|
-
<list default="true" id="9f25f96c-828f-4aea-8886-dcbae369ba60" name="变更" comment="" />
|
8
|
-
<option name="SHOW_DIALOG" value="false" />
|
9
|
-
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
10
|
-
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
11
|
-
<option name="LAST_RESOLUTION" value="IGNORE" />
|
12
|
-
</component>
|
13
|
-
<component name="Git.Settings">
|
14
|
-
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
15
|
-
</component>
|
16
|
-
<component name="JsBowerSettings">
|
17
|
-
<bower-package value="" />
|
18
|
-
<bower.json value="" />
|
19
|
-
</component>
|
20
|
-
<component name="ProjectId" id="265x23SpJKPxcHuoXgA68nnhQDg" />
|
21
|
-
<component name="ProjectViewState">
|
22
|
-
<option name="hideEmptyMiddlePackages" value="true" />
|
23
|
-
<option name="showLibraryContents" value="true" />
|
24
|
-
</component>
|
25
|
-
<component name="PropertiesComponent">
|
26
|
-
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
27
|
-
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
28
|
-
<property name="WebServerToolWindowFactoryState" value="false" />
|
29
|
-
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
30
|
-
<property name="node.js.detected.package.eslint" value="true" />
|
31
|
-
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
32
|
-
<property name="node.js.selected.package.tslint" value="(autodetect)" />
|
33
|
-
<property name="nodejs_interpreter_path" value="node" />
|
34
|
-
<property name="nodejs_package_manager_path" value="yarn" />
|
35
|
-
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
|
36
|
-
<property name="vue.rearranger.settings.migration" value="true" />
|
37
|
-
</component>
|
38
|
-
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
39
|
-
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
40
|
-
<component name="TaskManager">
|
41
|
-
<task active="true" id="Default" summary="默认任务">
|
42
|
-
<changelist id="9f25f96c-828f-4aea-8886-dcbae369ba60" name="变更" comment="" />
|
43
|
-
<created>1646727041577</created>
|
44
|
-
<option name="number" value="Default" />
|
45
|
-
<option name="presentableId" value="Default" />
|
46
|
-
<updated>1646727041577</updated>
|
47
|
-
<workItem from="1646727043249" duration="3509000" />
|
48
|
-
<workItem from="1646732978147" duration="8000" />
|
49
|
-
<workItem from="1646734414024" duration="13000" />
|
50
|
-
</task>
|
51
|
-
<servers />
|
52
|
-
</component>
|
53
|
-
<component name="TypeScriptGeneratedFilesManager">
|
54
|
-
<option name="version" value="3" />
|
55
|
-
</component>
|
56
|
-
<component name="Vcs.Log.Tabs.Properties">
|
57
|
-
<option name="TAB_STATES">
|
58
|
-
<map>
|
59
|
-
<entry key="MAIN">
|
60
|
-
<value>
|
61
|
-
<State />
|
62
|
-
</value>
|
63
|
-
</entry>
|
64
|
-
</map>
|
65
|
-
</option>
|
66
|
-
</component>
|
67
|
-
</project>
|
data/.rubocop.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
-
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
-
|
9
|
-
## Our Standards
|
10
|
-
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
-
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
-
|
19
|
-
Examples of unacceptable behavior include:
|
20
|
-
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
22
|
-
advances of any kind
|
23
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
-
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or email
|
26
|
-
address, without their explicit permission
|
27
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
-
professional setting
|
29
|
-
|
30
|
-
## Enforcement Responsibilities
|
31
|
-
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
-
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
-
|
36
|
-
## Scope
|
37
|
-
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
-
|
40
|
-
## Enforcement
|
41
|
-
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
-
|
44
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
-
|
46
|
-
## Enforcement Guidelines
|
47
|
-
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
-
|
50
|
-
### 1. Correction
|
51
|
-
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
-
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
-
|
56
|
-
### 2. Warning
|
57
|
-
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
-
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
-
|
62
|
-
### 3. Temporary Ban
|
63
|
-
|
64
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
-
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
-
|
68
|
-
### 4. Permanent Ban
|
69
|
-
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
-
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
-
|
74
|
-
## Attribution
|
75
|
-
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
-
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
-
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
82
|
-
|
83
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "zabbix_manager"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/zabbix_manager-5.0.1.gem
DELETED
Binary file
|
data/zabbix_manager-5.0.2.gem
DELETED
Binary file
|
data/zabbix_manager-5.0.3.gem
DELETED
Binary file
|
data/zabbix_manager-5.0.4.gem
DELETED
Binary file
|
data/zabbix_manager-5.0.5.gem
DELETED
Binary file
|