Page 1 of 1

New to Nagios - Monitor Windows Server

Posted: Wed Aug 15, 2012 2:17 pm
by MichaelW
Hi all,

I'm new to Nagios. I've installed Nagios3 on Ubuntu 12.04 Sever.
I've modified nagios.cfg and windows.cfg to be able to monitor a windows server. Basically that works but I get this

Code: Select all

C:\ Drive Space	UNKNOWN 	2012-08-15 15:03:34 	0d 0h 31m 22s 	4/4 	wrong -l argument 
as the result when I try to monitor the available disk space on that sever.

However

Code: Select all

/usr/lib/nagios/plugins/check_nt -H 10.0.1.9 -p 12489 -v USEDDISKSPACE -l c -w 80 -c 90
returns the data.

In windows.cfg I have this

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }
And in nt.cfg I have this

Code: Select all

# 'check_nt' command definition
define command {
        command_name    check_nt
        command_line    /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -v '$ARG1$' '$ARG2$'
}
I've added '$ARG2$' to nt.cfg, prior to that I got "missing -l parameter" in Nagios.

In addition to that I have a couple of "Connection refused " messages in Nagios, maybe something is wrong with the setup. As I wrote: I'm totally new to this.
Any help is appreciated.


Regards,

Michael

Re: New to Nagios - Monitor Windows Server

Posted: Wed Aug 15, 2012 6:27 pm
by jsmurphy
You haven't specified the port in your command.cfg, the newer versions of NSCLient++ Default to port 12489 but check_nt still defaults to 1248. This is why when you run it on the command line with -p 12489 it works ;)

Change your check_nt command to:

Code: Select all

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

Re: New to Nagios - Monitor Windows Server

Posted: Wed Aug 15, 2012 6:48 pm
by MichaelW
Thank's jsmurphy. That took care of the "Connection refused" messages. Unfortunately I still have the "wrong -l parameter" status.

Michael

Re: New to Nagios - Monitor Windows Server

Posted: Wed Aug 15, 2012 8:35 pm
by MichaelW
I changed

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }
to

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!'-l c -w 80 -c 90'
        }
and it works.

However

Code: Select all

define service{
        use                     generic-service
        hostgroup_name          windows-servers
        service_description     Memory Usage
        check_command           check_nt!MEMUSE!-w 80 -c 90
        }
works without the '.

Any ideas?

Re: New to Nagios - Monitor Windows Server

Posted: Thu Aug 16, 2012 1:20 pm
by lmiltchev
Change this line from:

Code: Select all

command_line    /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -p 12489 -v '$ARG1$' '$ARG2$'
to:

Code: Select all

command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
Hope this helps.