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
check_disk_smb
Re: check_disk_smb
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.
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.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check_disk_smb
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.
https://exchange.nagios.org/directory/P ... b3/details
Take a look at it and see if it will work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_disk_smb
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
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
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check_disk_smb
Thanks for the assist, @mcapra! OP, let us know if you need further assistance.
Former Nagios employee
Re: check_disk_smb
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_disk_smb
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
Code: Select all
smbclient -Vhttps://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
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?
Is there a different way to upgrade it?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_disk_smb
CentOS 7 comes with 4.4.4ab3pu 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?
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.)