Class: ZabbixApi
- Inherits:
-
Object
- Object
- ZabbixApi
- Defined in:
- lib/zabbixapi.rb,
lib/zabbixapi/hosts.rb,
lib/zabbixapi/items.rb,
lib/zabbixapi/users.rb,
lib/zabbixapi/client.rb,
lib/zabbixapi/errors.rb,
lib/zabbixapi/graphs.rb,
lib/zabbixapi/server.rb,
lib/zabbixapi/version.rb,
lib/zabbixapi/triggers.rb,
lib/zabbixapi/templates.rb,
lib/zabbixapi/hostgroups.rb,
lib/zabbixapi/applications.rb
Defined Under Namespace
Classes: ApiError, Applications, BaseError, Client, Graphs, HostGroups, Hosts, HttpError, Items, Server, SocketError, Templates, Triggers, Users
Constant Summary collapse
- VERSION =
"0.4.3"
Instance Attribute Summary collapse
-
#applications ⇒ Object
readonly
Returns the value of attribute applications.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
-
#hostgroups ⇒ Object
readonly
Returns the value of attribute hostgroups.
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
-
#triggers ⇒ Object
readonly
Returns the value of attribute triggers.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ZabbixApi
constructor
A new instance of ZabbixApi.
- #query(data) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ZabbixApi
Returns a new instance of ZabbixApi.
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/zabbixapi.rb', line 38 def initialize( = {}) @client = Client.new() @server = Server.new() @users = Users.new() @items = Items.new() @hosts = Hosts.new() @applications = Applications.new() @templates = Templates.new() @hostgroups = HostGroups.new() @triggers = Triggers.new() @graphs = Graphs.new() end |
Instance Attribute Details
#applications ⇒ Object (readonly)
Returns the value of attribute applications.
19 20 21 |
# File 'lib/zabbixapi.rb', line 19 def applications @applications end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
15 16 17 |
# File 'lib/zabbixapi.rb', line 15 def client @client end |
#graphs ⇒ Object (readonly)
Returns the value of attribute graphs.
24 25 26 |
# File 'lib/zabbixapi.rb', line 24 def graphs @graphs end |
#hostgroups ⇒ Object (readonly)
Returns the value of attribute hostgroups.
21 22 23 |
# File 'lib/zabbixapi.rb', line 21 def hostgroups @hostgroups end |
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
22 23 24 |
# File 'lib/zabbixapi.rb', line 22 def hosts @hosts end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
18 19 20 |
# File 'lib/zabbixapi.rb', line 18 def items @items end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
16 17 18 |
# File 'lib/zabbixapi.rb', line 16 def server @server end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
20 21 22 |
# File 'lib/zabbixapi.rb', line 20 def templates @templates end |
#triggers ⇒ Object (readonly)
Returns the value of attribute triggers.
23 24 25 |
# File 'lib/zabbixapi.rb', line 23 def triggers @triggers end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
17 18 19 |
# File 'lib/zabbixapi.rb', line 17 def users @users end |
Class Method Details
.connect(options = {}) ⇒ Object
26 27 28 |
# File 'lib/zabbixapi.rb', line 26 def self.connect( = {}) new() end |
Instance Method Details
#query(data) ⇒ Object
34 35 36 |
# File 'lib/zabbixapi.rb', line 34 def query(data) @client.api_request(:method => data[:method], :params => data[:params]) end |