check_disk_smb question


Hi guys,

I am monitoring all our shares on a server and I can not seem to list them all. Here is my code.


define service{
use generic-service

host_name linuxdev1
service_description SMB
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups bssadmins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_disk_smb!public!guest
check_command check_disk_smb!backups!guest

code for commands.cfg

‘check_disk_smb’ command definition

define command{
command_name check_disk_smb
command_line $USER1$/check_disk_smb --hostname="$HOSTADDRESS$" --share="$ARG1$" -u “$ARG2$” -p “’’” -w 85 -c 95

It only displays the backups share and not the public, how can I set this up to view both shares and more of them?


You have 2 check_commands defined for that service. See the docs on how to configure a service check. You can’t define 2 commands and expect them both to run.

A nagios service check is ONE service and ONE check.
If you have more shares to check, then that is ANOTHER service check.


I’m trying to configure check_disk_smb and have run into troubles right out of the get go.

When attempting to test the full command before implementing it I get the following error.

./check_disk_smb --hostname= --share=users -u dscarberry -p “” -w 85 -c 95

Can’t exec “//”: No such file or directory at ./check_disk_smb line 166.
Use of uninitialized value in split at ./check_disk_smb line 172.
Use of uninitialized value in pattern match (m//) at ./check_disk_smb line 180.
Result from smbclient not suitable

What am I doing wrong? Am I missing a key point in the process? IT is a windows 2003 share I’m trying to access


If I run the same as you have, but a valid host/share for me, then it works fine.
But if any info is wrong, i.e. password, user, share, host, then I get just what you get as a result. So, you have something wrong, i.e. share, host, user, password.