Sha256: a5440fd5f873ab763c9c9d177022b55ad9cc9526a50755e7161de9a4275aa2c0
Contents?: true
Size: 846 Bytes
Versions: 22
Compression:
Stored size: 846 Bytes
Contents
class ZabbixApi class Graphs < Basic def array_flag true end def method_name "graph" end def indentify "name" end def get_ids_by_host(data) ids = [] result = @client.api_request(:method => "graph.get", :params => {:filter => {:host => data[:host]}, :output => "extend"}) result.each do |graph| ids << graph['graphid'] end ids end def get_items(data) @client.api_request(:method => "graphitem.get", :params => { :graphids => [data], :output => "extend" } ) end def create_or_update(data) graphid = get_id(:name => data[:name], :templateid => data[:templateid]) graphid ? _update(data.merge(:graphid => graphid)) : create(data) end def _update(data) data.delete(:name) update(data) end end end
Version data entries
22 entries across 22 versions & 1 rubygems