SMB

check_smb_share

Description:

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.

Current Version

1.0

Last Release Date

2013-04-12

Compatible With

  • Nagios 3.x

License

GPL


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
Usage: check_smb_share -H [host] -s ["sharename"] -u [username] -p [password]
Reviews (9) Add a Review
Issue with op5
by nagiosuser040, August 31, 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
Helpful? Yes  No 
CRITICAL SMB Sharename
by esetman, January 31, 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
Helpful? Yes  No 
Critical SMB Sharename
by Koodbook, May 31, 2013
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


Helpful? Yes  No 
Works with manuel check, not using service
by Zurog, May 31, 2013
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
Helpful? Yes  No 
username/password
by valeks, December 31, 2012
in line 64 change to
stdout=`smbclient -N -L "$host" -U"$user"%"$password" 2>&1`

to use with username/password
Helpful? Yes  No 
Got error
by slimer, October 31, 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.


Helpful? Yes  No 
nice one
by century, May 31, 2012
simple, fast , no pass ... perfect for me.

thanks a lot
1 of 1 found this review helpful.
Helpful? Yes 1 No 0
Simple. Easy
by sampinar, February 29, 2012
Works perfectly. Thank you.
Helpful? Yes  No 
does what it says
by Majed, August 31, 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.
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.9 (11)
Favorites
4
Views
125,353