插件下载地址
https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_ps-2Esh/details
以监控一个java程序为例:
被监控端
把check_ps.sh放到被监控的的/usr/local/nagios/libexec/下
#vim /usr/local/nagios/etc/nrpe.cfg
command[check_UnZIP]=/usr/local/nagios/libexec/check_ps.sh -p "Linux_Sync_UnZIP.JAR"
ps:具体参数可以check_ps.sh -h查看,设置一些具体伐值来报警,我这里只是监控进程是否存在
#killall nrpe
#/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
监控服务器
define service{
use local-service
host_name 10.10.10.10
service_description Linux_Sync_UnZIP
check_command check_nrpe!check_UnZIP
notifications_enabled 0
}
#/etc/init.d/nagios restart
如果想配合pnp4nagios出图的话,把下载页面的check_ps.php下载到监控服务器,放到/usr/local/pnp4nagios/share/templates目录下即可
https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_ps-2Esh/details
以监控一个java程序为例:
被监控端
把check_ps.sh放到被监控的的/usr/local/nagios/libexec/下
#vim /usr/local/nagios/etc/nrpe.cfg
command[check_UnZIP]=/usr/local/nagios/libexec/check_ps.sh -p "Linux_Sync_UnZIP.JAR"
ps:具体参数可以check_ps.sh -h查看,设置一些具体伐值来报警,我这里只是监控进程是否存在
#killall nrpe
#/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
监控服务器
define service{
use local-service
host_name 10.10.10.10
service_description Linux_Sync_UnZIP
check_command check_nrpe!check_UnZIP
notifications_enabled 0
}
#/etc/init.d/nagios restart
如果想配合pnp4nagios出图的话,把下载页面的check_ps.php下载到监控服务器,放到/usr/local/pnp4nagios/share/templates目录下即可
来源:https://www.cnblogs.com/wangshui898/p/10324027.html