Sambastatus: my first module for nethserver

module

(Carlo Minucci) #61

thank you @mrmarkuz, @Ctek and @netbix


(Carlo Minucci) #62

ok
i’m the king of the bugfix :smiley:

https://minucci.net/nethserver/nethserver-sambastatus-0.4-1.x86_64.rpm

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

OK

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 antonio@netbix.it domain users@netbix.it 192.168.0.223 (ipv4:192.168.0.223:64247) 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 https://github.com/carlominucci/SambaStatus/commit/2600d6b7c0a3e28ff96a9960718d54286f8ffa38 and add a file in the rpm package like in this example:
https://github.com/NethServer/nethserver-openvpn/blob/master/root/etc/sudoers.d/20_nethserver_openvpn


(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?

Regards


(Carlo Minucci) #70

SambaStatus for NethServer 7 is ready!!!

You can download and install from here http://minucci.net/nethserver/nethserver-sambastatus-7.0-1.x86_64.rpm

For NethServer 6.x you must use the old version. Found all version here http://minucci.net/nethserver/

Source here https://github.com/carlominucci/SambaStatus


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 http://minucci.net/nethserver/nethserver-sambastatus-7.0-1.x86_64.rpm
–2018-10-03 21:18:28-- http://minucci.net/nethserver/nethserver-sambastatus-7.0-1.x86_64.rpm
Resolving minucci.net (minucci.net)… 46.28.5.100
Connecting to minucci.net (minucci.net)|46.28.5.100|: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?
image

Currently I have 4 shared folders:
image

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

Regards

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.

/etc/sudoers.d/30_nethserver_sambastatus:

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

/usr/share/nethesis/NethServer/Template/SambaStatus/Joined.php:

$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);