check_nt + USEDDISKSPACE


#1

Hi everyone,

I can manually run check_nt with USEDDISKSPACE, but I get check_nt: could not parse arguments when being read in the configs. The other one that isn’t working is SERVICESTATE. MEMUSE, CPULOAD and UPTIME are working fine. Anybody have any ideas? I’ve tried hard coding all the arguments in the commands.cfg but to no avail.

commands.cfg
define command {
command_name check_nt_DISK_C
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -l C -w $ARG1$ -c $ARG2$ -v USEDDISKSPACE
}

services.cfg
define service {
use generic-service
host_name
service_description USED DISK SPACE
check_command check_nt!DISK_C!-w 80 -c 90
check_interval 1
retry_interval 1
max_check_attempts 3
notification_options w,u,c,r
contact_groups toneman
notification_interval 0
}


#2

Hey - I have this working on hundreds of machines.

Here is the service command file I include with the host in the host.cfg file:

define service{
use generic-service
host_name hostname1, hostname2, etc
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 85 -c 95
}

Then in my command.cfg file I have:

‘check_nt’ command definition

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

Thats it. Works beautifully. Make sure you have 12489 opened up in your network. Other than that check the ini file for the NSClient and see if you have the USEDDISKSPACE query enabled (not commented out…)

HTH

Joe


#3

These are the two important lines.
in the check command the “!” separates the arguments so what you are doing is sending “DISK_C” as ARG1 and “-w 80 -c 90” as ARG2 to the command.
What get’s run in the end is somehting like:

/usr/local/nagios/libexec/check_nt -h 192.168.1.1 -p 12489 -l C -w DISK_C -c -w 80 -c 90 -v USEDDISKSPACE

i think you can see by yourself that the command is completely wrong…

a working example is in joe’s answer :slight_smile: