yum -y install openssl-devel
1、安装监控插件
useradd nagios
groupadd nagcmd
usermod -G nagcmd nagios
tar -zxvf nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14;
./configure --with-nagios-user=nagios --with-nagios-group=nagcmd && make && make install
2、安装nrpe
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure && make && make install
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
vim s2.cfg
define service{
use local-service
host_name s2
service_description nrpe
check_command check_nrpe!check_nrpe
}
注释下面的内容
# Define an optional hostgroup for Linux machines
#define hostgroup{
# hostgroup_name linux-servers ; The name of the hostgroup
# alias Linux Servers ; Long name of the group
# members s2 ; Comma separated list of hosts that belong to this group
# }
/usr/local/nagios/etc/objects
cp localhost.cfg s2.cfg
vim s2.cfg
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name s2
alias s2
address 127.0.0.1
}