New to Nagios - Monitor Windows Server

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.
Locked
MichaelW
Posts: 5
Joined: Wed Aug 15, 2012 1:39 pm

New to Nagios - Monitor Windows Server

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: New to Nagios - Monitor Windows Server

Post 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$'
}
MichaelW
Posts: 5
Joined: Wed Aug 15, 2012 1:39 pm

Re: New to Nagios - Monitor Windows Server

Post by MichaelW »

Thank's jsmurphy. That took care of the "Connection refused" messages. Unfortunately I still have the "wrong -l parameter" status.

Michael
MichaelW
Posts: 5
Joined: Wed Aug 15, 2012 1:39 pm

Re: New to Nagios - Monitor Windows Server

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New to Nagios - Monitor Windows Server

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked