nagios自定义监控脚本接收参数传递

useradd nagios

passwd nagios


tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --prefix=/usr/local/nagios

make && make install


chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec




tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure --enable-command-args

make all

make install-plugin
make install-daemon
make install-daemon-config

make install-xinetd


修改nrpe.cfg:

dont_blame_nrpe=1 


/etc/init.d/xinetd restart //重启nrpe服务


services.cfg定义如下:

define service{
        use                     local-service
        host_name               test1234
        service_description     test1234
        check_command           check_nrpe!check_mg_jdbc -a test1234

        }

测试监控脚本:

#!/bin/bash
echo $1
exit 0

猜你喜欢

转载自blog.csdn.net/wo1769815/article/details/79613745