Hi,
I'm using the Zabbix API call to create hostgroup for a project purpose, but I encounter this problem :
When I create my hostgroup, everything is fine, I got his ID, it's 17 at the moment. When I try to create hosts in this hostgroup, I've got a "
I'm using the PHPZabbixAPI to call the API via PHP, and I've this problem with Zabbix :
But, when I create the exact same hosts, with the groupid at something like 2, it's working !!
The thing is the API doesn't let me create hosts in hostgroup with groupid >10 !
Here is my code if you want :
I'm using the Zabbix API call to create hostgroup for a project purpose, but I encounter this problem :
When I create my hostgroup, everything is fine, I got his ID, it's 17 at the moment. When I try to create hosts in this hostgroup, I've got a "
I'm using the PHPZabbixAPI to call the API via PHP, and I've this problem with Zabbix :
Array
(
[jsonrpc] => 2.0
[error] => Array
(
[code] => -32500
[message] => Application error.
[data] => No permissions to referred object or it does not exist!
)
[id] => 2
)
(
[jsonrpc] => 2.0
[error] => Array
(
[code] => -32500
[message] => Application error.
[data] => No permissions to referred object or it does not exist!
)
[id] => 2
)
The thing is the API doesn't let me create hosts in hostgroup with groupid >10 !
Here is my code if you want :
$data = array(
'jsonrpc' => "2.0",
'method' => "host.create",
'params' => array(
'host' => $hostNameUnique,
'interfaces' => array('type' => 1, 'main' => 1, 'useip' => 1, 'ip' => '0.0.0.0', 'dns' => '', 'port' => '10050'),
'groups' => array('groupid' => '17'),
'name' => $hostName
),
'id' => "2",
'auth' => $api
);
'jsonrpc' => "2.0",
'method' => "host.create",
'params' => array(
'host' => $hostNameUnique,
'interfaces' => array('type' => 1, 'main' => 1, 'useip' => 1, 'ip' => '0.0.0.0', 'dns' => '', 'port' => '10050'),
'groups' => array('groupid' => '17'),
'name' => $hostName
),
'id' => "2",
'auth' => $api
);
Comment