Sunday, May 26th 2013, 3:52am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to Monitoring-Portal.
Although this is a german monitoring forum, please don't hesitate to post in English. Nearly everybody here understands you and will answer in English as well.
If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form to register here or read more information about the registration process. If you are already registered, please login here.

ocular

Beginner

Posts: 21

Number of monitoring servers: 1

Nagios Version: 3

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 300

Number of services: 500

OS: Ubuntu/Debian/XP

Plugin Version: 1.5

NDO Version: 1

1

Tuesday, July 14th 2009, 8:54pm

check_oracle_health - Question

Hi!

Do you know if is it fundamental to have Oracle instant client installed with sdk and DBD::oracle module to run this script? Or if having only slqplus installed I can use all modes of this script?

I've installe instant client + sdk v11.1, but when I've tried to install dbd::oracle I always get the same error. I've defined all things, enviroment variables...tnsnames.ora... permissions... "perl Makefile.PL -V 11.1" don't return any error except:

Argument "6.30_01" isn't numeric in subroutine entry at Makefile.PL line 10
main::BEGIN() called at /usr/share/perl/5.8/ExtUtils/MakeMaker.pm line 10


... and with make or make install I got strange errors like:

/usr/lib/perl/5.8/CORE/sv.h:389: error: expected specifier-qualifier-list before âDIRâ
In file included from /usr/lib/perl/5.8/CORE/op.h:497,
from /usr/lib/perl/5.8/CORE/perl.h:2754,
from /usr/lib/perl5/auto/DBI/DBIXS.h:19,
from Oracle.h:52,
from Oracle.xs:1:
/usr/lib/perl/5.8/CORE/reentr.h:72:20: error: pwd.h: No such file or directory
/usr/lib/perl/5.8/CORE/reentr.h:75:20: error: grp.h: No such file or directory
/usr/lib/perl/5.8/CORE/reentr.h:85:26: error: crypt.h: No such file or directory
/usr/lib/perl/5.8/CORE/reentr.h:90:27: error: shadow.h: No such file or directory
In file included from /usr/lib/perl/5.8/CORE/op.h:497,
from /usr/lib/perl/5.8/CORE/perl.h:2754,
from /usr/lib/perl5/auto/DBI/DBIXS.h:19,
from Oracle.h:52,
from Oracle.xs:1:
/usr/lib/perl/5.8/CORE/reentr.h:612: error: field â_crypt_structâ has incomplete type

... So I'm tired to try this method. Is SQL*Plus the only requisite to run this script? :(

lausser

Professional

Posts: 1,462

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

2

Tuesday, July 14th 2009, 9:51pm

Hi,
you don't need to install the dbd:: oracle module.
The --method sqlplus parameter tells the plugin to send the sql statements with sqlplus instead.
Gerhard

Majed

Trainee

Posts: 112

Gender: male

Location: Minsk - Belarus

Occupation: system administrator

Number of monitoring servers: 3

Hobbies: football, cycling , chess , reading

Nagios Version: 3.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 30

Number of services: many

OS: gentoo

Plugin Version: 1.4.15

NDO Version: 3

3

Tuesday, August 16th 2011, 2:49pm

i disagree

you do need to install the DBD:: Oracle (without space) module otherwise you get a DBD related error @ oracle.pm
here is how to install DBD; it took me days to find this information.
first : perl -MCPAN -e shell then : install DBI then before issuing: install DBD:: Oracle
set the library path: such as this: (put your own installation path)
export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib:$LD_LIBRARY_PATH then:
LDPATH=/usr/lib/oracle/10.2.0.3/client/lib then:
C_INCLUDE_PATH=/usr/lib/oracle/10.2.0.3/client/include then:
TNS_ADMIN=/etc/oracle/ then finally issue:
C_INCLUDE_PATH=/usr/lib/oracle/10.2.0.3/client/include cpan -i DBD:: Oracle (without space)
after that my DBD was installed and worked but then i tested check oracle health as so:
./check_oracle_health --connect=10.1.1.247 --mode=tnsping
and i get the error
CRITICAL - cannot connect to 10.1.1.247. ORA-24327: need explicit attach before authenticating a user (DBD ERROR: OCISessionBegin)
i believe the connect string is not an ip address and something else except i don't know what, can someone help with this?

Posts: 7,238

Gender: male

Number of monitoring servers: 2

Nagios Version: 3.2.1

Icinga Version: Icinga 1.7.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: >70

Number of services: >200

OS: SLES11

Plugin Version: 1.4.15

Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18

4

Tuesday, August 16th 2011, 11:13pm

Have a look here.

Majed

Trainee

Posts: 112

Gender: male

Location: Minsk - Belarus

Occupation: system administrator

Number of monitoring servers: 3

Hobbies: football, cycling , chess , reading

Nagios Version: 3.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 30

Number of services: many

OS: gentoo

Plugin Version: 1.4.15

NDO Version: 3

5

Wednesday, August 17th 2011, 1:54pm

thanks

thanks for the reply but i already found that page yesterday. i learned there about --method=sqlplus
but anyway my problem is not solved. Sorry but i'm very much a newbie when it comes to oracle so here's the situation:
I have an oracle server at 10.1.1.247 and nagios at 10.1.1.212. i issued the command #su - oracle and then #sqlplus and i got the result that the oracle server is version : SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 17 15:29:57 2011
but on the nagios machine it has gentoo on it so i emerged the oracle client and it installed version 10.2.0.3
So would a 10 oracle client communicate with a version 11 server ?
next, i issued the command:
ps -ef | grep -i pmo
and got the result:
oracle 4815 1 0 Aug15 ? 00:00:26 ora_pmon_orcl
oracle 12238 11782 0 15:35 pts/1 00:00:00 grep -i pmo
from here i found out that the sid of oracle is orcl or is this not true?
so i tried without success to issue from command line the following command:
./check_oracle_health --connect=orcl --mode=tnsping --method=sqlplus
result:
CRITICAL - cannot connect to orcl. ERROR:ORA-12154: TNS:could not resolve the connect identifier specified .

./check_oracle_health --connect=Admin/oracle@orcl --mode=tnsping --method=sqlplus
result:
CRITICAL - cannot connect to Admin/***@orcl. ERROR:ORA-12154: TNS:could not resolve the connect identifier specified .

./check_oracle_health –connect ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.1.247)(PORT=1521))(CONNECT_DATA=(SID=orcl)))’ –user Admin –password oracle –mode=tnsping
result:
-bash: syntax error near unexpected token `('
any ideas on what i am doing wrong? or is there something special to do to communicate with the oracle server?
P.S username=Admin and password=oracle are not the username and password of a database on 10.1.1.247 just credentials to enter oracle through GUI but for some reason they don't work when i go to http://10.1.1.247:8080/

Posts: 7,238

Gender: male

Number of monitoring servers: 2

Nagios Version: 3.2.1

Icinga Version: Icinga 1.7.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: >70

Number of services: >200

OS: SLES11

Plugin Version: 1.4.15

Other Addons: NRPE 2.6, NSCA 2.7, PNP 0.4.14 / 0.6.18

6

Wednesday, August 17th 2011, 4:31pm

Quoted

Sorry but i'm very much a newbie when it comes to oracle
I'd expect that there should be an oracle admin at your location who could answer such questions 8| .

Quoted

i issued the command #su - oracle and then #sqlplus and i got the result that the oracle server is version : SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 17 15:29:57 2011
It's difficult to tell where you issued this command but I'd say the sqlplus' version is 11.2.0.2 and that is different from the version in the other posting (/usr/lib/oracle/10.2.0.3/client).
It should work anyhow. The Nagios user should have an oracle environment with ORACLE_HOME and some other variables set appropriately. Issuing "tnsping <oracle-sid>" on the Nagios server should return the correct tnsnames.ora values. If you are able to issue the check_oracle_health from the command line on the Nagios server successfully, then you should be sure to set the environment variables before you start the Nagios process (in the init script might be a good idea).

Majed

Trainee

Posts: 112

Gender: male

Location: Minsk - Belarus

Occupation: system administrator

Number of monitoring servers: 3

Hobbies: football, cycling , chess , reading

Nagios Version: 3.x

Distributed monitoring: Nein

Redundant monitoring: Nein

Number of hosts: 30

Number of services: many

OS: gentoo

Plugin Version: 1.4.15

NDO Version: 3

7

Friday, August 19th 2011, 1:26pm

well i don't have an oracle administrator, i've been asked to check a test oracle server for future testing for a customer.
i ended up downloading a new virtual box of oracle linux from the oracle.com and it has almost all passwords oracle.
after successfully installing oracle client basic, sdk, sqlplus (10.2.03) (server is 11.1) the dbi and dbd ofcourse after setting the correct export variables.
anyway here is the result of command:
[nagios@oracle11 libexec]$ ./check_oracle_health -mode tnsping -user nagios -password nagios -connect "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.248)(PORT = 1521))) (CONNECT_DATA = (SID = orcl) (SERVER = DEDICATED)))"
output:
OK - connection established to (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.248)(PORT = 1521))) (CONNECT_DATA = (SID = orcl) (SERVER = DEDICATED))).
then i read in the forum of labs.consol.de that you can specify sid in --connect if you define the string in tnsnames.ora so i searched for this file and found 2 sample files and a 3rd at /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin
so i edited it and now it looks like so:
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.248)(PORT = 1521))


ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.248)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

TTORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)

orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.248)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)))

then i issued the command:
[nagios@oracle11 libexec]$ ./check_oracle_health -mode tnsping -user system -password oracle -connect orcl
result:
CRITICAL - cannot connect to orcl. ORA-24327: need explicit attach before authenticating a user (DBD ERROR: OCISessionBegin)
so i think there is something to do with the tnsnames.ora yet
lastly, even though in the documentation it is said that the plugin doesn't work over the network and needs nrpe but issuing the command on the nagios server which had already the plugin installed produces ok result.
any ideas how to connect through only sid ?