check_disk_smb

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

check_disk_smb

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk_smb

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_disk_smb

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

Re: check_disk_smb

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk_smb

Post 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
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_disk_smb

Post by tmcdonald »

Thanks for the assist, @mcapra! OP, let us know if you need further assistance.
Former Nagios employee
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

Re: check_disk_smb

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_disk_smb

Post 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

Code: Select all

smbclient -V
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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ab3pu
Posts: 54
Joined: Fri Sep 30, 2016 1:51 pm

Re: check_disk_smb

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_disk_smb

Post 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.)
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked