Ad Widget

Collapse

ZabbixAPI: problems with add hosts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • InViZz
    Junior Member
    • Feb 2012
    • 2

    #1

    ZabbixAPI: problems with add hosts

    Hello,
    have some problems with ruby library for zabbix api...
    when I try create new host i see "permission" error, but user is Zabbix Administrator and had API Access. Who can help me? Maybe I doing something wrong?

    output from zabcon.rb -d 6:

    +> add host host=test-api dns=test-api.test.net status=monitored port=10050 groups=none useip=false proxy_hostid=0
    D6 .../libs/zabcon_core.rb:start:222 Input from user: add host host=test-api dns=test-api.test.net status=monitored port=10050 groups=none useip=false proxy_hostid=0
    D5 .../libs/command_tree.rb:initialize:142 Command String: add host host=test-api dns=test-api.test.net status=monitored port=10050 groups=none useip=false proxy_hostid=0
    D6 .../libs/command_tree.rb:find_and_parse:604 Tokens: [#<Lexr::Token:0x10157abc8 @kind=:word, @opts={}, @value="add">, #<Lexr::Token:0x10157a380 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x101579340 @kind=:word, @opts={}, @value="host">, #<Lexr::Token:0x101578ad0 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x101577a90 @kind=:word, @opts={}, @value="host">, #<Lexr::Token:0x101576d20 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x101575d80 @kind=:word, @opts={}, @value="test-api">, #<Lexr::Token:0x101575510 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x1015744d0 @kind=:word, @opts={}, @value="dns">, #<Lexr::Token:0x101573760 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x1015727c0 @kind=:word, @opts={}, @value="test-api.test.net">, #<Lexr::Token:0x101571f50 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x101570f10 @kind=:word, @opts={}, @value="status">, #<Lexr::Token:0x1015701a0 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x10156f200 @kind=:word, @opts={}, @value="monitored">, #<Lexr::Token:0x10156e990 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x10156d950 @kind=:word, @opts={}, @value="port">, #<Lexr::Token:0x10156cbe0 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x10156bf60 @kind=:number, @opts={}, @value=10050>, #<Lexr::Token:0x10156b7b8 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x10156a778 @kind=:word, @opts={}, @value="groups">, #<Lexr::Token:0x101569a08 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x101568a68 @kind=:word, @opts={}, @value="none">, #<Lexr::Token:0x1015681f8 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x1015671b8 @kind=:word, @opts={}, @value="useip">, #<Lexr::Token:0x101566448 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x1015654a8 @kind=:word, @opts={}, @value="false">, #<Lexr::Token:0x101564c38 @kind=:whitespace, @opts={}, @value=" ">, #<Lexr::Token:0x101563bf8 @kind=:word, @opts={}, @value="proxy_hostid">, #<Lexr::Token:0x101562e88 @kind=:equals, @opts={}, @value="=">, #<Lexr::Token:0x101562208 @kind=:number, @opts={}, @value=0>, #<Lexr::Token:0x101562078 @kind=:end, @opts={}, @value=nil>]
    D6 .../libs/command_tree.rb:find_and_parse:605 Pos: 4
    D6 .../libs/command_tree.rb:find_and_parse:609 Parameters: host=test-api dns=test-api.test.net status=monitored port=10050 groups=none useip=false proxy_hostid=0
    D6 .../libs/command_tree.rb:call_tokenizer:442 parameters: ""host=test-api dns=test-api.test.net status=monitored port=10050 groups=none useip=false proxy_hostid=0""
    D6 .../libs/command_tree.rb:call_arg_processor:451 parameters: "{"proxy_hostid"=>0, "groups"=>"none", "useip"=>"false", "port"=>10050, "host"=>"test-api", "status"=>"monitored", "dns"=>"test-api.test.net"}"
    D6 .../libs/command_tree.rb:call_arg_processor:454 #<Command::Arguments:0x1015197b0 @show_params={}, @cmd_params={"proxy_hostid"=>0, "groups"=>"none", "useip"=>"false", "port"=>10050, "host"=>"test-api", "status"=>"monitored", "dns"=>"test-api.test.net"}>
    D4 ..././zbxapi.rb:zbxapi_do_request:288 Sending: {"auth":"0f17159448e855f60db2791baf2f37a3","met hod ":"host.create","id":5,"params":{"proxy_hostid ":0, "groups":"none","useip":"false","port":10050," host ":"test-api","status":"monitored","dns":"test-api.test.net"},"jsonrpc":"2.0"}
    D4 ..././zbxapi.rb:zbxapi_do_request:290 Response Code: 200
    D4 ..././zbxapi.rb:zbxapi_do_request:291 Response Body: {"jsonrpc":"2.0","error":{"code":-32500,"message":"Application error.","data":"[ CHost::create ] No permissions !"},"id":5}
    You do not have permission to perform that operation

    Using Zabbix 1.8.10

    P.S.
    Sorry for my English(((
Working...