Some info first:
horta ~ # /usr/nagios/bin/nagios --version
Nagios 2.0
Well, if I try to check the hidden shares on my Windows servers, I get this error in Nagios:
Invalid share name \Boticelli.ontwerpwetenschappen.ha.be\d
While the share-name in the services.cfg is set as d$
Seems that the $ sign messes it up. Using the check_disk_smb command by hand, does give me a correct result.
Why not try defining another $USERx$ in your resource.cfg file.
Something like this in resource.cfg:
$USER6$=d$
Then in your services.cfg the command would be defined with "$USER6$
I tried the ’ ’ and " ", but both didn’t make a difference.
The $USER6$ idea seems a good idea, but meanwhile I hacked the check_disk_smb script, so it will always check for a hidden share (as that are the only shares I check, just to know the used diskspace).
The host.cfg for the machine I wish to check usage for the C$ partition on:
[blockquote]# Define a service to check the disk space on a C Partition for a Windows host
define service{
use host_dev05 ; Name of service template to use
host_name dev05
service_description Usage - C Partition
check_command check_disk_smb!$USER6$!Administrator!PWD-CENSORED!WORKGROUP
}[/blockquote]
My resource.cfg:
[blockquote]# To Allow hidden shares on Windows hosts to be properly passed to Nagios
$USER6$=c$[/blockquote]
Also, would it throw things off if the Administrator password contains a “!”?