Nagios 2 and check_disk_smb won't check hidden share


#1

Hi all,

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.

Any ideas?


#2

Have you tried to use ’ ’ or " " around the sharename?


#3

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$


#4

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).

Will take it in mind when I upgrade Nagios here.


#5

What is the hack? I would also like to just check hidden shares. Do you detect all the hidden shares on the server?


#6

I have tried everything mentioned in this thread and none of it is working.

My Commands.cfg:
[blockquote]# ‘check_disk_smb’ command definition
define command{
command_name check_disk_smb
command_line $USER1$/check_disk_smb -H $HOSTADDRESS$ -s $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$
}[/blockquote]

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 “!”?