Sambastatus: my first module for nethserver


(Carlo Minucci) #61

thank you @mrmarkuz, @Ctek and @netbix

(Carlo Minucci) #62

i’m the king of the bugfix :smiley:

now is “NethServer 7 ready” :slight_smile:

I put script in %post section of rpm package which add a file in /etc/sudoers.d/ if found nethserver version 7. The control check is into the php file too, if the version is 7 use “sudo smbstatus” instead of “smbstatus”

(Antonio) #63


I have upgrade package but …

Nome Utente -> OK
Nome Host -> NOT OK
Indirizzo IP -> OK

My Nethserver 7 DC

(Antonio) #64

[root@sogomail ~]# smbstatus -p

Samba version 4.4.4
PID Username Group Machine Protocol Version Encryption Signing

15220 domain (ipv4: SMB3_11 - partial(AES-128-CMAC)
[root@sogomail ~]#

(Carlo Minucci) #65

mmm… ok
i’ll try to fix in the next release :slight_smile:

(Filippo Carletti) #66

Please, don’t create files in %post.
Revert and add a file in the rpm package like in this example:

(Alessio Fattorini) #67

Ahaha :crown:
Amazing collaborative effort guys :smiley:

(Carlo Minucci) #68

this is the hardware version of SambaStatus :slight_smile:

(Enrique D) #69

I wonder if is safe to install the module?


(Carlo Minucci) #70

SambaStatus for NethServer 7 is ready!!!

You can download and install from here

For NethServer 6.x you must use the old version. Found all version here

Source here

Samba Status Module in nethserver 7
(Alessio Fattorini) #71

That’s a big news. I love the pic :smiley:

(Davide Principi) #72

I definitely love the pic, but his badge choice is the top!!! :heart_eyes_cat:

@gecco thank you for the module and for being here!

(Enrique D) #73

Thanks for the module.

To install I just need to do this?

rpm -i nethserver-sambastatus-7.0-1.x86_64.rpm

and nothing else? :thinking:

(Rob Bosch) #74

That should be enough, provided you have downloaded the rpm first and are in the directory you saved the rpm to.

[root@ns7 ~]# wget
–2018-10-03 21:18:28--
Resolving (…
Connecting to (||:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 6236 (6.1K)
Saving to: ‘nethserver-sambastatus-7.0-1.x86_64.rpm’
100%[======================================>] 6,236 --.-K/s in 0.001s
2018-10-03 21:18:28 (5.73 MB/s) - ‘nethserver-sambastatus-7.0-1.x86_64.rpm’ saved [6236/6236]
[root@ns7 ~]# rpm -i nethserver-sambastatus-7.0-1.x86_64.rpm
Counting installation…

(Carlo Minucci) #75

thank for your supporto @robb :slight_smile:

(Enrique D) #76

Why the “Share” tab is empty?

Currently I have 4 shared folders:

Locked Files shows just two (maybe the only used right now):


BTW… Wonderful module. Thank you @gecco !

(Carlo Minucci) #77

“Share” tab is the result of the command

smbstatus -S

if you don’t have any active connection the tab is empty. Mayby i have to change the name of this tabs :slight_smile:

(Enrique D) #78

Using windows 8,
Open an image file in a shared folder
I wait some moments
Run the command and check the “Share” tab
Both shows empty
:thinking: Maybe I need to restart something?

(Rob Bosch) #79

I run Fedora28 and as soon I connect to a share, it shows in Sambastatus just fine…

(Markus Neuberger) #80

Hm, as @robb reported, the command and the Share tab is working for me in Windows 10 and Firefox but if the command result is empty there may be another problem…

Thanks for your effort!

The machines joined to domain was not working for me because they’re not listed in /var/lib/nethserver/home.
I added /usr/bin/net to sudoers and changed the command in the Joined.php template.


# 30_nethserver_sambastatus
%srvmgr ALL=NOPASSWD: /usr/bin/smbstatus, /usr/bin/net


$command = "sudo /usr/bin/net ads search -P objectClass=Computer | grep 'cn: ' | cut -f 2 -d ' ' | sort";
$pc = shell_exec($command);
$arrpc = explode("\n", $pc);