Class: ZabbixApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zabbixapi.rb,
lib/zabbixapi/client.rb,
lib/zabbixapi/version.rb,
lib/zabbixapi/classes/hosts.rb,
lib/zabbixapi/classes/items.rb,
lib/zabbixapi/classes/users.rb,
lib/zabbixapi/classes/errors.rb,
lib/zabbixapi/classes/graphs.rb,
lib/zabbixapi/classes/server.rb,
lib/zabbixapi/classes/proxies.rb,
lib/zabbixapi/classes/screens.rb,
lib/zabbixapi/basic/basic_func.rb,
lib/zabbixapi/basic/basic_init.rb,
lib/zabbixapi/classes/triggers.rb,
lib/zabbixapi/classes/unusable.rb,
lib/zabbixapi/basic/basic_alias.rb,
lib/zabbixapi/basic/basic_logic.rb,
lib/zabbixapi/classes/templates.rb,
lib/zabbixapi/classes/hostgroups.rb,
lib/zabbixapi/classes/mediatypes.rb,
lib/zabbixapi/classes/usergroups.rb,
lib/zabbixapi/classes/usermacros.rb,
lib/zabbixapi/classes/applications.rb,
lib/zabbixapi/classes/configurations.rb

Defined Under Namespace

Classes: ApiError, Applications, BaseError, Basic, Client, Configurations, Graphs, HostGroups, Hosts, HttpError, Items, Mediatypes, Proxies, Screens, Server, SocketError, Templates, Triggers, Usergroups, Usermacros, Users

Constant Summary collapse

VERSION =
"2.4.2"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ZabbixApi

Returns a new instance of ZabbixApi.


43
44
45
# File 'lib/zabbixapi.rb', line 43

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

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client


29
30
31
# File 'lib/zabbixapi.rb', line 29

def client
  @client
end

Class Method Details

.connect(options = {}) ⇒ Object


31
32
33
# File 'lib/zabbixapi.rb', line 31

def self.connect(options = {})
  new(options)
end

.currentObject


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

def self.current
  @current ||= ZabbixApi.new
end

Instance Method Details

#applicationsObject


63
64
65
# File 'lib/zabbixapi.rb', line 63

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

#configurationsObject


103
104
105
# File 'lib/zabbixapi.rb', line 103

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

#graphsObject


79
80
81
# File 'lib/zabbixapi.rb', line 79

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

#hostgroupsObject


71
72
73
# File 'lib/zabbixapi.rb', line 71

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

#hostsObject


59
60
61
# File 'lib/zabbixapi.rb', line 59

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

#itemsObject


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

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

#mediatypesObject


99
100
101
# File 'lib/zabbixapi.rb', line 99

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

#proxiesObject


83
84
85
# File 'lib/zabbixapi.rb', line 83

def proxies
  @proxies ||= Proxies.new(@client)
end

#query(data) ⇒ Object


39
40
41
# File 'lib/zabbixapi.rb', line 39

def query(data)
  @client.api_request(:method => data[:method], :params => data[:params])
end

#screensObject


87
88
89
# File 'lib/zabbixapi.rb', line 87

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

#serverObject


47
48
49
# File 'lib/zabbixapi.rb', line 47

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

#templatesObject


67
68
69
# File 'lib/zabbixapi.rb', line 67

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

#triggersObject


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

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

#usergroupsObject


91
92
93
# File 'lib/zabbixapi.rb', line 91

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

#usermacrosObject


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

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

#usersObject


51
52
53
# File 'lib/zabbixapi.rb', line 51

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