zabbix-rails 0.1.1 → 0.1.4

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: c08d62e412a270dbcc25ff8c0fbed71b448217dfd461c0c14290d53b75aa155d
4
- data.tar.gz: 9012f1824fee422931f7f464ccfd1bb567bc6c8f501cd7343ea406002073b4ff
3
+ metadata.gz: a69c9d81af95b28fc20c815ff323a31cf0dd1c29dd54aab6829a2224ab8c485e
4
+ data.tar.gz: 220e0328786170be774c8f835bab0ee15104fade5dd558ac840e47aed502fcd6
5
5
  SHA512:
6
- metadata.gz: 9c1f62a5f09290006d51d2211061d89201303719f87836542d4d6e1af9e4e346cdece9d88cd91dc9f99c1c9ecc42408fb5c2ce868a7ecb585a19f83f8137ba24
7
- data.tar.gz: ec142fb5c24d488157982a6a71c22475a67928a32ee1ebdc01a64682d5a9b5992c025a9b9f3945f16a3773307a146130b8735861600f2fb90bc24ec3d25b99ea
6
+ metadata.gz: e48aa2cc53f58fdec3b4dd97549a0e22b2dca70cc7806b635092dc2bd7df5697511f8cc370cf973e313c53e026da371288447cf6cccb1c9e5d13698cf20b7c20
7
+ data.tar.gz: 34519f575756027d787b1a8cd110cf4702840522e3bbfe701f5f30d8f859165d34607c9a352ab8a28f142141d03a439923ca76f750324750c60d7676e4b03073
@@ -1,7 +1,8 @@
1
+
1
2
  module Zabbix
2
- module Connector
3
- include ActiveSupport::Concern
3
+ extend ActiveSupport::Concern
4
4
 
5
+ module Connector
5
6
  # 开发测试环境需要单独开启缓存功能:bin/rails dev:cache
6
7
  # 将鉴权后的 zabbix-rails 对象缓存到 Rails,减少不必要的认证动作加速执行
7
8
  # https://guides.rubyonrails.org/caching_with_rails.html
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zabbix
4
+ extend ActiveSupport::Concern
5
+
4
6
  module DnsMonitor
5
- include ActiveSupport::Concern
7
+ include Zabbix::Connector
6
8
 
7
9
  # 生成 DNS 触发器表达式
8
10
  def dns_trigger_expression(name)
data/lib/zabbix/engine.rb CHANGED
@@ -8,4 +8,4 @@ module Zabbix
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zabbix
4
+ extend ActiveSupport::Concern
5
+
4
6
  module HostMonitor
5
- extend ActiveSupport::Concern
6
- include ZabbixConnectConcern
7
+ include Zabbix::Connector
7
8
 
8
- # 创建或更新 zabbix-rails 主机监控对象
9
+ # 创建或更新 HostMonitor主机监控对象
9
10
  def refresh_zabbix_host(item)
10
11
  if zabbix_connector.present? && (zabbix_connector.is_a? ZabbixManager)
11
12
  # 查询已关联的 hostid
@@ -41,5 +42,6 @@ module Zabbix
41
42
  rescue => e
42
43
  Rails.logger.warn("无法执行创建或更新监控主机: #{item.name} #{item.sn} #{e}")
43
44
  end
45
+
44
46
  end
45
47
  end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zabbix
4
+ extend ActiveSupport::Concern
5
+
4
6
  module ItemTrigger
5
- include ActiveSupport::Concern
7
+ include Zabbix::Connector
6
8
 
7
9
  # 创建或新增触发器,返回触发器ID | 触发器的 DATA_STRUCTURE
8
10
  def refresh_trigger(data)
@@ -1,3 +1,3 @@
1
1
  module Zabbix
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/zabbix-rails.rb CHANGED
@@ -9,7 +9,7 @@ require "zabbix/railtie"
9
9
  require "zabbix_manager"
10
10
 
11
11
  module Zabbix
12
- include ActiveSupport::Concern
12
+ extend ActiveSupport::Concern
13
13
 
14
14
  class << self
15
15
  attr_accessor :url, :user, :password, :debug
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - WENWU.YAN
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2022-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.2.3
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
- version: 7.0.2.3
26
+ version: '0'
27
27
  description: Description of Zabbix-rails.
28
28
  email:
29
29
  - careline@foxmail.com