Nagios自带的Oracle监控check_oracle功能较少,可以采用perl写的check_oracle_health脚本
1、安装check_oracle_healthwget http://www.linuxidc.com/system/systembak/2011/2/check_oracle_health-1.6.6.1.tar.gzwget http://www.linuxidc.com/system/systembak/2011/2/check_oracle_health-1.6.3.tar.gz版本任意选(此处使用1.6.3)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/#指定用户、用户组以及目标路径等
make allmake install
2、设定系统环境变量在root下,编辑.bash_profile,插入oracle用户的环境变量,要和oracle用户的.bash_profile文件中设置的一样export PATH
unset USERNAME
PS1="[e[0m][u@[e[32;1m]`/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、安装perl的oracle插件① 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 #此处如果之前不设定root的oracle环境变量会报错 make all make install
③ 如果在运行脚本时报错 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、测试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、其余配置和nagios配置相同Oracle归档模式的定义以及修改方法Solaris 安装Oracle遇到的小问题相关资讯 Oracle教程 Nagios
- Linux下Nagios+PNP4Nagios的安装与 (今 08:25)
- CentOS7安装Nagios并配置出图详解 (12/02/2015 19:36:58)
- Oracle中纯数字的varchar2类型和 (07/29/2015 07:20:43)
| - Nagios 监控 SNMP 温度计 (08月21日)
- CentOS 6.7 安装Nagios教程 (11/23/2015 10:36:49)
- Oracle教程:Oracle中kill死锁进程 (07/29/2015 07:18:28)
|
本文评论 查看全部评论 (0)