Hello everyone!
Im trying to setup LLD for oracleDB, and have some problem with external script i run.
Here it is:
when i'm trying to run it myself, it works fine, but when zabbix server trying to execute it, i have this error:
Oracle variables - oracle_home, oracle_sid, and path is fine, sqlplus and isql is connecting without any problems.
What did i miss?
Im trying to setup LLD for oracleDB, and have some problem with external script i run.
Here it is:
PHP Code:
#!/usr/bin/php
<?php
if(!isset($argv[1]) && !isset($argv[2])) exit("ZBX_NOTSUPPORTED");
$connected_dsn = odbc_connect($argv[1],"","");
if(!$connected_dsn) exit('SQL connection erorr | ZBX_NOTSUPPORTED');
switch ($argv[2]) {
case "tablespaces":
$result=odbc_exec($connected_dsn,"SELECT tablespace_name FROM dba_tablespaces;");
$tablespaces = array("data"=>array());
while(odbc_fetch_row($result)){
$tablespaces['data'][]=array('{#TBSNAME}'=>odbc_result($result,1));
}
echo json_encode($tablespaces);
break;
case "jobs":
$result=odbc_exec($connected_dsn,"SELECT job_name, owner FROM dba_scheduler_jobs WHERE state != 'DISABLED';");
$jobs = array("data"=>array());
while(odbc_fetch_row($result)){
$jobs['data'][]=array(
'{#JOBNAME}'=>odbc_result($result,1),
'{#JOBOWNER}'=>odbc_result($result,2));
}
echo json_encode($jobs);
break;
}
exit();
?>
Code:
PHP Warning: odbc_connect(): SQL error: [unixODBC][Oracle][ODBC][Ora]ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA , SQL state S1000 in SQLConnect in /etc/zabbix/scripts/oracle.odbc.discovery on line 6
What did i miss?
Comment