Error check_oracle_health

#1

Hi !
I follow this doc to install and configure the plugin oracle_health : http://www.aboutmonitoring.com/install-dbd-oracle-perl-modules-in-linux/
I’m not an DB expert but when I try to execute a tnsping it’s not working
/usr/lib64/nagios/plugins/check_oracle_health --connect my_server --mode tnsping
CRITICAL - cannot connect to my_server. ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA (DBD ERROR: OCIServerAttach)
So After some searching I try this command who’s working
/usr/lib64/nagios/plugins/check_oracle_health --connect my_server:1528/my_service_name --mode tnsping
OK - connection established to my_server:1528/my_service_name.

plus if i test with another mode argument like --mode connection-time
CRITICAL - cannot connect to my_server. ORA-12545: Connect failed because target host or object does not exist (DBD ERROR: OCIServerAttach)

I not sure but the tnsnames.ora seems to be good, I put him in /usr/lib/oracle/19.3/client64/network/admin/tnsnames.ora

my_service_name =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_server)(PORT = 1528))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = my_service_name)
)
)

I defined my env like this, i create a ~.oracle_profile

export PATH=$PATH:$HOME/bin:/usr/lib/oracle/19.3/client64/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/19.3/client64/lib
export ORACLE_HOME=/usr/lib/oracle/19.3/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin

also I can connect to the oracle db with sqlplus myuser@my_server:1528/my_service_name

I’m a bit confused … If someones have a tips