The previous section implements monitoring of remote Linux servers and related services using the Nrpe+nagios-plugin plugin, which will focus on how to use Nagios to implement monitoring configurations for remote Windows hosts.
First, the monitoring end of the installation nsclient++
Download Nsclinet++:https://nchc.dl.sourceforge.net/project/nscplus/nscplus/nsclient%2b%2b%200.4.1/nscp-0.4.1.73-x64.msi
The monitored Windows hosts download and install the relevant nsclinet++ software and follow the prompts to install it.
and release nsclinet++ Port 12489 and add a predefined policy for shared files and printers otherwise, the host status is down, and the service is OK;
Two, Nagios monitoring side configuration
[[email protected] objects]# /usr/local/nagios/libexec/check_nt -h 192.168.31.20 -p 12489 -V UPTIMEcheck_nt v2.2.1 (nagios-plugins 2.2.1) [[email Protected] ~]# vim /usr/local/nagios/etc/nagios.cfg cfg_file=/usr/local/nagios/etc/objects /windows.cfg ; Adding a window monitor template [[Email protected] objects] # vim windows.cfg define host{ use windows-server ; inherit default values from a template host_name winserver ; the name we ' re giving to this host alias my windows server ; A longer name associated with the host address 192.168.31.20 ; ip address of the host (monitored Windows host address) }[[email protected] objects]# /usr/local/ nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg [[email protected] objects]# service nagios restart
Web-Side Monitoring validation
Iii. Configuring Nagios Mail Alerts
Nagios Email alerts can be set up directly using the SendMail tool that comes with the system, with the following details:
[[email protected] objects]# yum-y install sendmail[[email protected] objects]# service SendMail restart[[email protected ] objects]# chkconfig sendmail on[[email protected] objects]# vim/usr/local/nagios/etc/objects/contacts.cfg
define contact{ contact_name nagiosadmin ; Short name of user use generic-contact ; inherit default values from generic-contact template (Defined above) alias Nagios Admin ; full name of user email 52*****[email protected] ; <<***** set your own email address to s ****** }
Check the configuration file if there are no errors, restart the Nagios service to see if you can receive the message by stopping a service that you have already monitored, and if you don't have one, you can check to see if you are recovering in the trash bin, as in the following message.
Nagios *****notification type:problemhost:winserverstate:downaddress:192.168.31.20info: (Host Check Timed out) D Ate/time:mon Nov 6 23:57:42 CST 2017
This describes the outgoing configuration of the Nagios service for Windows systems and mail alerts
This article is from "Little Chong" blog, please make sure to keep this source http://maoxiaoxiong.blog.51cto.com/11705634/1980788
Monitoring the configuration of remote Windows host and mail alarm--nagios