Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_smb_share

Rating
11 votes
Favoured:
4
Current Version
1.0
Last Release Date
2013-04-12
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
124423
Files:
FileDescription
check_smb_sharecheck_smb_share
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Checks if a specific SMB share exists. Can be used to check for printer shares as well. Uses an anonymous login if no username or password is supplied.

If your share has spaces in its name make sure you "quote" it in the command argument -s.
Usage:
check_smb_share -H [host] -s ["sharename"] -u [username] -p [password]
Reviews (9)
bynagiosuser040, August 7, 2017
Works fine when I run it from the nagos plugin folder and when I test the service in Op5. But when I save it in Op5, the next scheduled service fails:
CRITICAL SMB Sharename: SHARENAME session setup failed: NT_STATUS_LOGON_FAILURE
byesetman, January 29, 2016
Hello,
If you enter:
./check_smb_share xx.xx.xx.xx -H -u -p ***** *****

so I get the answer:
OK SMB Sharename: Domain = [TEST] OS = [Windows Server 2012 Standard 9200] Server = [Windows Server 2012 Standard 6.2]
It's alright.

If you enter the wrong IP guest, so I get the answer:
OK SMB Sharename: Connection to 172.17.40.155 failed (Error NT_STATUS_IO_TIMEOUT)
It should be CRITICAL think. If Notification to come.



If specify a paramater -s:
./check_smb_share H xx.xx.xx.xx appl -s -u -p ***** *****

so I get the answer:
CRITICAL SMB Sharename: appl Domain = [TEST] OS = [Windows Server 2012 Standard 9200] Server = [Windows Server 2012 Standard 6.2]
Does anyone know why?

If you enter:
smbclient -U username //xx.xx.xx.xx/appl
thus the connection is OK
Can someone tell me if you succeed to make it work with *****$ sharename
Ex:
./check_smb_share -H xx.xx.xx.xx -s test$ -u ***** -p *****
I have this message:
CRITICAL SMB Sharename: test$

Thank you for your answer because it would be very usefull for me to make it work on my plateform.
Owner's reply

The dollar sign is not really part of the share name. It's there to signal to Windows clients that it is a hidden share.
Smbclient doesn't really pay attention to this so dropping the "$" from the end of share name will fix your problem.

mh

I can test it fine (manuel check) and get OK result for share, but when I create a service and with same details in check it fails.

CRITICAL SMB Sharename: xml session setup failed: NT_STATUS_LOGON_FAILURE
byvaleks, December 26, 2012
in line 64 change to
stdout=`smbclient -N -L "$host" -U"$user"%"$password" 2>&1`

to use with username/password
byslimer, October 4, 2012
./check_smb_share: line 11: ./utils.sh: No such file or directory
Owner's reply

Are you running this from the nagios plugin directory.

bycentury, May 20, 2012
1 of 1 people found this review helpful
simple, fast , no pass ... perfect for me.

thanks a lot
bysampinar, February 6, 2012
Works perfectly. Thank you.
byMajed, August 25, 2011
checks as promises except i thought i could check directly from nagios but it turned out to work only through nrpe from the remote samba server.
example:
./check_smb_share -H 10.1.1.11 -s install
where install is the name of the folder.