First, Nagios monitoring host configuration (ip:192.168.7.249)
1, Installation Nrpe service
Decompression
[Root@nagios ~]# TAR-ZXVF nrpe-2.14.tar.gz
[Root@nagios ~]# CD nrpe-2.14
Compile
[[Root@nagios Nrpe-2.14]#./configure
Root@nagios nrpe-2.14]# make all
[Root@nagios nrpe-2.14]# make Install-plugin
Just run this step, because only Check_nrpe plug-ins are required
2, edit the Commands.cfg file to define the use of Nrpe
[Root@nagios ~]# Vim/usr/local/nagios/etc/objects/commands.cfg
Add the following on the last side:
# ' Check_nrpe ' command definition
Define Command{
Command_name Check_nrpe
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Description
Command_name Check_nrpe
Define the command name as Check_nrpe and use this name in Services.cfg.
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
This is the plug-in program that defines the actual operation. This command line is written in exactly the way Check_nrpe this command. Don't know how to use the Check_nrpe–h view
The $arg1$ parameter, followed by-C, is a test command passed to Nrpe Daemon, which has previously said that it must be one of the 5 commands defined in Nrpe.cfg. Use services.cfg in Check_nrpe! Take this argument with you!
3, configure monitoring objects (workstations and their services, etc.)
[Root@nagios ~]# Vim/usr/local/nagios/etc/nagios.cfg
Add under Cfg_file=/usr/local/nagios/etc/objects/localhost.cfg:
Cfg_file=/usr/local/nagios/etc/objects/services.cfg