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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eba65965b358ec8595a777c899aa54dc1835945d17ad4d42687a22ce25d620f
4
- data.tar.gz: 68b13154bce3b7b7f1fcb568dc5e5472fd1b196f19d1a244fb25230e79f4a9ad
3
+ metadata.gz: af7ff849a0ec2572c10d2e6eb1a8ce94df38c6e716298fa15538d273297a3c35
4
+ data.tar.gz: 8f4e57119f3cb0ac456dbf080ac67e3714ad0b284ee987e8928ba617e3f8f22d
5
5
  SHA512:
6
- metadata.gz: f0f0ea55235d315c9ce971e26047866a1c2a57b78a88520e98cfb2e051a75aa888a98dcc12d7e36f7fcfbad947270d99cf33192aceb3287bdb098ced135c021c
7
- data.tar.gz: 948831dfc8a7f1013b4835829c171e50376b185b965ba599990c9fe574a73a2d15c982badea135a58b9ed0b31701898c65b2a990f9ba923b1ca690ca68f5442a
6
+ metadata.gz: deb4da81d4d1c569e5a6104b04247fbccee040cdd5d18b12a019386b2223452aadc6074a73c6ae51058205221b922fd1f4f2d9d8768f44e7443093d17152d265
7
+ data.tar.gz: 986ad45b15688e1913ab5861c85b5104608efbe6be1aaf3c0a9a6607c7eeb8450eeec969c37492d1f1c0345fdd8bd1097c37909cf402bc088002cba01488a77f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,3 @@
1
- ## [Unreleased]
1
+ #CHANGELOG
2
2
 
3
- ## [0.1.0] - 2021-12-17
4
-
5
- - Initial release
3
+ ### 5.0.7
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 TODO: Write your name
3
+ Copyright (c) 2022 TODO: WENWU.YAN
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,41 +1,68 @@
1
- # ZabbixManager
1
+ # Ruby Zabbix Api Module
2
2
 
3
- most codes are borrowed from zabbixapi, but changed some logic to fit everyday job wells. now support ZABBIX 4.0, 5.0, 6.0
3
+ [![Gem Version](http://img.shields.io/gem/v/zabbix_manager.svg)][gem]
4
4
 
5
- ## Installation
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
- Add this line to your application's Gemfile:
10
+ ## Installation
11
+ ```sh
12
+ # latest
13
+ gem install zabbix_manager
8
14
 
9
- ```ruby
10
- gem 'zabbix_manager'
15
+ # specific version
16
+ gem install zabbix_manager -v 4.2.0
11
17
  ```
12
18
 
13
- And then execute:
19
+ ## Documentation
20
+ [http://rdoc.info/gems/zabbix_manager][documentation]
14
21
 
15
- $ bundle install
22
+ [documentation]: http://rdoc.info/gems/zabbix_manager
16
23
 
17
- Or install it yourself as:
24
+ ## Examples
18
25
 
19
- $ gem install zabbix_manager
20
26
 
21
- ## Usage
27
+ ## Supported Ruby Versions
28
+ This library aims to support and is [tested against][github-ci] the following Ruby
29
+ versions:
22
30
 
23
- TODO: Write usage instructions here
31
+ * Ruby 2.5
32
+ * Ruby 2.6
33
+ * Ruby 2.7
34
+ * JRuby 9.2.10.0
24
35
 
25
- ## Development
36
+ If something doesn't work on one of these versions, it's a bug.
26
37
 
27
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
- ## Contributing
49
+ ## Dependencies
50
+
51
+ * net/http
52
+ * json
32
53
 
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/zabbix_manager. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/zabbix_manager/blob/master/CODE_OF_CONDUCT.md).
54
+ ## Contributing
34
55
 
35
- ## License
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
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
62
+ ## Zabbix documentation
38
63
 
39
- ## Code of Conduct
64
+ * [Zabbix Project Homepage][Zabbix]
65
+ * [Zabbix API docs][Zabbix API]
40
66
 
41
- Everyone interacting in the ZabbixManager project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ciscolive/zabbix_manager/blob/master/CODE_OF_CONDUCT.md).
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
- def set_error!
17
- @error = @response["error"]
18
- @error_message = "#{@error["message"]}: #{@error["data"]}"
19
- rescue StandardError
20
- @error = nil
21
- @error_message = nil
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.map do |graph|
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.compact
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: 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,
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: 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: ""
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: "extend",
96
+ output: "extend",
97
97
  hostids: hostid,
98
- search: {
98
+ search: {
99
99
  name: iface
100
100
  }
101
101
  }
102
- ).select { |item| item["snmp_oid"].match?(/1.3.6.1.2.1.31.1.1.1.(6|10)./) }
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: item_name,
120
- key_: item_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: "1m",
127
- history: "90d",
130
+ delay: "1m",
131
+ history: "90d",
128
132
  lifetime: "30d",
129
- timeout: "3s"
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: "extend",
146
+ output: "extend",
143
147
  hostids: "16914"
144
148
  }
145
149
  )
@@ -88,9 +88,9 @@ class ZabbixManager
88
88
  }
89
89
  )
90
90
 
91
- result.map do |rule|
91
+ result.filter_map do |rule|
92
92
  rule["roleid"]
93
- end.compact
93
+ end
94
94
  end
95
95
 
96
96
  # Update users in Userroles using Zabbix API
@@ -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: "extend",
35
- select_items: "extend",
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
- triggerid: data[:triggerid], status: "1"
76
- }]).inspect
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: "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",
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: data["comments"],
132
- priority: data["priority"],
133
- description: data["description"],
134
- expression: data["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: data["opdata"],
137
- recovery_mode: 1,
138
- type: 0,
139
- manual_close: 1
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: triggerid.to_i,
154
- comments: data["comments"],
155
- priority: data["priority"],
156
- description: data["description"],
157
- expression: data["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: data["opdata"],
160
- recovery_mode: 1,
161
- type: 1,
162
- manual_close: 1
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
- # Custom request method to handle both User and Global macros in one
208
- #
209
- # @param data [Hash] Needs to include macro and hostid to properly identify Global macros via Zabbix API
210
- # @param method [String] Zabbix API method to use for the request
211
- # @param result_key [String] Which key to use for parsing results based on User vs Global macros
212
- # @raise [ManagerError] Error returned when there is a problem with the Zabbix API call.
213
- # @raise [HttpError] Error raised when HTTP status from Zabbix Server response is not a 200 OK.
214
- # @return [Integer] Zabbix object id
215
- def request(data, method, result_key)
216
- # Zabbix has different result formats for gets vs updates
217
- if method.include?(".get")
218
- if result_key.include?("global")
219
- @client.api_request(method: method, params: { globalmacro: true, filter: data })
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: { filter: data })
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
- result.key?(result_key) && !result[result_key].empty? ? result[result_key][0].to_i : nil
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 zabbixapi(example: 'http://localhost/zabbix/api_jsonrpc.php')
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 zabbixapi"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ZabbixManager
4
- VERSION = "5.0.6"
4
+ VERSION = "5.0.9"
5
5
  end
@@ -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.6
4
+ version: 5.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - WENWU YAN
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
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: '0'
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: '0'
55
- description: most codes are borrowed from zabbixapi, but changed some logic to fit
56
- everyday job wells. now support ZABBIX 4.0, 5.0, 6.0
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-5.0.1.gem
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.4.0
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: ZABBIX API connector for VERSION 4.0 5.0 6.0
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
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
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
@@ -1,13 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.7
3
-
4
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
7
-
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120
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
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in zabbix_manager.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rubocop", "~> 1.7"
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rubocop/rake_task"
5
-
6
- RuboCop::RakeTask.new
7
-
8
- task default: :rubocop
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
Binary file
Binary file
Binary file
Binary file
Binary file