Nagios and Oracle

SMN

SMN

Soldato
Joined
2 Nov 2008
Posts
2,502
Location
The ether
Hi all,

Is anyone here using Nagios to monitor any Oracle databases? Im losing my mind trying to get check_oracle, check_oracle_health etc working from the Nagios Exchange.

Thanks,
Sam
 
That'd be amazing. Im having issues with it saying something along the lines of "ORACLE NOT KNOWN" or something, i think i need to declare / set some values first.
 
We're just using check_oracle_health:

http://exchange.nagios.org/directory/Databases/Plugins/Oracle/check_oracle_health/details

You set up a user on oracle for nagios with read access to some of the systables and then it connects over the network and grabs some key info.

Ours is reporting the following:


Code:
oraca
****dbab1 Login
OK	13-06-2012 11:57:20	13d 4h 46m 50s	1/3	OK - reply time 110 msec from ****dbab1 
Disk Space

OK	13-06-2012 11:58:03	13d 4h 49m 6s	1/3	Disks ok 
Oraca database Max processes
OK	13-06-2012 11:58:48	13d 4h 45m 17s	1/3	OK - 11.88% of process resources used 
Oraca database Max sessions
OK	13-06-2012 11:59:33	13d 4h 44m 36s	1/3	OK - 11.86% of session resources used 
Oraca flash recovery usage
OK	13-06-2012 11:57:20	13d 4h 43m 50s	1/3	OK - flra +FLASH has 99.96% free space left 
Ping
OK	13-06-2012 11:58:04	 2d 5h 52m 46s	1/3	PING OK - Packet loss = 0%, RTA = 7.65 ms 
SSH Server
OK	13-06-2012 11:58:49	13d 4h 49m 17s	1/3	SSH OK - OpenSSH_4.3 (protocol 2.0) 
Swap Space
OK	13-06-2012 11:59:35	13d 4h 48m 35s	1/3	Total: 12001Mb, Free: 11621Mb 
System Load

OK	13-06-2012 11:57:20	 0d 11h 3m 8s	1/3	OK - load average: 1.01, 1.02, 1.01 
TNS Server
OK	13-06-2012 11:58:04	13d 4h 46m 4s	1/3	OK - reply time 10 msec from *.*.*.*

A sample Nagios command snippet:

Code:
define command{
        command_name    check_db_sessions_oraca
        command_line    $USER1$/check_oracle_health --mode=session-usage --connect=****dbab1 --username=nagios --password=****** --warning=35 --critical=80
        }
 
Last edited:
Awesome. What i dont get though, is:

/check_oracle_health --mode=session-usage --connect=****dbab1 --username=nagios --password=****** --warning=35 --critical=80

Where in that is the actual Host IP/hostname specified?
 
Awesome. What i dont get though, is:

/check_oracle_health --mode=session-usage --connect=****dbab1 --username=nagios --password=****** --warning=35 --critical=80

Where in that is the actual Host IP/hostname specified?


Never used it but I imagine here:
Code:
--connect=****dbab1

specified in your /etc/hosts file or just give it an IP
 
We have a tnsnames.ora file which specifies the instances, should be able to get away with installing instant client on the Nagios machine and then copying the tnsnames.ora file across from the DB
 
Yeah, well i installed the client but when i did a "find / -name .ora 2> /dev/null" it didnt find anything. Do you know where it is stored generally?
 
On a Redhat box, it's normally /usr/lib[64]/oracle/network/admin/tnsnames.ora if you installed from RPM. On a server it's usually buried in the Oracle install directory. RTFM :)

Edit: It won't be there on a fresh instant client machine, you should source it from the DB itself.
 
Last edited:
OK i got it working thanks guys! Turns out i was doing it wrong, so i found the file on sourceforge, did the ./configure (with correct options) and then make/make install, but this time instead of then going to the "plugins" folder in the make directory, i went to /usr/local/nagios and ran that script, and once i got DBD::Oracle installed, it worked great :)
 
Back
Top Bottom