Access Denied with check_disk_smb


I have searched the forums and have not yet found a solution to this problem.

I am trying to configure check_disk_smb to give me the free space on hidden drives on a Windows Server 2003 machine. When I run my code in Nagios, I get a critical error, “Access Denied.” The strange part is when I run the command in Konsole (replacing only variables with their values, everything else is identical) it works perfectly and give me the correct % free. Nagios and Konsole run these commands as the same Linux user and the same domain user (domain admin).

I figure it must be something small I can’t see, so I am asking for another few sets of eyes to take a look at my code for me.

define command{
command_name check_disk_smb
command_line $USER1$/check_disk_smb -H $HOSTADDRESS$ -s C$ -W $USER5$ -u $USER6$ -p $USER7$

#‘check-disk-free’ command definition
define command{
command_name check-disk-free
command_line $USER1$/check_disk_smb -H $HOSTADDRESS$ -s C$ -W $USER5$ -u $USER6$ -p $USER7$

$USER5$ is our domain name, $USER6$ is the administrator login name, and $USER7$ is the administrator password.

My hosts.cfg file calls this service as check-disk-free.

Any help would be greatly appreciated!


That points to wrong definition of $USERx$ macros. Maybe you should check them again.