Sha256: e2de61127dac98e168bb3bf197c432e962e87aca02c156142396fd0cb7351b9a
Contents?: true
Size: 1.07 KB
Versions: 11
Compression:
Stored size: 1.07 KB
Contents
class ZabbixApi class Hosts < Basic def method_name "host" end def indentify "host" end def dump_by_id(data) log "[DEBUG] Call dump_by_id with parametrs: #{data.inspect}" @client.api_request( :method => "host.get", :params => { :filter => { key.to_sym => data[key.to_sym] }, :output => "extend", :selectGroups => "shorten" } ) end def default_options { :host => nil, :interfaces => [], :status => 0, :available => 1, :groups => [], :proxy_hostid => nil } end def unlink_templates(data) result = @client.api_request( :method => "host.massRemove", :params => { :hostids => data[:hosts_id], :templates => data[:templates_id] } ) result.empty? ? false : true end def create_or_update(data) hostid = get_id(:host => data[:host]) hostid ? update(data.merge(:hostid => hostid)) : create(data) end end end
Version data entries
11 entries across 11 versions & 2 rubygems