Hi,
im having some issues with my code or api, to be honset i dont really know what is wrong.
im working on php8.0/symfony5
class ZabbixController
{
/**
* @Route (path="zabbix",name="zabbix_worker")
* @return Response
*/
function zabbixGraph(): Response
{
$zabbixUrl = 'url';
$zabbixUser = 'user';
$zabbixPassword = 'passwd';
$zabbixToken = null;
$zabbixData = [$zabbixUrl,$zabbixUser, $zabbixPassword, $zabbixToken,null];
try {
$api = new ZabbixApi($zabbixData);
} catch (Exception $e) {
echo $e->getMessage();
}
$GetGraphId = $api->graphGet(array(
'output' => 'extend',
'filter' => array('host' =>'abros'),
'search' => array('name' => 'Network traffic on')
));
echo($GetGraphId);
return new Response($GetGraphId);
}
}
and thats my error: Warning: Undefined property: ZabbixApi\ZabbixApi::$authToken

its like im getting error after connection, and my question is: is it connection problem or something more?
thanks for any clues or answers
im having some issues with my code or api, to be honset i dont really know what is wrong.
im working on php8.0/symfony5
class ZabbixController
{
/**
* @Route (path="zabbix",name="zabbix_worker")
* @return Response
*/
function zabbixGraph(): Response
{
$zabbixUrl = 'url';
$zabbixUser = 'user';
$zabbixPassword = 'passwd';
$zabbixToken = null;
$zabbixData = [$zabbixUrl,$zabbixUser, $zabbixPassword, $zabbixToken,null];
try {
$api = new ZabbixApi($zabbixData);
} catch (Exception $e) {
echo $e->getMessage();
}
$GetGraphId = $api->graphGet(array(
'output' => 'extend',
'filter' => array('host' =>'abros'),
'search' => array('name' => 'Network traffic on')
));
echo($GetGraphId);
return new Response($GetGraphId);
}
}
and thats my error: Warning: Undefined property: ZabbixApi\ZabbixApi::$authToken
its like im getting error after connection, and my question is: is it connection problem or something more?
thanks for any clues or answers
Comment