LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2019, 09:27 AM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 808

Rep: Reputation: 39
Checking the status of Windows network shares in Ubuntu


Hello --

I have Ubunutu 18.04 running on one of our systems, and I have a Windows network share that I have set up via the Files utility.

I want to periodically check the status of its connection, and I have experimented with smbtree, smbclient, and smbstatus to get information. The syntax that used with the commands are the following:

Quote:
sudo /usr/bin/smbclient -L <ip address> -U <DOMAIN>\<username>
sudo /usr/bin/smbtree -d <DOMAIN> -S <server name>/<share>
sudo /usr/bin/smbstatus --shares
What would be the correct syntax to use in order to determine the status of the remote Windows share that is being accessed by this workstation? Thanks.
 
Old 03-26-2019, 09:38 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,998

Rep: Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246
touch a hidden file on the share, if it returns OK then not only is the share available you know it's mounted read/write.
 
Old 03-26-2019, 10:38 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,236

Rep: Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973
Quote:
Originally Posted by kaplan71 View Post
Hello --
I have Ubunutu 18.04 running on one of our systems, and I have a Windows network share that I have set up via the Files utility. I want to periodically check the status of its connection, and I have experimented with smbtree, smbclient, and smbstatus to get information. The syntax that used with the commands are the following:
Code:
sudo /usr/bin/smbclient -L <ip address> -U <DOMAIN>\<username>
sudo /usr/bin/smbtree -d <DOMAIN> -S <server name>/<share>
sudo /usr/bin/smbstatus --shares
What would be the correct syntax to use in order to determine the status of the remote Windows share that is being accessed by this workstation? Thanks.
First question would be, what is the problem you're having?? Do the commands you posted WORK and do what you want?? If so, then obviously it's correct for what you want to do. If not...guess you'll have to try something else. You've posted commands, but don't tell us any error(s)/problem(s) you're having with them. And you've been working with Samba shares for FOURTEEN YEARS now, so surely you have SOME ideas?

Is this Windows share mounted? If so, you can also run a simple "mount" command an look for the share name. Or just try to copy a file to it, and check the return status via a very simple shell script. But, we don't know what to suggest, since you've not provided many details, or even said what problem you're having.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking network status ashishravande Linux - Newbie 3 06-15-2010 02:40 PM
Dependency checking this, dependency checking that. Jeebizz General 11 09-29-2009 07:51 PM
Can't View List of Shares in Nautilus, but can browse shares directly macgyver007 Linux - Networking 3 12-11-2008 05:13 PM
Checking network card status BNI Linux - Networking 1 06-15-2005 06:55 AM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration