Nagios monitoring Oracle (check_oracle_health)

Source: Internet
Author: User

Nagios's built-in Oracle monitoring check_oracle has fewer functions. You can use the check_oracle_health script written in perl.

1. Install check_oracle_health

Wget http://www.bkjia.com/system/systembak/2011/2/check_oracle_health-1.6.6.1.tar.gz

Wget http://www.bkjia.com/system/systembak/2011/2/check_oracle_health-1.6.3.tar.gz

Select any version (1.6.3 is used here)

Tar zxvf check_oracle_health-1.6.3.tar.gz

Cd check_oracle_health-1.6.3
. /Configure -- prefix =/usr/local/nagios/-- with-nagios-user = nagios -- with-nagios-gourp = nagios -- with-mymodules-dir =/usr/local/ nagios/libexec/-- with-mymodules-dyn-dir =/usr/local/nagios/libexec/

# Specifying users, user groups, and target paths
Make all

Make install

2. Set system environment variables

InRootEdit. bash_profile and insert the environment variable of the oracle user, which must be the same as that set in the. bash_profile file of the oracle user.

Export PATH
Unset USERNAME
PS1 = "\ [\ e [0m \] [\ u @ \ [\ e [32; 1 MB \] '/sbin/ifconfig eth0 | grep "inet addr" | sed-e "s/^. * inet addr :\(. * \) Bcast. * $/\ 1/"'\ [\ e [0m \] \ W] #"
Export PS1
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.1/db
Export PATH = $ PATH: $ ORACLE_HOME/bin
Export ORACLE_SID = qiyue

3. Install the oracle plug-in of perl

① Wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.609.tar.gz

Tar zxvf DBI-1.609.tar.gz

Cd DBI-1.609

Perl Makefile. PL
Make all

Make install
② Wget http://cpan.wenzk.com/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.24a.tar.gz

Tar-zxvf DBD-Oracle-1.24a.tar.gz
Cd DBD-Oracle-1.24
Perl Makefile. PL# If the root oracle environment variable is not set, an error is returned.

Make all

Make install

③ If an error is reported when running the script

Can't locate Time/HiRes. pm in @ INC (@ INC contains:/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
Wget http://www.perl.com/CPAN/modules/by-module/Time/Time-HiRes-01.02.tar.gz
Tar zxvf Time-HiRes-01.02.tar.gz

Cd Time-HiRes-01.02
Perl Makefile. PL
Make all
Make install

4. Test

Cd/usr/local/nagios/libexec

./Check_oracle_health -- connect = nagios -- username system -- password ora123 -- mode connected-users
OK-11 connected users | connected_users = 11, 50, 100

./Check_oracle_health -- connect = nagios -- username system -- password ora123 -- mode = tnsping
OK-connection established to nagios.

5. Other configurations are the same as those of nagios.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.