Error while monitoring a Oracle Database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

Yes we tried with that too: /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 ./check_oracle_health --connect "xx.xx.xx.xx:1521" --username dbtestusr --password "dbtestpwd" --name AMOSEVAL --mode tablespace-usage --warning 90 --critical 98

There is no Output
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error while monitoring a Oracle Database

Post by scottwilkerson »

I'd like you to perform a test of a different connect method replacing the xxx.xxx.xxx.xxx and username/password with appropriate values

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 ./check_oracle_health --connect '--connect='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521))(CONNECT_DATA=(SID=AMOS)))' --username dbtestusr --password 'dbtestpwd' --mode tablespace-usage --warning 90 --critical 98
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

I have tried the new command too: Still no OUTPUT.
The strange thing is if I replace the IP, username and password with dummy string still there is no output. I was expecting some error message such as IP not reachable or username/password mismatch.

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 ./check_oracle_health --connect '--connect=''(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.202.23.16)(PORT=1521))(CONNECT_DATA=(SID=AMOSEVAL)))' --username dbtestusr --password 'dbtestpwd' --mode tablespace-usage --warning 90 --critical 98
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

HI

I am getting following error now.
CRITICAL - cannot connect to (DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.x.x.x)(PORT = 1521)))(CONNECT_DATA =(SID = amoseval))). ORA-21561: OID generation failed (DBD ERROR: OCISessionBegin)

same err is there even we tried with --mode tnsping

# env |grep ORACLE is not giving any result

what needs to be done to include the necessary things like Oracle_home etc under env
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

One more info ,

under /usr/lib/oracle/11.2/client64/network/admin do we need to add/create files like sqlnet.ora tnsnames.ora and listener.ora under linux box hosting nagios ?
At Client end server we already have included amoseval db entry under listener and tnsnames
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

Dear Team ,
Our DB team has done fine tune and here is the detailed output.
>Following Plugins are working fine

[root@oslms018 libexec]# ./check_oracle_health --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521)))(CONNECT_DATA =(SID = amoseval)))" --username xxxx --password "xxxxx" --name amoseval --mode sga-data-buffer-hit-ratio
OK - SGA data buffer hit ratio 99.33% | sga_data_buffer_hit_ratio=99.33%;98:;95:


2:10:26 PM: Sanjeev Kumar Rathi/LHC: [root@oslms018 libexec]# ./check_oracle_health --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521)))(CONNECT_DATA =(SID = amoseval)))" --username xxxx --password "xxxx" --name = amoseval --mode connected-users
OK - 5 connected users | connected_users=5;50;100


Table Space utilization is still not working.Getting following error

[root@oslms018 libexec]# ./check_oracle_health --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.202.23.16)(PORT = 1521)))(CONNECT_DATA =(SID = amoseval)))" --username dbtestusr --password "dbtestpwd" --name amoseval --mode tablespace-usage --warning 80 --critical 90
bumm Can't call method "execute" on an undefined value at ./check_oracle_health line 4895.
Can't use an undefined value as an ARRAY reference at ./check_oracle_health line 4909.



Please check my previous 3 replies also so you can get the idea of the errors we faced.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error while monitoring a Oracle Database

Post by scottwilkerson »

I think we are getting closer to resolving this, you would need to replace nagios in the quote below with the actual user account your are using

Found this same issue on the plugin developers homepage
http://labs.consol.de/lang/en/nagios/ch ... omment-972
when running the following command:

./check_oracle_health –connect REMOTE –username $ORAUSER –password $ORAPWD –mode tablespace-usage –tablespace USERS

I get the following error message.

Use of uninitialized value in split at /usr/lib/nagios/plugins/check_oracle_health line 3924. bumm Can’t call method “execute” on an undefined value at /usr/lib/nagios/plugins/check_oracle_health line 4230.

Can’t use an undefined value as an ARRAY reference at /usr/lib/nagios/plugins/check_oracle_health line 4242.

and now I’m clue less what todo? can you assist me on this one
Response
Did you give the necessary privileges to your ORAUSER?

Code: Select all

CREATE USER nagios IDENTIFIED BY oradbmon; 
GRANT CREATE SESSION TO nagios;
GRANT SELECT any dictionary TO nagios;
GRANT SELECT ON V_$SYSSTAT TO nagios;
GRANT SELECT ON V_$INSTANCE TO nagios;
GRANT SELECT ON V_$LOG TO nagios;
GRANT SELECT ON SYS.DBA_DATA_FILES TO nagios;
GRANT SELECT ON SYS.DBA_FREE_SPACE TO nagios;
You also can create an empty file /tmp/check_oracle_health.trace with the touch-command. As long as this file exists, check_oracle_health will write debugging messages into it. You should see the sql statements sent to the database server and the responses. Maybe this gives you an idea what’s wrong
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: Error while monitoring a Oracle Database

Post by HAL »

Hi,
We have done that too. Still we are facing the same issue> Ouput is NULL.

Can you please confirm if the env should hold any value on the Nagios server? our current env file is 0kb....
Could you please also reconfirm if there has to be any entries created on Nagios server side for tablespace monitoring?

Also please check if the following is correct?
[root@oslms018 ~]# cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

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

[root@oslms018 ~]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/11.2/client64:/usr/lib/oracle/11.2/client64:/usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/11.2/client64/network/admin

[root@oslms018 ~]# echo $ORACLE_HOME
/usr/lib/oracle/11.2/client64
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error while monitoring a Oracle Database

Post by scottwilkerson »

A couple things to point out, the commands from Nagios are going to run under the nagios user and not have an environment setup, which is why we recommend setting up the call to the plugin as such

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 ./check_oracle_health
That said, it would also be possible to add the paths above in the top of the check_oracle_health script itself.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cokj72
Posts: 47
Joined: Thu Jul 11, 2013 8:40 am

Re: Error while monitoring a Oracle Database

Post by cokj72 »

I put this string
/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64

in the files check_oracle and check_oracle_health

and the error became (null),
after update Oracle Serverspace version 1.4 the monitoring is OK (I monitoring 3 different DB Oracle...)

I remove 1 DB Server Monitoring and reconfigure with wizard, bat the problem persists:
Locked