Page 3 of 3
Re: Configuring Nagios to monitor windows machine
Posted: Tue Nov 05, 2013 6:08 pm
by Noctis0791
Hi abrist,
Yes, I can ping the Windows box as this is only a local machine (same network as the server). Ive reinstalled NSClient++ on the Windows client and it seems to be working now. On the first install I did not specified any host and password but this time I specified the IP of the Nagios server so I guess that did the trick. However,it looks like the memory details are incorrect. This machine is only running on 2 GB memory but it is showing as 4 GB (see attached.) Any idea? I have this below definition for the service.
define service{
use generic-service
host_name Test-PC
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
Thank You,
Arnel
Re: Configuring Nagios to monitor windows machine
Posted: Wed Nov 06, 2013 11:03 am
by abrist
It is reporting 4gb because that is the total memory including the "pagefile" (virtual) and your actual physical memory. You can check for just physical ram by using the nrpe module in NSClient:
http://www.nsclient.org/nscp/wiki/CheckSystem/checkMem
Re: Configuring Nagios to monitor windows machine
Posted: Wed Nov 06, 2013 1:13 pm
by Noctis0791
Hi abrist,
So if Im going to just check for the physical memory, I will need to add this on my commands.cfg.
define command {
command_name <<CheckMEM>>
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical
}
And define the service as follow, is that correct? Can you verify both syntax?
define service{
use generic-service
host_name Test-PC
service_description Memory Usage
check_command check_nrpe!CheckMEM!-w 80 -c 90
}
Thank You,
Arnel
Re: Configuring Nagios to monitor windows machine
Posted: Wed Nov 06, 2013 2:55 pm
by slansing
Your check command would need to be:
I would highly recommend changing the command to something that would give you more leeway.
Just use the standard check_nrpe command.. which is:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
and define this for the service:
Code: Select all
check_command check_nrpe!CheckMEM!-a "MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical"
Then you don't need to create a new command definition, but you can still alter what you are checking and what the values are through your service's definition for the $ARG1$ and $ARG2$ slots.
Re: Configuring Nagios to monitor windows machine
Posted: Thu Nov 07, 2013 1:38 pm
by Noctis0791
Thanks slansing. Though Im not sure if I got it correctly. Sorry, Im not really good in following these syntaxes.
In my understanding, I need to add these lines on my command.cfg file.
define command {
command_name <<CheckMEM>>
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Then these lines for the services-to-check in my windows.cfg, is that correct?
define service{
use generic-service
host_name Test-PC
service_description Memory Usage
check_command check_nrpe!80!90
}
Thank you very much,
Arnel
Re: Configuring Nagios to monitor windows machine
Posted: Thu Nov 07, 2013 5:04 pm
by abrist
Nope. Try:
Code: Select all
define command {
command_name check_mem
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c checkMEM -a 'MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical'
}
define service{
use generic-service
host_name Test-PC
service_description Memory Usage
check_command check_mem!80!90
}
Re: Configuring Nagios to monitor windows machine
Posted: Thu Nov 07, 2013 5:30 pm
by Noctis0791
Thanks abrist. I tried it but I got this error (see attached). It looks like I do not have the nrpe plugin yet. I also looked into /etc/nagios-plugins/config/ directory and I dont see anything like nrpe there. Just to confirm, Is this the right command to get it installed?
sudo apt-get install nagios-nrpe-plugin
Thank You,
Arnel
Re: Configuring Nagios to monitor windows machine
Posted: Thu Nov 07, 2013 6:20 pm
by abrist
Noctis0791 wrote:sudo apt-get install nagios-nrpe-plugin
That is the one you want

Re: Configuring Nagios to monitor windows machine
Posted: Fri Nov 08, 2013 3:15 pm
by Noctis0791
Okay, thanks. I'll install the plugin once I get back to the office. Keep you posted.
Thank You,
Arnel
Re: Configuring Nagios to monitor windows machine
Posted: Fri Nov 08, 2013 3:26 pm
by slansing
Thanks!