Monitoring windows servers

Geoffrey Walton geoffrey.walton at midwich.com
Tue Sep 26 21:06:13 CEST 2006


Hi Ranga				



Like everything it can be done but is "fun" to configure and get
 working.



Here is an extract of some notes I made when setting up a test system,
 so it only makes 97% sense, there a a couple of "odd" sentences.
 Remember it is still work in progress so if anything doesn't work
 plese let me know.



It assumes you have Nagios working with the plugins ahd NRPE installed.



G





Monitoring a Windows Server



Download the file for NRPE-NT onto the windows box, http://www.nagiosexch
ange.org/NRPE.77.0.html?&tx_netnagext_pi1[p_view]=139, and unzip
 it. 



Rename the bin directory as Nagios and move it to the root directory
 on the c drive.



Open a DOS cmd window



cd /nagios



nrpe_nt -i



Now go and start the Nagios Remote service or reboot this client
 server.





If you have a firewall on the client server open port 5666.



Download the file for Basic NRPE_NT Plugins 



onto the windows box, http://www.nagiosexchange.org/NRPE_Plugins.66.0.htm
l?&tx_netnagext_pi1[p_view]=62, and unzip it. 



Copy all the exe files in the bin directory to c:\Nagios.



In the Nagios directory edit nrpe.cfg and set the allowed host to
 the ip of your nagios server.



allowed_hosts=192.168.0.1



Then at the bottom, add configuration lines for the checks we can
 run.



command[nt_cpuload]=C:\nagios\cpuload_nrpe_nt.exe 50 80



command[nt_check_disk_c]=C:\nagios\diskspace_nrpe_nt.exe c: 70
 90



command[nt_check_disk_d]=C:\nagios\diskspace_nrpe_nt.exe d: 70
 90



command[nt_check_disk_e]=C:\nagios\diskspace_nrpe_nt.exe e: 70
 90



command[nt_eventlog]=C:\nagios\eventlog_nrpe_nt.exe 7200 "Service
 Control Manager"



command[nt_memload]=C:\nagios\memload_nrpe_nt.exe 70 90



command[nt_service]=C:\nagios\service_nrpe_nt.exe "Event Log,DNS
 Client"



These commands all have fixed values which once you are familiar
 with what you are doing you might want to change them. If you want
 to use parameters in the commands read the comments in the config
 file. 



Now on the host server we have to set up a new host in the host.cfg
 file, why not copy the entries for the first server and change
 the name, alias and address to those relating to your windows server.
 



Copy this to checkcommands.cfg



define command{



command_name nt_check_disk_c



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_c



}



define command{



command_name nt_check_disk_d



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_d



}



define command{



command_name nt_check_disk_e



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_e



}



define command{



command_name nt_cpuload



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_cpuload



}



define command{



command_name nt_memload



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_memload



}



define command{



command_name nt_service



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_service



}



define command{



command_name nt_eventlog



command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_eventlog



}



Copy this to the service.cfg replacing xxxxxxxxxx with the host
 name you used in the hosts.cfg file.



define service{



use generic-service ; Name of service template to use



host_name xxxxxxxxxx



service_description NT_DISK_C



is_volatile 0



check_period 24x7



max_check_attempts 3



normal_check_interval 5



retry_check_interval 1



contact_groups linux-admins



notification_interval 240



notification_period 24x7



notification_options c,r



check_command nt_check_disk_c



}



Validate the configuration, and as a small exercise, correct the
 deliberate error, validate again and restart Nagios.



By copying the nagios directory onto other windows server and setting
 up the service to run as described above you can monitor them as
 well. You will also need to define them in the hosts.cfg and add
 them to the host_name on service entry defined above in the service.cfg
 file.







- Geoffrey Walton (geoffrey)



-----------------------

This thread is located in the archive at this URL:

http://www.nagiosexchange.org/nagios-users.34.0.html?&tx_maillisttofaq_pi
1[showUid]=22073

				

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list