Class: ZabbixManager

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ZabbixManager

初始化一个新的 ZabbixManager 对象



40
41
42
# File 'lib/zabbix_manager.rb', line 40

def initialize(options = {})
  @client = Client.new(options)
end

Instance Attribute Details

#clientObject (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(options = {})
  new(options)
end

.currentObject

获取当前 ZabbixManager 对象



25
26
27
# File 'lib/zabbix_manager.rb', line 25

def self.current
  @current ||= new
end

Instance Method Details

#actionsObject

返回 ZabbixManager::Actions 对象



45
46
47
# File 'lib/zabbix_manager.rb', line 45

def actions
  @actions ||= Actions.new(@client)
end

#applicationsObject

返回 ZabbixManager::Applications 对象



50
51
52
# File 'lib/zabbix_manager.rb', line 50

def applications
  @applications ||= Applications.new(@client)
end

#configurationsObject

返回 ZabbixManager::Configurations 对象



55
56
57
# File 'lib/zabbix_manager.rb', line 55

def configurations
  @configurations ||= Configurations.new(@client)
end

#drulesObject

返回 ZabbixManager::Drules 对象



165
166
167
# File 'lib/zabbix_manager.rb', line 165

def drules
  @drules ||= Drules.new(@client)
end

#eventsObject

返回 ZabbixManager::Events 对象



60
61
62
# File 'lib/zabbix_manager.rb', line 60

def events
  @events ||= Events.new(@client)
end

#graphsObject

返回 ZabbixManager::Graphs 对象



65
66
67
# File 'lib/zabbix_manager.rb', line 65

def graphs
  @graphs ||= Graphs.new(@client)
end

#hostgroupsObject

返回 ZabbixManager::HostGroups 对象



70
71
72
# File 'lib/zabbix_manager.rb', line 70

def hostgroups
  @hostgroups ||= HostGroups.new(@client)
end

#hostinterfacesObject

返回 ZabbixManager::HostInterfaces 对象



75
76
77
# File 'lib/zabbix_manager.rb', line 75

def hostinterfaces
  @hostinterfaces ||= HostInterfaces.new(@client)
end

#hostsObject

返回 ZabbixManager::Hosts 对象



80
81
82
# File 'lib/zabbix_manager.rb', line 80

def hosts
  @hosts ||= Hosts.new(@client)
end

#httptestsObject

返回 ZabbixManager::HttpTests 对象



85
86
87
# File 'lib/zabbix_manager.rb', line 85

def httptests
  @httptests ||= HttpTests.new(@client)
end

#itemsObject

返回 ZabbixManager::Items 对象



90
91
92
# File 'lib/zabbix_manager.rb', line 90

def items
  @items ||= Items.new(@client)
end

#logoutObject

注销当前身份验证令牌



35
36
37
# File 'lib/zabbix_manager.rb', line 35

def logout
  @client.logout
end

#maintenanceObject

返回 ZabbixManager::Maintenance 对象



95
96
97
# File 'lib/zabbix_manager.rb', line 95

def maintenance
  @maintenance ||= Maintenance.new(@client)
end

#mediatypesObject

返回 ZabbixManager::Mediatypes 对象



100
101
102
# File 'lib/zabbix_manager.rb', line 100

def mediatypes
  @mediatypes ||= Mediatypes.new(@client)
end

#problemsObject

返回 ZabbixManager::Problems 对象



105
106
107
# File 'lib/zabbix_manager.rb', line 105

def problems
  @problems ||= Problems.new(@client)
end

#proxiesObject

返回 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

#rolesObject

返回 ZabbixManager::Roles 对象



115
116
117
# File 'lib/zabbix_manager.rb', line 115

def roles
  @roles ||= Roles.new(@client)
end

#screensObject

返回 ZabbixManager::Screens 对象



120
121
122
# File 'lib/zabbix_manager.rb', line 120

def screens
  @screens ||= Screens.new(@client)
end

#scriptsObject

返回 ZabbixManager::Scripts 对象



125
126
127
# File 'lib/zabbix_manager.rb', line 125

def scripts
  @scripts ||= Scripts.new(@client)
end

#serverObject

返回 ZabbixManager::Server 对象



130
131
132
# File 'lib/zabbix_manager.rb', line 130

def server
  @server ||= Server.new(@client)
end

#templatesObject

返回 ZabbixManager::Templates 对象



135
136
137
# File 'lib/zabbix_manager.rb', line 135

def templates
  @templates ||= Templates.new(@client)
end

#triggersObject

返回 ZabbixManager::Triggers 对象



140
141
142
# File 'lib/zabbix_manager.rb', line 140

def triggers
  @triggers ||= Triggers.new(@client)
end

#usergroupsObject

返回 ZabbixManager::Usergroups 对象



145
146
147
# File 'lib/zabbix_manager.rb', line 145

def usergroups
  @usergroups ||= Usergroups.new(@client)
end

#usermacrosObject

返回 ZabbixManager::Usermacros 对象



150
151
152
# File 'lib/zabbix_manager.rb', line 150

def usermacros
  @usermacros ||= Usermacros.new(@client)
end

#usersObject

返回 ZabbixManager::Users 对象



155
156
157
# File 'lib/zabbix_manager.rb', line 155

def users
  @users ||= Users.new(@client)
end

#valuemapsObject

返回 ZabbixManager::ValueMaps 对象



160
161
162
# File 'lib/zabbix_manager.rb', line 160

def valuemaps
  @valuemaps ||= ValueMaps.new(@client)
end