Page 1 of 2
check_disk_smb
Posted: Wed Jul 05, 2017 1:03 pm
by ab3pu
I have been queried by my security gurus, to see if I can stop NagiosXI from check disk space using SMBv1. I am currently using the check_disk_smb command, but do not see a version option. Do you have any suggestions.
Thanks
Re: check_disk_smb
Posted: Wed Jul 05, 2017 1:32 pm
by mcapra
Here's the latest source for
check_disk_smb. I've highlighted the relevant bits:
https://github.com/nagios-plugins/nagio ... #L184-L195
check_disk_smb is a glorified wrapper for the system's
smbclient command. So if you can get that command to force a specific Samba version, that would be step 1.
I suspect the plugin would need to be modified to accept the
-m argument for
smbclient. I don't have a proper testing setup to verify that, though. If you can share your current command definitions associated with these checks, perhaps we can play around with specific
smbclient commands to see if one forces the desired version.
Re: check_disk_smb
Posted: Wed Jul 05, 2017 4:59 pm
by tgriep
Thanks
@mcapra for the help but I found this plugin that says that it supports SMB 1, 2 and 3.
https://exchange.nagios.org/directory/P ... b3/details
Take a look at it and see if it will work for you.
Re: check_disk_smb
Posted: Wed Aug 02, 2017 7:55 am
by ab3pu
Thanks for this, but being a bit of a noob, could use some help adding this to my system. I have added plugins, but this seems to be just a text file. I would guess that I would save this file as check_smb3 on my /usr/local/nagios/libexec/ and then add a command to access it. Am I correct?
Re: check_disk_smb
Posted: Wed Aug 02, 2017 8:30 am
by mcapra
Then you would assign that command to a service/host object, yeah. This documentation covers the basics:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: check_disk_smb
Posted: Wed Aug 02, 2017 12:49 pm
by tmcdonald
Thanks for the assist,
@mcapra! OP, let us know if you need further assistance.
Re: check_disk_smb
Posted: Wed Aug 16, 2017 9:39 am
by ab3pu
I appreciate everyone's input on this, unfortunately have still not found a solution to my problem.
Let me backup and see if I can add details as well as updates that may help find a solution.
We are currently checking available space of shares using the check_disk_smb plugin. Unfortunately these commands are using SMB1 as their protocol. We have some newer servers (and the rest of our servers will be like this shortly) that for security purposes do not allow SMB1. I am trying to find a way to make this command work with SMB2 and/or SMB3.
When things are working the Status Information I see is:
"Disk ok - xx.xxG (y%) free on \\SHARE\C$"
On the newer services I get the following Status Information:
"Result from smbclient not suitable"
I have tried to run the smbclient with the -m option to set maximum protocol, I have tried editing smb.conf [global] to for client MIN and MAX protocol to no avail.
I have tried the check_smb3 plugin shown in an earlier post but get the same "Result from smbclient not suitable" as above.
Any thoughts, ideas, or, better yet, solutions?
Bill
Thanks again for the assistance.
Re: check_disk_smb
Posted: Wed Aug 16, 2017 10:33 am
by scottwilkerson
Being all these plugins use the smbclient on your Nagios server, it is going to matter alot what version it is and make sure the smbclient version supports SMB3
I believe you need 4.1.0 or higher to use SMB2 or SMB3
https://www.samba.org/samba/history/samba-4.1.0.html
Samba 4.1.0 contains the first release of our client tools
and client library that work over the new protocols SMB2 or SMB3.
Note that SMB3 only works either to a Samba server version 4.0.0
or above, or to a Windows Server running Windows 2012 or Windows 8.
Re: check_disk_smb
Posted: Wed Aug 16, 2017 10:54 am
by ab3pu
Hmmm It show Version 3.6.23-36.el6_8....but I did a yum update on samba-client but it only took me to 3.6.23-43.
Is there a different way to upgrade it?
Re: check_disk_smb
Posted: Wed Aug 16, 2017 11:19 am
by scottwilkerson
ab3pu wrote:Hmmm It show Version 3.6.23-36.el6_8....but I did a yum update on samba-client but it only took me to 3.6.23-43.
Is there a different way to upgrade it?
CentOS 7 comes with 4.4.4
I'm sure you can get the RPM from another source, or compile the new version, but this is getting outside the scope of the support we can provide as this could affect other systems on your server (e.g. samba shares, etc.)