check_nt: Could not parse arguments

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.
MikeZ
Posts: 5
Joined: Thu Nov 19, 2015 10:48 am

check_nt: Could not parse arguments

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nt: Could not parse arguments

Post by hsmith »

Can we see the service check definition? The host check definition doesn't tell us much.
Former Nagios Employee.
me.
MikeZ
Posts: 5
Joined: Thu Nov 19, 2015 10:48 am

Re: check_nt: Could not parse arguments

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_nt: Could not parse arguments

Post 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.
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_nt: Could not parse arguments

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
MikeZ
Posts: 5
Joined: Thu Nov 19, 2015 10:48 am

Re: check_nt: Could not parse arguments

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_nt: Could not parse arguments

Post by hsmith »

Box293 wrote:Can you please provide the MEMUSE service check definition.
Can you provide this as well?

Thank you.
Former Nagios Employee.
me.
MikeZ
Posts: 5
Joined: Thu Nov 19, 2015 10:48 am

Re: check_nt: Could not parse arguments

Post 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
}
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_nt: Could not parse arguments

Post 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]
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
MikeZ
Posts: 5
Joined: Thu Nov 19, 2015 10:48 am

Re: check_nt: Could not parse arguments

Post 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
Locked