Plugin check_oracle_health vars

Hello,

try to use the check_oracle_health plugin in Director, it works from the command line:

/usr/lib/nagios/plugins/check_oracle_health --connect DBE3DB11.WORLD --user icinga --password topsecret --mode connection-time --warning 2 --critical 7 --environment ORACLE_HOME=/usr/lib/oracle/19.5/client64 --environment LD_LIBRARY_PATH=/usr/lib/oracle/19.5/client64/lib --environment TNS_ADMIN=/usr/lib/oracle/19.5/client64/network/ADMIN --report long

OK - 0.05 seconds to connect as ICINGA | connection_time=0.0528;2;7

I know the check_oracle_health Plugin is pre configured from the ITL. But I dont know how I can change the:

vars.oracle_home = "/usr/lib/oracle/11.2/client64/lib"
vars.oracle_ld_library_path = "/usr/lib/oracle/11.2/client64/lib"
vars.oracle_tns_admin = "/etc/icinga2/plugin-configs"

I need /usr/lib/oracle/19.5/client64/lib

Had try to clone the pre-configured plugin and add the environment var but I need the option --environment 3 times but director accept only one option?

Regards
pulsar

some more information:

https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#oracle_health

on this page I read:
ORACLE_HOME Required. Specifies the location of the oracle instant client libraries. Defaults to “/usr/lib/oracle/11.2/client64/lib”. Can be overridden by setting the custom variable oracle_home

How I can do that in director?

From the command line the plugin worked correct after edit the /etc/profile.local with this content:

export ORACLE_HOME=/usr/lib/oracle/19.5/client64
PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/ADMIN

You need to create the three data fields oracle_home, oracle_ld_library_path, oracle_tns_admin.
Then add them to the check command or the service template via the “fields” tab.

After doing this you can fill your specific paths into the fields and the script will use them.

Thx log1c,

I thought I had tried it, but he still hadn’t taken over the settings.

Did it another way:
I not used fields, I had add an argument –environment with the value TNS_ADMIN=/usr/lib/oracle/19.5/client64/network/ADMIN/

I only need to add TNS_ADMIN the oracle_ld_library_path and oracle_home was not necessary.