nagios监控weblogic
1 被监控端同样需要安装nrpe及nagios-plugins的插件
2 配置被监控端的nrpe 服务
2.1修改 /usr/local/nagios/etc/nrpe.cfg 文件。
加入以下内容
-
command[check_webpage]=/usr/local/nagios/libexec/check_http -I 192.168.1.123 -p 7001 -u /console/login/LoginForm.jsp
10.2.2 在本机检查check_http配置:
-
[root@rhel6 libexec]# /usr/local/nagios/libexec/check_http -I 192.168.1.123 -p 7001 -u /console/login/LoginForm.jsp
-
HTTP OK: HTTP/1.1 200 OK - 3405 bytes in 0.012 second response time |time=0.012183s;;;0.000000 size=3405B;;;0
2.3 启动被监控机上的nrpe
启动 NRPE 守护进程:
-
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
2.4 将此命令加入 /etc/rc.local
以便开机自动启动。
-
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local
2.5 检查 NRPE 是否正常:
在被监控机上
-
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
查看相应的端口:
防火墙开启5666 允许局域网IP或固定IP连接
在监控主机上
-
/usr/local/nagios/libexec/check_nrpe -H 192.168.1.123 $目标主机地址(被监控端地址)
都应该可以输出 NRPE 的版本: NRPE v2.12
3 配置nagios监控端
3.1 在 nagios/etc/objects 添加weblogic 主机配置文件:app1.cfg
-
cd /usr/local/nagios/etc/objects/
-
vim app1.cfg
-
define host {
-
use linux-server
-
host_name weblogic
-
alias Weblogic 12c
-
address 192.168.1.123
-
}
-
define service {
-
use generic-service
-
host_name weblogic
-
service_description weblogic Check
-
check_command check_nrpe!check_webpage
-
}
3.2 把app1.cfg添加到nagios主机:
-
echo "cfg_file=/usr/local/nagios/etc/objects/oracle.cfg" >> /usr/local/nagios/etc/nagios.cfg
3.3检查nagios配置文件并重新启动nagios:
-
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
重启nagios
阅读(2451) | 评论(0) | 转发(0) |