Page 2 of 3

Re: Issues installing Oracle plugin in NagiosXI

Posted: Mon Apr 11, 2016 4:06 pm
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

Re: Issues installing Oracle plugin in NagiosXI

Posted: Mon Apr 11, 2016 4:43 pm
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?

Re: Issues installing Oracle plugin in NagiosXI

Posted: Mon Apr 11, 2016 4:46 pm
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

Re: Issues installing Oracle plugin in NagiosXI

Posted: Tue Apr 12, 2016 8:37 am
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...

Re: Issues installing Oracle plugin in NagiosXI

Posted: Tue Apr 12, 2016 9:01 am
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.

Re: Issues installing Oracle plugin in NagiosXI

Posted: Tue Apr 12, 2016 2:20 pm
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.

Re: Issues installing Oracle plugin in NagiosXI

Posted: Tue Apr 12, 2016 4:43 pm
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)

Re: Issues installing Oracle plugin in NagiosXI

Posted: Tue Apr 12, 2016 5:14 pm
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

Re: Issues installing Oracle plugin in NagiosXI

Posted: Fri Apr 15, 2016 12:42 pm
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.

Re: Issues installing Oracle plugin in NagiosXI

Posted: Fri Apr 15, 2016 2:02 pm
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?