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


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



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



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.



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



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



Got error
by slimer, October 31, 2012

./check_smb_share: line 11: ./utils.sh: No such file or directory



nice one
by century, May 31, 2012

simple, fast , no pass ... perfect for me. thanks a lot



Simple. Easy
by sampinar, February 29, 2012

Works perfectly. Thank you.



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.



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,385