Nagios comes with few oracle monitoring check_oracle functions. You can use the check_oracle_health script written in perl. 1. Install check_oracle_health.
Nagios comes with few oracle monitoring check_oracle functions. You can use the check_oracle_health script written in perl. 1. Install check_oracle_health.
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
Wget
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
Tar zxvf DBI-1.609.tar.gz
Cd DBI-1.609
Perl Makefile. PL
Make all
Make install
② Wget
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
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.