Class: ZabbixAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/zapix.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ZabbixAPI

Returns a new instance of ZabbixAPI.



11
12
13
14
15
# File 'lib/zapix.rb', line 11

def initialize(options = {})
  @client = ZabbixRPCClient.new(options)
  Dir["#{File.dirname(__FILE__)}/zapix/zabbix_classes/*.rb"].each { |f| load(f) }
  Dir["#{File.dirname(__FILE__)}/zapix/proxies/*.rb"].each { |f| load(f) }
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/zapix.rb', line 5

def client
  @client
end

Class Method Details

.connect(options = {}) ⇒ Object



7
8
9
# File 'lib/zapix.rb', line 7

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

Instance Method Details

#hostgroupsObject



17
18
19
# File 'lib/zapix.rb', line 17

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

#hostsObject



21
22
23
# File 'lib/zapix.rb', line 21

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

#templatesObject



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

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