SAMBA shares monitoring

index

To monitor SAMBA shares at high level we can use following commands.

# net domain
Enter root’s password:

Enumerating domains:

Domain name          Server name of Browse Master
————-        —————————-
MSHOME               XXXXX-B4F69308
NAME                 SRVNAME
WFC                   PC-NAME
WORKGROUP           NAME-SRV

#smbstatus

Samba version 4.1.17-Debian
PID     Username      Group         Machine
——————————————————————-

Service      pid     machine       Connected at
——————————————————-

Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
No locked files

#net status shares

Service      pid     machine       Connected at
——————————————————-

#net status sessions

PID     Username      Group         Machine
——————————————————————-

Advertisements

Samba+LDAP server config files backup

Recently we built a new Samba+OPENLDAP PDC server to replace Window$ AD + File servers completely. I referred the below blog to build the GNU Debian Linux server after making necessary changes to configuration files of respective apps. This took 2-4 hours of strenuous effort.

# Paths of important config files
path[0]=’/etc/samba/smb.conf’
path[1]=’/etc/ldap/ldap.conf’
path[2]=’/etc/smbldap-tools/smbldap.conf’
path[3]=’/etc/smbldap-tools/smbldap_bind.conf’
path[4]=’/etc/logroate.d/logrorate.conf’
path[5]=’/etc/logrotate.d/samba.audit’
path[6]=’/etc/dhcp/dhcpd.conf’
path[7]=’/etc/libnss-ldap.conf’
path[8]=’/etc/pam_ldap.conf’
path[9]=’/etc/nsswitch.conf’

http://siddou.mynetgear.com/2013/06/install-sambaopenldap-on-debian-7-wheezy/

Now the biggest challenge is to backup these configuration files on regular intervals and backup them to cloud. The easiest and free-ist way to use the cloud based backup is dropbox. There are so many other products are available but I love Dropbox!

Being a lazy fellow its very difficult to do monotonous things by logging in and taking backup of config files day in day out. So the killer combination of lazy + script-writer, found a cool script which came to my rescue.

Dropbox uploader is pretty simple to use. Click the link to know the instructions to configure, run and schedule as cron job. I also referred another blog to integrate dropbox uploader with a shell script to zip and upload files to the cloud.

Here is the script for reference which I modified to my needs based on above mentioned blog and using dropbox uploader. I hope I can trust cloud backup better than pen drive or portable disk drives because of data availability and instant restore features.