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 »

Thanks sreinhardt. That's what I did and the duplicate issue seems to be sorted now. But I still got warnings for this box that I would like to monitor (see attached). Here's my templates.cfg and windows.cfg. Any Ideas what could be wrong on my configurations?

Thanks again,

Arnel
Attachments
windows.cfg.txt
(1.04 KiB) Downloaded 238 times
templates.cfg.txt
(1.34 KiB) Downloaded 232 times
Test-PC Warnings.PNG
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 »

You will have to pass the "-l" argument through those commands. For instance when checking disc with check_nt you will need to pass something similar to this:

-l C -w 80 -c 95

Where C = Drive letter, w = Warning threshold, and c = Critical threshold.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

Thanks slansing. But it looks like I already have those specified in my windows.cfg. Can you take a look on my commands below just to confirm if they were specified correctly? Thank You!

define host{
use windows-server
host_name Test-PC
alias Test-PC
address 192.168.100.25
}

define service{
use generic-service
host_name Test-PC
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

define service{
use generic-service
host_name Test-PC
service_description Uptime
check_command check_nt!UPTIME
}

define service{
use generic-service
host_name Test-PC
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}
define service{
use generic-service
host_name Test-PC
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

define service{
use generic-service
host_name Test-PC
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l C -w 80 -c 90
}

Regards,

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 »

Can you share your command definition for check_nt?
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

Hi slansing,

Here's my command definition for check_nt.

# 'check_nt' command definition
define command {
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v $ARG1$ $ARG2$
}

# 'check_nscp' command definition
define command {
command_name check_nscp
command_line /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -v $ARG1$ $ARG2$
}


also tried it this way but with the same result.

# 'check_nt' command definition
define command {
command_name check_nt
command_line /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -v $ARG1$ $ARG2$
}

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 »

Run the following from the command line, what is returned?

Code: Select all

/usr/local/nagios/libexec/check_nt -H <windows.address.> -v USEDDISKSPACE -l C -w 80 -c 90
You do have a C drive on that system correct? It's not networked storage?
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

I got this result from that command. Yes, this machine only has a single drive which is the C drive. Its not a network share.
check_nt from terminal.PNG
Thanks,

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 »

Ah looks like your running Ubuntu with a GUI, try this one:

Code: Select all

/usr/lib/nagios/plugins/check_nt -H <windows.address.> -v USEDDISKSPACE -l C -w 80 -c 90
Or the location that the plugins were installed to.
Noctis0791
Posts: 58
Joined: Wed Oct 09, 2013 3:41 pm

Re: Configuring Nagios to monitor windows machine

Post by Noctis0791 »

Yes, running on Ubuntu with GUI.

I got this result from the above command.

CRITICAL - Socket timeout after 10 seconds

Thanks,

Arnel
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Configuring Nagios to monitor windows machine

Post by abrist »

1. Do you have a password set in the remote system's nsclient config? If so, you will need to declare it in your check:

Code: Select all

/usr/lib/nagios/plugins/check_nt -H <windows.address.> -s <password> -v USEDDISKSPACE -l C -w 80 -c 90
2. Is port 12489 open on the remote windows box?

Code: Select all

nmap -p 12489 <windows.address>
3. Can you ping the remote host from the nagios server?

Code: Select all

ping <windows.address>
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.
Locked