Class: ZabbixManager
- Inherits:
-
Object
- Object
- ZabbixManager
- Defined in:
- lib/zabbix_manager.rb,
lib/zabbix_manager/client.rb,
lib/zabbix_manager/version.rb,
lib/zabbix_manager/classes/hosts.rb,
lib/zabbix_manager/classes/items.rb,
lib/zabbix_manager/classes/roles.rb,
lib/zabbix_manager/classes/users.rb,
lib/zabbix_manager/classes/drules.rb,
lib/zabbix_manager/classes/errors.rb,
lib/zabbix_manager/classes/events.rb,
lib/zabbix_manager/classes/graphs.rb,
lib/zabbix_manager/classes/server.rb,
lib/zabbix_manager/classes/actions.rb,
lib/zabbix_manager/classes/proxies.rb,
lib/zabbix_manager/classes/screens.rb,
lib/zabbix_manager/classes/scripts.rb,
lib/zabbix_manager/basic/basic_func.rb,
lib/zabbix_manager/basic/basic_init.rb,
lib/zabbix_manager/classes/problems.rb,
lib/zabbix_manager/classes/triggers.rb,
lib/zabbix_manager/classes/unusable.rb,
lib/zabbix_manager/basic/basic_alias.rb,
lib/zabbix_manager/basic/basic_logic.rb,
lib/zabbix_manager/classes/httptests.rb,
lib/zabbix_manager/classes/templates.rb,
lib/zabbix_manager/classes/valuemaps.rb,
lib/zabbix_manager/classes/hostgroups.rb,
lib/zabbix_manager/classes/mediatypes.rb,
lib/zabbix_manager/classes/usergroups.rb,
lib/zabbix_manager/classes/usermacros.rb,
lib/zabbix_manager/classes/maintenance.rb,
lib/zabbix_manager/classes/applications.rb,
lib/zabbix_manager/classes/configurations.rb,
lib/zabbix_manager/classes/hostinterfaces.rb
Defined Under Namespace
Classes: Actions, Applications, BaseError, Basic, Client, Configurations, Drules, Events, Graphs, HostGroups, HostInterfaces, Hosts, HttpError, HttpTests, Items, Maintenance, Mediatypes, Problems, Proxies, Roles, Screens, Scripts, Server, Templates, Triggers, Usergroups, Usermacros, Users, ValueMaps, ZbxError
Constant Summary collapse
- VERSION =
"5.1.5"
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
-
.connect(options = {}) ⇒ Object
初始化一个新的 ZabbixManager 对象.
-
.current ⇒ Object
获取当前 ZabbixManager 对象.
Instance Method Summary collapse
-
#actions ⇒ Object
返回 ZabbixManager::Actions 对象.
-
#applications ⇒ Object
返回 ZabbixManager::Applications 对象.
-
#configurations ⇒ Object
返回 ZabbixManager::Configurations 对象.
-
#drules ⇒ Object
返回 ZabbixManager::Drules 对象.
-
#events ⇒ Object
返回 ZabbixManager::Events 对象.
-
#graphs ⇒ Object
返回 ZabbixManager::Graphs 对象.
-
#hostgroups ⇒ Object
返回 ZabbixManager::HostGroups 对象.
-
#hostinterfaces ⇒ Object
返回 ZabbixManager::HostInterfaces 对象.
-
#hosts ⇒ Object
返回 ZabbixManager::Hosts 对象.
-
#httptests ⇒ Object
返回 ZabbixManager::HttpTests 对象.
-
#initialize(options = {}) ⇒ ZabbixManager
constructor
初始化一个新的 ZabbixManager 对象.
-
#items ⇒ Object
返回 ZabbixManager::Items 对象.
-
#logout ⇒ Object
注销当前身份验证令牌.
-
#maintenance ⇒ Object
返回 ZabbixManager::Maintenance 对象.
-
#mediatypes ⇒ Object
返回 ZabbixManager::Mediatypes 对象.
-
#problems ⇒ Object
返回 ZabbixManager::Problems 对象.
-
#proxies ⇒ Object
返回 ZabbixManager::Proxies 对象.
-
#query(data) ⇒ Object
直接使用自定义查询执行 API 请求.
-
#roles ⇒ Object
返回 ZabbixManager::Roles 对象.
-
#screens ⇒ Object
返回 ZabbixManager::Screens 对象.
-
#scripts ⇒ Object
返回 ZabbixManager::Scripts 对象.
-
#server ⇒ Object
返回 ZabbixManager::Server 对象.
-
#templates ⇒ Object
返回 ZabbixManager::Templates 对象.
-
#triggers ⇒ Object
返回 ZabbixManager::Triggers 对象.
-
#usergroups ⇒ Object
返回 ZabbixManager::Usergroups 对象.
-
#usermacros ⇒ Object
返回 ZabbixManager::Usermacros 对象.
-
#users ⇒ Object
返回 ZabbixManager::Users 对象.
-
#valuemaps ⇒ Object
返回 ZabbixManager::ValueMaps 对象.
Constructor Details
#initialize(options = {}) ⇒ ZabbixManager
初始化一个新的 ZabbixManager 对象
40 41 42 |
# File 'lib/zabbix_manager.rb', line 40 def initialize( = {}) @client = Client.new() end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
17 18 19 |
# File 'lib/zabbix_manager.rb', line 17 def client @client end |
Class Method Details
.connect(options = {}) ⇒ Object
初始化一个新的 ZabbixManager 对象
20 21 22 |
# File 'lib/zabbix_manager.rb', line 20 def self.connect( = {}) new() end |
.current ⇒ Object
获取当前 ZabbixManager 对象
25 26 27 |
# File 'lib/zabbix_manager.rb', line 25 def self.current @current ||= new end |
Instance Method Details
#actions ⇒ Object
返回 ZabbixManager::Actions 对象
45 46 47 |
# File 'lib/zabbix_manager.rb', line 45 def actions @actions ||= Actions.new(@client) end |
#applications ⇒ Object
返回 ZabbixManager::Applications 对象
50 51 52 |
# File 'lib/zabbix_manager.rb', line 50 def applications @applications ||= Applications.new(@client) end |
#configurations ⇒ Object
返回 ZabbixManager::Configurations 对象
55 56 57 |
# File 'lib/zabbix_manager.rb', line 55 def configurations @configurations ||= Configurations.new(@client) end |
#drules ⇒ Object
返回 ZabbixManager::Drules 对象
165 166 167 |
# File 'lib/zabbix_manager.rb', line 165 def drules @drules ||= Drules.new(@client) end |
#events ⇒ Object
返回 ZabbixManager::Events 对象
60 61 62 |
# File 'lib/zabbix_manager.rb', line 60 def events @events ||= Events.new(@client) end |
#graphs ⇒ Object
返回 ZabbixManager::Graphs 对象
65 66 67 |
# File 'lib/zabbix_manager.rb', line 65 def graphs @graphs ||= Graphs.new(@client) end |
#hostgroups ⇒ Object
返回 ZabbixManager::HostGroups 对象
70 71 72 |
# File 'lib/zabbix_manager.rb', line 70 def hostgroups @hostgroups ||= HostGroups.new(@client) end |
#hostinterfaces ⇒ Object
返回 ZabbixManager::HostInterfaces 对象
75 76 77 |
# File 'lib/zabbix_manager.rb', line 75 def hostinterfaces @hostinterfaces ||= HostInterfaces.new(@client) end |
#hosts ⇒ Object
返回 ZabbixManager::Hosts 对象
80 81 82 |
# File 'lib/zabbix_manager.rb', line 80 def hosts @hosts ||= Hosts.new(@client) end |
#httptests ⇒ Object
返回 ZabbixManager::HttpTests 对象
85 86 87 |
# File 'lib/zabbix_manager.rb', line 85 def httptests @httptests ||= HttpTests.new(@client) end |
#items ⇒ Object
返回 ZabbixManager::Items 对象
90 91 92 |
# File 'lib/zabbix_manager.rb', line 90 def items @items ||= Items.new(@client) end |
#logout ⇒ Object
注销当前身份验证令牌
35 36 37 |
# File 'lib/zabbix_manager.rb', line 35 def logout @client.logout end |
#maintenance ⇒ Object
返回 ZabbixManager::Maintenance 对象
95 96 97 |
# File 'lib/zabbix_manager.rb', line 95 def maintenance @maintenance ||= Maintenance.new(@client) end |
#mediatypes ⇒ Object
返回 ZabbixManager::Mediatypes 对象
100 101 102 |
# File 'lib/zabbix_manager.rb', line 100 def mediatypes @mediatypes ||= Mediatypes.new(@client) end |
#problems ⇒ Object
返回 ZabbixManager::Problems 对象
105 106 107 |
# File 'lib/zabbix_manager.rb', line 105 def problems @problems ||= Problems.new(@client) end |
#proxies ⇒ Object
返回 ZabbixManager::Proxies 对象
110 111 112 |
# File 'lib/zabbix_manager.rb', line 110 def proxies @proxies ||= Proxies.new(@client) end |
#query(data) ⇒ Object
直接使用自定义查询执行 API 请求
30 31 32 |
# File 'lib/zabbix_manager.rb', line 30 def query(data) @client.api_request(method: data[:method], params: data[:params]) end |
#roles ⇒ Object
返回 ZabbixManager::Roles 对象
115 116 117 |
# File 'lib/zabbix_manager.rb', line 115 def roles @roles ||= Roles.new(@client) end |
#screens ⇒ Object
返回 ZabbixManager::Screens 对象
120 121 122 |
# File 'lib/zabbix_manager.rb', line 120 def screens @screens ||= Screens.new(@client) end |
#scripts ⇒ Object
返回 ZabbixManager::Scripts 对象
125 126 127 |
# File 'lib/zabbix_manager.rb', line 125 def scripts @scripts ||= Scripts.new(@client) end |
#server ⇒ Object
返回 ZabbixManager::Server 对象
130 131 132 |
# File 'lib/zabbix_manager.rb', line 130 def server @server ||= Server.new(@client) end |
#templates ⇒ Object
返回 ZabbixManager::Templates 对象
135 136 137 |
# File 'lib/zabbix_manager.rb', line 135 def templates @templates ||= Templates.new(@client) end |
#triggers ⇒ Object
返回 ZabbixManager::Triggers 对象
140 141 142 |
# File 'lib/zabbix_manager.rb', line 140 def triggers @triggers ||= Triggers.new(@client) end |
#usergroups ⇒ Object
返回 ZabbixManager::Usergroups 对象
145 146 147 |
# File 'lib/zabbix_manager.rb', line 145 def usergroups @usergroups ||= Usergroups.new(@client) end |
#usermacros ⇒ Object
返回 ZabbixManager::Usermacros 对象
150 151 152 |
# File 'lib/zabbix_manager.rb', line 150 def usermacros @usermacros ||= Usermacros.new(@client) end |