this connector support:
- proxy usage (setup in basic jsonrpc class)
#how use?
require __DIR__ . '/zbx.inc.php';
$zbx = new zbx;
for auth u need 3 params,
- url to zabbix api like http(s)://zabbixurl/api_jsonrpc.php
- user
- password
for next requests for zabbix we use returned "access token" from authorization
$zbx->url = zabbixurl;
$zbx->method = 'user.login';
$zbx->query['user'] = $connection['user'];
$zbx->query['password'] = $connection['password'];
$zbx->access_token = $zbx->call()['result'];
###sample of request after auth
- get host id by host name
$zbx->method = 'template.get';
$zbx->query['output'] = 'hostids';
$zbx->query['filter']['host'] = 'domain_server';
$hostid = $zbx->call()['result']['0']['hostid'];
- for debug u can use full responce output like:
var_dump($zbx->call());
- view all zabbix methods on https://www.zabbix.com/documentation/2.2/manual/api/reference
- questions? - [email protected]