Created
March 8, 2013 22:30
-
-
Save dmalikov/5120443 to your computer and use it in GitHub Desktop.
RUBY FOONKTSHIANOL OPPLEEKATION SSYSTEM STACK ERROR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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