Nagios Oracle health plugin
This is more a memo than an article. A quick and dirty check_oracle_health plugin installation, with prerequires.
Developped by Gerhard Lausser, an active Shinken developper with Jean Gabès.
Like most of Nagios plugins, it’s in Perl language and it’s use DBD::Oracle module, and this module need an Oracle client.
Oracle Instant Client
You have to create a fucking Oracle account… Yes I know you think :
“What’s this great article ?! Proprietary software are just awesome !”.
Go to Oracle Instant Client Downloads Page. Get the Instant Client Package – Basic and sdk.
For the story, i have fucked my brain during three hours cause I have download the Instant Client Package – Basic Lite and try to work with a Western American charset database… And of course, Basic Lite does not support it.
Derp.
wget http://notpossiblecauseofniceoraclelinkwhichdoestnotallowyoutowgetit.fu
unzip instantclient-basiclite-linux.x64-11.2.0.3.0.zip
unzip instantclient-sdk-linux.x64-11.2.0.3.0.zip
mv instantclient_11_2 /opt
DBD::Oracle
Get module sources and compile it.
wget http://search.cpan.org/CPAN/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.32.tar.gz
tar xvf DBD-Oracle-1.32.tar.gz
cd !$
DBD::Oracle module need path to Oracle Instant Client.
export ORACLE_HOME=/opt/instantclient_11_2
export LD_LIBRARY_PATH=$ORACLE_HOME
perl Makefile.PL -V 11.2
make
make install
Tnsnames.ora
This file contain informations about your different databases.
mkdir -p /opt/instantclient_11_2/network/admin
vim !$/tnsnames.ora
This is and example of tnsnames.ora file :
<addressname> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
)
(CONNECT_DATA =
(SERVICE_NAME = <sid>)
)
)
check_oracle_health
To finish, we have to install the Nagios plugin.
wget http://labs.consol.de/wp-content/uploads/2011/09/check_oracle_health-1.7.3.tar.gz
tar xvf check_oracle_health-1.7.3.tar.gz
cd !$
./configure
make
make install
That’s all !
You should follow @socketubs on twitter right now
Because who wouldn't want to keep tabs on this passionate software developer, food connoisseur, music fanatic, and outdoorsman?