Configuring Nagios to monitor windows machine
-
Noctis0791
- Posts: 58
- Joined: Wed Oct 09, 2013 3:41 pm
Re: Configuring Nagios to monitor windows machine
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
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
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
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.
"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
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
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
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:
and define this for the service:
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.
Code: Select all
check_command check_nrpe!80!90Just 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"-
Noctis0791
- Posts: 58
- Joined: Wed Oct 09, 2013 3:41 pm
Re: Configuring Nagios to monitor windows machine
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
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
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.
"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
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
sudo apt-get install nagios-nrpe-plugin
Thank You,
Arnel
Re: Configuring Nagios to monitor windows machine
That is the one you wantNoctis0791 wrote:sudo apt-get install nagios-nrpe-plugin
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.
"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
Okay, thanks. I'll install the plugin once I get back to the office. Keep you posted. 
Thank You,
Arnel
Thank You,
Arnel