Skip to content

Instantly share code, notes, and snippets.

@dmalikov
Created March 8, 2013 22:30
Show Gist options
  • Save dmalikov/5120443 to your computer and use it in GitHub Desktop.
Save dmalikov/5120443 to your computer and use it in GitHub Desktop.
RUBY FOONKTSHIANOL OPPLEEKATION SSYSTEM STACK ERROR
def get_hostid_by_itemid(itemid)
message = {
'method' => 'host.get',
'params' => {
'itemids' => [itemid.to_s]
}
}
return send_request(message).first["hostid"]
end
def get_host_by_hostid(hostid)
message = {
'method' => 'host.get',
'params' => {
'hostids' => [hostid.to_s]
}
}
return send_request(message).first["host"]
end
def get_host_by_itemid(itemid)
return get_host_by_hostid(get_host_by_itemid(itemid))
end
----------------
puts zbx.get_host_by_itemid(62418)
/home/v/lib/fetcher.rb:80: stack level too deep (SystemStackError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment