Configuring Nagios to monitor windows machine

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post 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
Attachments
Test-PC_Memory Usage.PNG
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configuring Nagios to monitor windows machine

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Configuring Nagios to monitor windows machine

Post by slansing »

Your check command would need to be:

Code: Select all

check_command check_nrpe!80!90
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.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

Thanks slansing. Though Im not sure if I got it correctly. Sorry, Im not really good in following these syntaxes. :P

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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configuring Nagios to monitor windows machine

Post 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
}
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post 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
Attachments
Test-PC_Memory Usage_error.PNG
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configuring Nagios to monitor windows machine

Post by abrist »

Noctis0791 wrote:sudo apt-get install nagios-nrpe-plugin
That is the one you want :)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

Okay, thanks. I'll install the plugin once I get back to the office. Keep you posted. :)

Thank You,

Arnel
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Configuring Nagios to monitor windows machine

Post by slansing »

Thanks!
Locked