NetXMS Support Forum

English Support => General Support => Topic started by: IhOl on January 19, 2024, 02:04:00 PM

Title: Initialization of subagent "ORACLE" failed
Post by: IhOl on January 19, 2024, 02:04:00 PM
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.
Title: Re: Initialization of subagent "ORACLE" failed
Post by: Alex Kirhenshtein on January 19, 2024, 02:54:52 PM
Make sure that either InstantClient or full Oracle client is installed and available in libpath.
Title: Re: Initialization of subagent "ORACLE" failed
Post by: IhOl on January 19, 2024, 03:14:25 PM
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
Title: Re: Initialization of subagent "ORACLE" failed
Post by: IhOl on January 22, 2024, 11:47:25 AM
Do you have more ideas?
Title: Re: Initialization of subagent "ORACLE" failed
Post by: Filipp Sudanov on January 22, 2024, 06:26:16 PM
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).
Title: Re: Initialization of subagent "ORACLE" failed
Post by: IhOl on January 23, 2024, 10:21:26 AM
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.
Title: Re: Initialization of subagent "ORACLE" failed
Post by: Victor Kirhenshtein on February 07, 2024, 04:04:43 PM
Can you show full agent config?