Samba monitoring
-
Hello,
Is there a way to monitor samba similar to this https://www.netxms.org/forum/configuration/monitoring-ftp-daemon/msg10341/#msg10341 with externalparameter using smbclient //server/service -U user?
Because with ProcessCount it's not possible to tell whether samba is running or not.
Regards,
Nikk -
Which distro are you using?
Ubuntu:
Samba running:
user@box:~$ status smbd smbd start/running, process 1406user@box:~$ smbstatus Samba version 3.6.3 PID Username Group Machine ------------------------------------------------------------------- Service pid machine Connected at ------------------------------------------------------- share1 2714 client1 Tue Apr 8 20:42:18 2014 share1 31445 client2 Mon Apr 14 11:17:00 2014 share2 2714 client3 Tue Apr 8 20:42:18 2014 share3 2714 client2 Tue Apr 8 20:42:18 2014 Locked files: Pid Uid DenyMode Access R/W Oplock SharePath Name Time -------------------------------------------------------------------------------------------------- 31445 1000 DENY_NONE 0x100081 RDONLY NONE /srv/user path/OpenFolder Mon Apr 21 19:32:00 2014Samba not running:
user@box:~$ status smbd smbd stop/waitinguser@box:~$ smbstatus Samba version 3.6.3 PID Username Group Machine ------------------------------------------------------------------- Service pid machine Connected at ------------------------------------------------------- No locked filesIf you want to check via ProsessCount, did you try "smbd"?
user@box:~$ ps aux|grep smbd root 15030 0.0 0.2 122504 5756 ? Ss 15:44 0:00 smbd -F root 15031 0.0 0.0 122504 1508 ? S 15:44 0:00 smbd -F user 15032 0.0 0.1 124976 3524 ? S 15:44 0:00 smbd -F -
Hi!
If you have Windows agent somewhere, you can use Net.RemoteShareStatus or Net.RemoteShareStatusText parameter. Syntax is following:
Net.RemoteShareStatus(share,domain,login,password)
Net.RemoteShareStatusText(share,domain,login,password)Best regards,
Victor -
Thanks for your responses!
Borgso, i will try smbstatus, but ProcessCount with smbd is faulty, because, there are still many smbd processes running, while samba itself is down.

Victor, what are the status return codes?
Using this Net.RemoteShareStatus(share,domain,login,password)
It shows 0, also when i type incorrect domain, respectively OK for Text. -
Net.RemoteShareStatus should return status code returned by NetUseAdd Windows API call. Level 2 call is used.
Best regards,
Victor
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login