Page 1 of 1

Oracle Serverspace Monitor an Oracle Server error

Posted: Wed Jun 01, 2016 9:24 am
by aulusow
Hi,
I received the error below for all services after set up a host to monitor Oracle Server using the wizard. Please advise.
(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''

Nagios XI 5.2.8
Oracle Serverspace Monitor an Oracle Server version: 1.5.1

[root@ ~]# head -25 /usr/local/nagios/libexec/check_oracle_health
#! /usr/bin/perl -w

my %ERRORS=( OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 );
my %ERRORCODES=( 0 => 'OK', 1 => 'WARNING', 2 => 'CRITICAL', 3 => 'UNKNOWN' );
package DBD::Oracle::Server::Instance::SGA::DataBuffer;

use strict;

our @ISA = qw(DBD::Oracle::Server::Instance::SGA);


sub new {
my $class = shift;
my %params = @_;
my $self = {
handle => $params{handle},
sum_physical_reads => undef,
sum_physical_reads_direct => undef,
sum_physical_reads_direct_lob => undef,
sum_session_logical_reads => undef,
hitratio => undef,
warningrange => $params{warningrange},
criticalrange => $params{criticalrange},
};
bless $self, $class;

Many Thanks,

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Wed Jun 01, 2016 10:19 am
by rkennedy
Can you please post the entire plugin for us to look at?

Additionally, where are you seeing this error? -

Code: Select all

(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
Lastly, please show us the full check_command for the service that is encountering this error.

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Wed Jun 01, 2016 10:32 am
by aulusow
Hi,
Please see attached file.
I am seeing the error on the portal NagiosXI.
Many Thanks

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Wed Jun 01, 2016 4:38 pm
by tgriep
Can you login to the XI server, run the following command and post the output?

Code: Select all

/usr/local/nagios/libexec/check_oracle_health --help
Can you look at this document for installing the Oracle plugin and it's requirements to see if this resolves the issue?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Thanks

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 9:42 am
by aulusow
Hi,
I install the oracle client. Now I am getting different error as below:

[root@ client64]# /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client/ /usr/local/nagios/libexec/check_oracle_health --connect 'IP Address/SID' --username 'nagiosadmin' --password 'removed' --mode tnsping
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 4162.
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 6166.
CRITICAL - cannot connect to IP Address/SID. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
at (eval 14) line 3.
Compilation failed in require at (eval 14) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/nagios/libexec/check_oracle_health line 4755.

Please advise. Many Thanks

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 10:46 am
by aulusow
Hi,
I fixed the previous error. Now I have new error as below.
[root@ etc]# /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client/ /usr/local/nagios/libexec/check_oracle_health --connect 'IP ADDRESS:1521/SID' --username 'nagiosadmin' --password '' --mode tnsping
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 4162.
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 6166.
CRITICAL - cannot connect to 192.168.49.18:1521/CANADA. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)

Please advise.
Many Thanks

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 11:26 am
by tgriep
The cannot connect error is usually caused by the port 1521 not open for connections to the server or the SID is incorrect.
Can you verify that those are correct?
To see if the port is open, you can run this command from the Nagios server

Code: Select all

nmap 192.168.49.18 -p 1521
It should come back with the port state as open.

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 1:22 pm
by aulusow
root@nagios ~]# nmap 192.168.49.18 -p 1521

Starting Nmap 6.47 ( http://nmap.org ) at 2016-06-02 14:20 EDT
Nmap scan report for (192.168.49.18)
Host is up (0.00047s latency).
PORT STATE SERVICE
1521/tcp open oracle

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

The SID is correct as well.

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 1:28 pm
by aulusow
It's working now. The SID was incorrect.
[root@nagios ~]# /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client/ /usr/local/nagios/libexec/check_oracle_health --connect '192.168.49.18:1521/CANADA.ad.bbm.ca' --username 'nagiosadmin' --password '1qaz!QAZ' --mode tnsping
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 4162.
Use of qw(...) as parentheses is deprecated at /usr/local/nagios/libexec/check_oracle_health line 6166.
OK - connection established to 192.168.49.18:1521/CANADA.ad..

The SID has to be fully qualified name.

Thank You! for your support.

Re: Oracle Serverspace Monitor an Oracle Server error

Posted: Thu Jun 02, 2016 1:50 pm
by mcapra
I am glad you were able to find a solution! Is it ok if we lock this thread and mark it as resolved?