• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Nagios监控Oracle(check_oracle_health)

mysql 搞代码 4年前 (2022-01-09) 26次浏览 已收录 0个评论

Nagios自带的oracle监控check_oracle功能较少,可以采用perl写的check_oracle_health脚本1、安装check_oracle_health

Nagios自带的Oracle监控check_oracle功能较少,,可以采用perl写的check_oracle_health脚本

1、安装check_oracle_health

wget

wget

版本任意选(此处使用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 all

make 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

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 #此处如果之前不设定root的oracle环境变量会报错

make all

本文来源gaodai^.ma#com搞#代!码网

make install

③ 如果在运行脚本时报错

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、测试

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配置相同


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Nagios监控Oracle(check_oracle_health)
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址