We will trying to monitor Windows Memory Usage, Diskspace, CPU Load and Uptime From Nagios.
First we need to have a nagios up and running smoothly.
Please follow up this url to install nagios http://www.nagios.org
Next we also need a windows nagios agent.
Download windows nagios agent from this url http://nsclient.ready2run.nl/download/nsclient_201.zip
Install nagios agent / nsclient to your windows server/client.
# Copy pNSClient.exe, pdh.dll, psapi.dll and counters.defs in any directory on the machine you want to monitor. ie. (c:\nsclient).
# Open a dos prompt in the installation directory
# Run the following command : >pNSClient.exe /install
# Type 'net start nsclient' on the command line or start the service 'Nagios Agent' in the services applet of the control panel.
Open up a firewall port 1248TCP for nagios agent in your windows client/server
On the Unix machine / Nagios Server
1. Copy the file 'check_nt' under the libexec folder of Nagios.
2. Add the following lines to the commands.cfg file:
# NSClient basic return types
command[check_nt_disk]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$
command[check_nt_cpuload]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v CPULOAD -l $ARG1$
command[check_nt_uptime]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v UPTIME
command[check_nt_clientversion]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v CLIENTVERSION
command[check_nt_process]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v PROCSTATE -l $ARG1$
command[check_nt_service]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v SERVICESTATE -l $ARG1$
command[check_nt_memuse]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v MEMUSE -w $ARG1$ -c $ARG2$
command[check_nt_fileage]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v FILEAGE –l $ARG1$ -w $ARG2$ -c $ARG3$
# Custom counters (one per required counter, or define a generic one and use $ARG1$ to specify the requested counter).
command[check_nt_pagingfile]=$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l "\\Paging File(_Total)\\%% Usage","Paging File usage is %.2f %%" -w $ARG1$ -c $AR
Add your server to monitor diskspace, memusage, cpu load ,etc and Restart your nagios services.
If you have following all steps above. you will see a monitoring result like below
Recent comments
43 weeks 4 days ago
47 weeks 1 day ago
1 year 3 weeks ago