Page 1 of 2

check_nt: Could not parse arguments

Posted: Fri Nov 20, 2015 10:19 am
by MikeZ
Hello,

I am running version 4.0.4 of Nagios core and 0.3.9 of the NSCIient++ on a windows 2012 R2 server. I can issue the following command manually from the nagios server, but the web interface shows the check_nt: Could not parse arguments error.

root@nagioshost:/usr/local/nagios/etc/objects# /usr/local/nagios/libexec/check_nt -H 10.10.20.10 -p 12489 -v MEMUSE
Memory usage: total:4799.59 Mb - used: 1394.62 Mb (29%) - free: 3404.97 Mb (71%) | 'Memory usage'=1394.62Mb;0.00;0.00;0.00;4799.59

here is the check_nt section from command.cfg

Code: Select all

define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
        }

This is actually my second domain controller on a subnet, the first one is identically setup and reports just fine. I have tried 0.4.3 client as well, but the same results. Below is the windows.cfg section for both working and non-working servers:

Code: Select all

define host{
        use             util-server     ; Inherit default values from a template
        host_name       DFPDC01 ; The name we're giving to this host
        alias           Deltrol's fluid domain ctrl 01  ; A longer name associated with the host
        address         10.10.20.9      ; IP address of the host
        }

define host{
        use             util-server     ; Inherit default values from a template
        host_name       DFPDC02 ; The name we're giving to this host
        alias           Deltrol's fluid domain ctrl 02  ; A longer name associated with the host
        address        10.10.20.10      IP address of the host
        }
Any help would be appreciated.

Thanks,

Mike

Re: check_nt: Could not parse arguments

Posted: Fri Nov 20, 2015 10:31 am
by hsmith
Can we see the service check definition? The host check definition doesn't tell us much.

Re: check_nt: Could not parse arguments

Posted: Tue Nov 24, 2015 3:56 pm
by MikeZ
Here are the service checks ,as requested:

Code: Select all


define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     Uptime
        check_command           check_nt!UPTIME
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,utl-servers
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 94 -c 95
        }

Regards,

Mike

Re: check_nt: Could not parse arguments

Posted: Tue Nov 24, 2015 4:35 pm
by rkennedy
Can you run the command as nagios?

Code: Select all

su nagios
/usr/local/nagios/libexec/check_nt -H 10.10.20.10 -p 12489 -v MEMUSE
Please post the output.

Re: check_nt: Could not parse arguments

Posted: Tue Nov 24, 2015 7:26 pm
by Box293
MikeZ wrote:Here are the service checks ,as requested:

Code: Select all


define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     Uptime
        check_command           check_nt!UPTIME
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
        service_description     CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }

define service{
        use                     generic-service
        hostgroup_name          windows-servers,utl-servers
        service_description     C:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l c -w 94 -c 95
        }

Regards,

Mike

Can you please provide the MEMUSE service check definition.

Re: check_nt: Could not parse arguments

Posted: Mon Nov 30, 2015 11:34 am
by MikeZ
here are the requested results:

root@nagioshost:~# su nagios
nagios@nagioshost:/root$ /usr/local/nagios/libexec/check_nt -H 10.10.20.10 -p12489 -v MEMUSE
Memory usage: total:4799.59 Mb - used: 1154.15 Mb (24%) - free: 3645.44 Mb (76%) | 'Memory usage'=1154.15Mb;0.00;0.00;0.00;4799.59
nagios@nagioshost:/root$


Mike

Re: check_nt: Could not parse arguments

Posted: Mon Nov 30, 2015 11:54 am
by hsmith
Box293 wrote:Can you please provide the MEMUSE service check definition.
Can you provide this as well?

Thank you.

Re: check_nt: Could not parse arguments

Posted: Tue Dec 01, 2015 4:52 pm
by MikeZ
Here is the memuse service definition.


define service{
use generic-service
hostgroup_name windows-servers,sql-servers,file-servers,exchange-servers,utl-servers
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

Re: check_nt: Could not parse arguments

Posted: Tue Dec 01, 2015 9:55 pm
by Box293
MikeZ wrote:This is actually my second domain controller on a subnet, the first one is identically setup and reports just fine. I have tried 0.4.3 client as well, but the same results. Below is the windows.cfg section for both working and non-working servers:

Code: Select all

define host{
        use             util-server     ; Inherit default values from a template
        host_name       DFPDC01 ; The name we're giving to this host
        alias           Deltrol's fluid domain ctrl 01  ; A longer name associated with the host
        address         10.10.20.9      ; IP address of the host
        }

define host{
        use             util-server     ; Inherit default values from a template
        host_name       DFPDC02 ; The name we're giving to this host
        alias           Deltrol's fluid domain ctrl 02  ; A longer name associated with the host
        address        10.10.20.10      IP address of the host
        }
I suspect it's this line in your host config:

Code: Select all

address        10.10.20.10      IP address of the host
There is no semi-colon to start the comment. It should be:

Code: Select all

address        10.10.20.10     ; IP address of the host
I suspect this is the reason for "Could not parse arguments"

Code: Select all

./check_nt -H 10.10.20.10      IP address of the host -p 12489 -v MEMUSE -w 80 -c 90

check_nt: Could not parse arguments
Usage:
check_nt -H host -v variable [-p port] [-w warning] [-c critical]
[-l params] [-d SHOWALL] [-u] [-t timeout]

Re: check_nt: Could not parse arguments

Posted: Thu Dec 03, 2015 9:07 am
by MikeZ
Thanks so much, that was it!

It is amazing how long you can look at this stuff and not see the obvious that is right before your eyes!

Thanks again,

mike