Issues installing Oracle plugin in NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by bosecorp »

1526 is the correct port now.

# nmap 10.101.31.105 -p 1526

Starting Nmap 6.47 ( http://nmap.org ) at 2016-04-11 17:05 EDT
Nmap scan report for sbldev.bose.com (10.101.31.105)
Host is up (0.0014s latency).
PORT STATE SERVICE
1526/tcp open pdap-np

Nmap done: 1 IP address (1 host up) scanned in 0.31 seconds
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issues installing Oracle plugin in NagiosXI

Post by rkennedy »

Hm, what is the result if you run the check with an IP instead of a hostname?

What are your environment variables for Oracle_Home set to?
Former Nagios Employee
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by bosecorp »

# nmap sbldev.bose.com -p 1526

Starting Nmap 6.47 ( http://nmap.org ) at 2016-04-11 17:46 EDT
Nmap scan report for sbldev.bose.com (10.101.31.105)
Host is up (0.00093s latency).
PORT STATE SERVICE
1526/tcp open pdap-np

Nmap done: 1 IP address (1 host up) scanned in 1.67 seconds

Below the environment for oracle plugin on my nagios server

export ORACLE_HOME=/usr/lib/oracle/12.1/client64/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client64/lib/
export PATH=$PATH:/usr/lib/oracle/12.1/client64/bin
export TNS_ADMIN=/usr/lib/oracle/12.1/client64/network/admin
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issues installing Oracle plugin in NagiosXI

Post by tgriep »

Take a look in the the folder that the TNS_ADMIN environment variable it pointing to

Code: Select all

/usr/lib/oracle/12.1/client64/network/admin
You may have to edit the tnsnames.ora file, it it exists, to add your server, SID, etc...
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by bosecorp »

tnsnames.ora file already exist and the entries are correct

root@nagmonusdev1:(04-12 09:57): /usr/lib/oracle/12.1/client64/network/admin
# cat tnsnames.ora
sblqa1.bose.com=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sbldev)(PORT = 1526))
)
(CONNECT_DATA =
(SID = SBLQA1)
(SERVER = DEDICATED)
)
)

If the entries were incorrect, i will not be able to do tnsping. But that's not the case here.

root@nagmonusdev1:(04-12 09:57): /usr/local/nagios/libexec
# ./check_oracle_health --connect sblqa1.bose.com --mode tnsping
OK - connection established to sblqa1.bose.com.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issues installing Oracle plugin in NagiosXI

Post by tgriep »

Try running the command like the example below. Make sure you leave the single / double quotes intact and see if that works for you.

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib ORACLE_HOME=/usr/lib/oracle/12.1/client64 /usr/local/nagios/libexec/check_oracle_health --connect 'sblqa1.bose.com:1526/SBLQA1' --username 'oracleuser' --password 'oraclepass' --mode sql --name="select count(*) from S_ESCL_REQ"
If it still doesn't work, you may have to login to your Oracle server and see what type of error it is reporting.
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by bosecorp »

I also tried putting the TNS_ADMIN variable but still no go

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib ORACLE_HOME=/usr/lib/oracle/12.1/client64 /usr/local/nagios/libexec/check_oracle_health --connect 'sblqa1.bose.com:1526/SBLQA1' --username 'nagios' --password 'nagios' --mode sql --name="select count(*) from S_ESCL_REQ"
CRITICAL - cannot connect to sblqa1.bose.com:1526/SBLQA1. ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib ORACLE_HOME=/usr/lib/oracle/12.1/client64 TNS_ADMIN=/usr/lib/oracle/12.1/client64/network/admin /usr/local/nagios/libexec/check_oracle_health --connect 'sblqa1.bose.com:1526/SBLQA1' --username 'nagios' --password 'nagios' --mode sql --name="select count(*) from S_ESCL_REQ"
CRITICAL - cannot connect to sblqa1.bose.com:1526/SBLQA1. ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by lmiltchev »

CRITICAL - cannot connect to sblqa1.bose.com:1526/SBLQA1. ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)
I may be wrong but I believe you need to have the following line in the tnsnames.ora file:

Code: Select all

(SERVICE_NAME = SBLQA1)
Here's a sample format:
<addressname> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
)
(CONNECT_DATA =
(SERVICE_NAME = <service_name>)
)
)
http://www.orafaq.com/wiki/Tnsnames.ora
Be sure to check out our Knowledgebase for helpful articles and solutions!
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Issues installing Oracle plugin in NagiosXI

Post by bosecorp »

# cat /usr/lib/oracle/12.1/client64/network/admin/tnsnames.ora
sblqa1.bose.com=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sbldev)(PORT = 1526))
)
(CONNECT_DATA =
(SERVICE_NAME = SBLQA1)
(SID = SBLQA1)
(SERVER = DEDICATED)
)
)

Still getting same error. Please escalate this to higher priority.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issues installing Oracle plugin in NagiosXI

Post by rkennedy »

Can you try -

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib ORACLE_HOME=/usr/lib/oracle/12.1/client64 /usr/local/nagios/libexec/check_oracle_health --connect '10.101.31.105:1526/SBLQA1' --username 'nagios' --password 'nagios' --mode sql --name="select count(*) from S_ESCL_REQ"
If this doesn't work, then you may need to set the HOST = to be a resolvable name in your tsanames.ora. Try this, and then from the XI server, can you run nslookup sbldev?
Former Nagios Employee
Locked