Nagios is an open-source, free network monitoring tool that effectively monitors Windows, Linux and UNIX host status, network devices such as switch routers, printers, and more. Send mail or SMS alarm when the system or service status is abnormal the first time to notify the site operators, after the status of the resumption of normal mail or SMS notification.
Nsclient:windows 7 Monitoring plug-in
Nrpe is an extension of the monitoring software Nagios, which is used on monitored servers to provide some local information about the server to the Nagios monitoring platform. For example, CPU load, memory usage, hard disk usage, and so on. Nrpe can be called the Nagios for Linux client.
1. Install the SOFTWARE:
Yum Install-y gcc*
Yum install-y httpd mysql mysql-server mysql-devel php php-mysql glibc glibc-common *gd*
2. Add Users:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BC/wKiom1lLpCWQvAyIAADC0Car52U315.png "title=" 1.png "alt=" Wkiom1llpcwqvayiaadc0car52u315.png "/>
3. Compile and install Nagios:
The package used for this installation is Nagios.iso
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/BC/wKiom1lLpCaiA5aHAACYcIFN4T8892.png "title=" 2.png "alt=" Wkiom1llpcaia5ahaacycifn4t8892.png "/>
TAR-XVF nagios-3.3.1.tar.gz-c/root/
And then into the Nagios directory.
./configure--with-command-group=nagcmd--enable-event-broker
Make all
Make install
Make Install-init
Make Install-commandmode
Make Install-config
Make install-webconf
4. Generate the password configuration file:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/BC/wKioL1lLpCniYZYcAAOOZLVRTG4266.png "title=" 3.png "alt=" Wkiol1llpcniyzycaaoozlvrtg4266.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/99/BC/wKiom1lLpCqzspWjAAB0DRr-q6E760.png "title=" 4.png "alt=" Wkiom1llpcqzspwjaab0drr-q6e760.png "/>
Open Apache Service
5. Browser View:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/99/BC/wKioL1lLpCvR0JYTAADurosBLdk088.png "title=" 5.png "alt=" Wkiol1llpcvr0jytaadurosbldk088.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BC/wKioL1lLpCyQCVGIAAI2ze3lENc864.png "title=" 6.png "alt=" Wkiol1llpcyqcvgiaai2ze3lenc864.png "/>
6. Install the plugin Manager nagios-plugins:
TAR-XVF nagios-plugins-1.4.14.tar.gz-c/root/
Go to Directory compilation installation (nagios-plugins-1.4.14)
./configure--with-nagios-user=nagios--with-nagios-group=nagios--with-mysql--enable-perl-modules
Make && make install
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/BC/wKiom1lLpC2yankEAAA_mH_yYaE415.png "title=" 7.png "alt=" Wkiom1llpc2yankeaaa_mh_yyae415.png "/>
Check the configuration file for errors:
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/99/BC/wKiom1lLpC6RtxFqAAIYObzC2Ws382.png "title=" 8.png "alt=" Wkiom1llpc6rtxfqaaiyobzc2ws382.png "/>
Restarting the Nagios service
Now go to the browser check:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BC/wKioL1lLpDCQmPNxAAHC0u6ia1Y561.png "title=" 9.png "alt=" Wkiol1llpdcqmpnxaahc0u6ia1y561.png "/>
Monitoring of Windows hosts:
7.Windows installation nsclient:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/99/BC/wKioL1lLpDLxXOAmAAGzecC8FyY772.png "title=" 10. PNG "alt=" Wkiol1llpdlxxoamaagzecc8fyy772.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/99/BC/wKiom1lLpDKBC0y4AAB9K9qLhbA653.png "title=" 11. PNG "alt=" Wkiom1llpdkbc0y4aab9k9qlhba653.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/BC/wKioL1lLpDOTM4CWAAB4O1VjuUE845.png "title=" 12. PNG "alt=" Wkiol1llpdotm4cwaab4o1vjuue845.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/BC/wKiom1lLpDTAegJoAABv3EBM8-E480.png "title=" 13. PNG "alt=" Wkiom1llpdtaegjoaabv3ebm8-e480.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/99/BC/wKiom1lLpDWgPPlaAAB8BPrPazg021.png "title=" 14. PNG "alt=" Wkiom1llpdwgpplaaab8bprpazg021.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/99/BC/wKioL1lLpDaSCu4bAAG02zjB8Dk250.png "title=" 15. PNG "alt=" Wkiol1llpdascu4baag02zjb8dk250.png "/>
Server Settings monitoring windows:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/BC/wKiom1lLpEPgDRPhAAReo0EOaR8584.png "title=" 16. PNG "alt=" Wkiom1llpepgdrphaareo0eoar8584.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/BC/wKioL1lLpEjjkXmyAAUVyzzR7wY777.png "title=" 17. PNG "alt=" Wkiol1llpejjkxmyaauvyzzr7wy777.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BC/wKioL1lLpEyRufLYAAR5EX-5NsI375.png "title=" 18. PNG "alt=" Wkiol1llpeyruflyaar5ex-5nsi375.png "/>
Detect and restart Nagios
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
Service Nagios Restart
Browser View again:
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/99/BC/wKiom1lLpE7h8wRMAAHb0XmEYns665.png "title=" 19. PNG "alt=" Wkiom1llpe7h8wrmaahb0xmeyns665.png "/>
Linux Client monitoring:
Monitoring of 8.Linux clients:
On top of Linux customers:
Installation Environment Support:
Yum install-y gcc* OpenSSL openssl-devel
Compiling and installing Nagios-plugins
TAR-XVF nagios-plugins-1.4.14.tar.gz
Need to create user
Useradd Nagios
./configure--with-nagios-user=nagios--with-nagios-group=nagios
Make all
Make install
Compiling and installing nrpe-2.8.1.tar.gz
./configure--enable-ssl--with-ssl-lib=/usr/lib
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/BC/wKioL1lLpFSh3mWoAAadzC79s6k750.png "title=" 20. PNG "alt=" Wkiol1llpfsh3mwoaaadzc79s6k750.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/BC/wKiom1lLpFiiRUJTAAR3zKNnVt8183.png "title=" 21. PNG "alt=" Wkiom1llpfiirujtaar3zknnvt8183.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/BC/wKioL1lLpFyRDmytAAD95oQunOU947.png "title=" 22. PNG "alt=" Wkiol1llpfyrdmytaad95oqunou947.png "/>
Back to server side:
Install Nagios-plugins (installed)
Installing Nrpe
TAR-XVF nrpe-2.8.1.tar.gz-c/root/
./configure--enable-ssl--with-ssl-lib=/usr/lib
Make all
Make Install-plugin
Do not enable daemon and daemon-config
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/99/BC/wKiom1lLpF7TsAiBAAIxXk6tYsM651.png "title=" 23. PNG "alt=" Wkiom1llpf7tsaibaaixxk6tysm651.png "/>
Define Host{
Use Linux-server
HOST_NAME Nagios
Address 192.168.115.174
}
Define Service{
Use Generic-service
HOST_NAME Nagios
Service_description Check-load
Check_command Check_nrpe!check_load
}
Define Service{
Use Generic-service
HOST_NAME Nagios
Service_description check-users
Check_command check_nrpe!check_users
}
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/99/BC/wKiom1lLpGKgAMIAAAQMu1nW25I128.png "title=" 24. PNG "alt=" Wkiom1llpgkgamiaaaqmu1nw25i128.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/99/BC/wKioL1lLpGbTywXqAAUC3PQM4Yc608.png "title=" 25. PNG "alt=" Wkiol1llpgbtywxqaauc3pqm4yc608.png "/>
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
Service Nagios Restart
Check your browser again:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/99/BC/wKiom1lLpGixpu86AAH140U-Frk691.png "title=" 26. PNG "alt=" Wkiom1llpgixpu86aah140u-frk691.png "/>
9. Monitoring of services:
Linux client:
Install the Software:
Yum install-y MySQL Mysql-server
Service mysqld Start
Mysqladmin-uroot password ' 123456 '
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/BC/wKioL1lLpG3Cu1JlAAS-s4bUGfA884.png "title=" 27. PNG "alt=" Wkiol1llpg3cu1jlaas-s4bugfa884.png "/>
Server-side:
To test the connection:
/usr/local/nagios/libexec/check_mysql-h 192.168.115.174-u nagios-d nagios-p 123456
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/99/BC/wKioL1lLpi2CHiOuAAB4DdanRZQ312.png "title=" 1.png "alt=" Wkiol1llpi2chiouaab4ddanrzq312.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/BC/wKiom1lLpG6RLDHVAAHgh9D-UZc861.png "title=" 28. PNG "alt=" Wkiom1llpg6rldhvaahgh9d-uzc861.png "/>
Define Host{
Use Linux-server
HOST_NAME Mysql
Address 192.168.115.174
}
Define Service{
HOST_NAME Mysql
Check_period 24x7
Max_check_attempts 2
Normal_check_interval 1
Retry_check_interval 1
Contact_groups Admins
Notification_interval 5
Notification_period 24x7
Notification_options W,u,c,r
Check_command Check_mysql
}650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/BC/wKioL1lLpHKDlKsFAAUMnQe-kvQ452.png "title=" 29. PNG "alt=" Wkiol1llphkdlksfaaumnqe-kvq452.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/BC/wKiom1lLpHWDVA6EAANhc4QhOco260.png "title=" 30. PNG "alt=" Wkiom1llphwdva6eaanhc4qhoco260.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/99/BC/wKioL1lLpHejL9B9AAJWkJcTbSQ186.png "title=" 31. PNG "alt=" Wkiol1llphejl9b9aajwkjctbsq186.png "/>
Service Nagios Restart
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BC/wKiom1lLpHnjvcF6AAIKNolX6lc876.png "title=" 32. PNG "alt=" Wkiom1llphnjvcf6aaiknolx6lc876.png "/>
This article is from the "Change life Start Fresh." blog, be sure to keep this source http://ahcwy.blog.51cto.com/9853317/1941079
Nagios+nsclient+nrpe Environment Construction