Initialization of subagent "ORACLE" failed

Started by IhOl, January 19, 2024, 02:04:00 PM

Previous topic - Next topic

IhOl

Hi, we have installed agent on Linux and trying to add subagent Oracle.

Core agent version 4.3-243-g93e41d8

config:

SubAgent=/opt/netxms/lib/netxms/oracle.nsm
DBDriver=/opt/netxms/lib/netxms/dbdrv/oracle.ddr

During startup, agent rising error:
2024.01.19 14:43:13.683 *D* [db.drv.oracle      ] OCI version 19.21.0.0.0
2024.01.19 14:43:13.686 *E* [db.drv.oracle      ] Cannot allocate Oracle environment handle
2024.01.19 14:43:13.686 *E* [db.drv            ] Database driver "oracle.ddr" initialization failed
2024.01.19 14:43:13.686 *D* [dload              ] DLClose: module=0x1b69f20
2024.01.19 14:43:13.687 *E* [oracle            ] Cannot load Oracle database driver
2024.01.19 14:43:13.687 *E* [subagents          ] Initialization of subagent "ORACLE" (/opt/netxms/lib/netxms/oracle.nsm) failed

Please advice.

Alex Kirhenshtein

Make sure that either InstantClient or full Oracle client is installed and available in libpath.

IhOl

#2
It is Oracle DB server where DB is running.
I've added into agent config file

ORACLE_HOME=/uat/db/19c
LD_LIBRARY_PATH=/uat/db/19c/lib


Also
ldd oracle.ddr |grep 19

libclntshcore.so.19.1 => /uat/db/19c/lib/libclntshcore.so.19.1 (0x00007f75e4403000)

So i guess all libs should be available

IhOl


Filipp Sudanov

You've executed  ldd oracle.ddr |grep 19 under root or some other user? nxagentd is probably running under root, which can have different env variables set.

For the agent config, you can specify env variables in [env] section, e.g.

[env]
ORACLE_HOME=/uat/db/19c
LD_LIBRARY_PATH=/uat/db/19c/lib

but I am not sure, if this affects database drivers, or only processes that agent launches after it has started (e.g. external metrics).

IhOl

I've run ldd under root.
Also i've added ORACLE_HOME and LD_LIBRARY_PATH into agent config file.
It was read by agent and written in log.
But driver initialization failed and there is no other errors or messages even in debug 9.

That is why i've started this topic.

Victor Kirhenshtein