Does anyone use Rubix for Zabbix API?
Rubix's lack of documentation doesn't really help much. If I can't get help here I'll ditch it for something else.
I'm having issues getting Rubix to perform a host.update.
Here is my syntax. The real host has been replaced with test-host.
The error I get is
#<Rubix::Response:0x000000009c9aa0 @http_response=#<Net::HTTPOK 200 OK readbody=true>, @body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32602,\"message\":\"Invalid params.\",\"data\":\"Wrong fields for host \\\"test-host\\\".\"},\"id\":4}", @code=200>
Now, I did attempt to use hostid in place of host like so:
The output looks better:
#<Rubix::Response:0x00000001b68810 @http_response=#<Net::HTTPOK 200 OK readbody=true>, @body="{\"jsonrpc\":\"2.0\",\"result\":{\"hostids\ ":[10798]},\"id\":4}", @code=200>
But there was no change of the host in Zabbix. As if it didn't update.
So I'm looking for anyone else who uses Rubix. And if you think Rubix is not the way to go, which Ruby wrapper do you recommend for Ruby1.9?
Rubix's lack of documentation doesn't really help much. If I can't get help here I'll ditch it for something else.
I'm having issues getting Rubix to perform a host.update.
Here is my syntax. The real host has been replaced with test-host.
Code:
Rubix.connection.request(
"host.update",
"host" => "test-host",
"params" => {
"status" => 0,
"interfaces" => [
"type" => 1,
"main" => 1,
"useip" => 0,
"ip" => "0.0.0.0",
"dns" => dnsname,
"port" => "10050"
],
"groups" => ["Unregistered"],
"templates" => ["10411"]
}
)
#<Rubix::Response:0x000000009c9aa0 @http_response=#<Net::HTTPOK 200 OK readbody=true>, @body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32602,\"message\":\"Invalid params.\",\"data\":\"Wrong fields for host \\\"test-host\\\".\"},\"id\":4}", @code=200>
Now, I did attempt to use hostid in place of host like so:
Code:
Rubix.connection.request(
"host.update",
"hostid" => 10798,
"params" => {
"status" => 0,
"interfaces" => [
"type" => 1,
"main" => 1,
"useip" => 0,
"ip" => "0.0.0.0",
"dns" => dnsname,
"port" => "10050"
],
"groups" => ["Unregistered"],
"templates" => ["10411"]
}
)
#<Rubix::Response:0x00000001b68810 @http_response=#<Net::HTTPOK 200 OK readbody=true>, @body="{\"jsonrpc\":\"2.0\",\"result\":{\"hostids\ ":[10798]},\"id\":4}", @code=200>
But there was no change of the host in Zabbix. As if it didn't update.
So I'm looking for anyone else who uses Rubix. And if you think Rubix is not the way to go, which Ruby wrapper do you recommend for Ruby1.9?
Comment