We have completed the configuration of the monitored side. Let's go back to the Nagios monitor configuration to complete the monitoring of the server.
1, install Nrpe
TAR-ZXVF nrpe-2.12.tar.gz-c/usr/src/
cd/usr/src/nrpe-2.12/
Ls
./configure
Make && make install
Make Install-plugin
/usr/local/nagios/libexec/check_nrpe-h 192.168.10.147//See if the connection is monitored successfully by the server. Success will show the version number of Nrpe
2. See if the commands in our definition are in command.cfg, no words need to be redefined
cd/usr/local/nagios/etc/objects/
Vim Command.cfg
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/44/57/wKioL1Pg5JiT7-P_AAXAYB0mfZQ419.jpg "title=" 45e$c ( ]]iwx_6zgge]8srz5.jpg "alt=" Wkiol1pg5jit7-p_aaxayb0mfzq419.jpg "/>
3,CP a configuration file of our monitoring host, our native configuration file is Localhost.cfg
CP Localhost.cfg Webserver.cfg
Vim webserver.cfg//replace localhost with host name webserver
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/44/57/wKiom1Pg5L7CzqpzAAfXnyLqztA446.jpg "title=" ' CA0 ' 5p4n_swq4]af[53dua.jpg "alt=" Wkiom1pg5l7czqpzaafxnylqzta446.jpg "/>
Write the address above to the IP addresses of the server being monitored.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/44/57/wKiom1Pg5T2x3KeGAAEw9Mskv-U974.jpg "title=" ~bl4jt ) fml[7}l2t~nka17h.jpg "alt=" Wkiom1pg5t2x3kegaaew9mskv-u974.jpg "/>
Change the name of the group, or you will get an error when you start it, prompt for duplicate names, or add webserver to other groups.
Some service monitoring based on public network do not need to change for example, ssh,http,ftp,ping and so on do not need changes. Some of the information we have to execute on the monitored server to get the status of the monitored server needs to be changed. For example, check the number of user logins on the monitored side, hard disk usage, swap usage, total process count, system load, etc.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/44/57/wKiom1Pg53HAoeQyAAdW4abiWqg111.jpg "title=" 0l%u} ( 6]}o2h1p~hg_{]894.jpg "alt=" Wkiom1pg53haoeqyaadw4abiwqg111.jpg "/>
VIM/USR/LOCAL/NAGIOS/ETC/NAGIOS.CFG//Load Webserver.cfg in the main configuration file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/44/57/wKiom1Pg6EizlYNzAAKnmDnMuRs584.jpg "title=" 8a]~mm ' Hzb2wnk@t$ (~t9va.jpg "alt=" Wkiom1pg6eizlynzaaknmdnmurs584.jpg "/>
3,service Nagios Restart
Visit Http://192.168.10.145/nagios to view
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/44/58/wKioL1Pg6rSyY4WWAAmCUpAGuNU607.jpg "title=" CY4WW} 6BAZ (6LB ']t%@i~ks.jpg "alt=" Wkiol1pg6rsyy4wwaamcupagunu607.jpg "/>
This article is from "Linux rookie" blog, please be sure to keep this source http://ludihua.blog.51cto.com/4601284/1536160