Sambastatus: my first module for nethserver

“Come on idiot/Vamos idiota” :grinning:
Now, I need to see it.

4 Likes

New features with version 7.2.0!!!

sambastatus02

Now you can see the name of the host, not only ip address. This process is a little slow and, in don’t know why, don’t work with all client. (Somebody can explain me why?)

In the new tab you can see the last login date of the user and found how many user have never logged in.This function is usefull for me.

Url of package: http://minucci.net/nethserver/nethserver-sambastatus-7.2-0.noarch.rpm
Url of my repository: http://minucci.net/nethserver/

4 Likes

Version 7.3-1 is out!!!

Screenshot with new features:


As usual you can find new package here: http://minucci.net/nethserver/nethserver-sambastatus-7.3-1.noarch.rpm

Repository: http://minucci.net/nethserver/

11 Likes

Great! The module deserves a place among the modules listed in the wiki. Took the liberty to create a new page for it, hope it’s fine with you. Let me know if you spot any error:

https://wiki.nethserver.org/doku.php?id=module:sambastatus

4 Likes

Hi @gecco, thanx again!

I’m testing on arm32 (the not jet released 7.6.1810) so it can be the next is due to the experimental status of the arm install. However I get these messages in journtalctl whenever I load the SambaSatus page:

... sudo[18913]: pam_unix(sudo:auth): conversation failed
... sudo[18913]: pam_unix(sudo:auth): auth could not identify password for [srvmgr]
... sudo[18913]: pam_succeed_if(sudo:auth): requirement "uid >= 1000" not met by user "srvmgr"
... sudo[18913]:   srvmgr : command not allowed ; TTY=unknown ; PWD=/usr/share/nethesis/nethserver-manager ; USER=root ; COMMAND=smbstatus -b
... sudo[18926]: pam_unix(sudo:auth): conversation failed
... sudo[18926]: pam_unix(sudo:auth): auth could not identify password for [srvmgr]
... sudo[18926]: pam_succeed_if(sudo:auth): requirement "uid >= 1000" not met by user "srvmgr"
... sudo[18926]:   srvmgr : command not allowed ; TTY=unknown ; PWD=/usr/share/nethesis/nethserver-manager ; USER=root ; COMMAND=smbstatus -L

Just an minor suggestion from my side:
IMHO it would look cleaner is the module would show up as Samba status instead of SambaStatus .
This because this is more inline with the other names like Domain accounts and Users and groups . Not a Big deal, just a suggestion! (hope it is understandable what i mean… )

afbeelding

EDIT: (opened PR which you can ignore)
afbeelding

2 Likes

I think the same, in the next release i change this name.

For other problem… i don’t know :slight_smile:

2 Likes

BTW: it works just fine!

1 Like

I just updated to the new version without any problems. Great work @gecco

3 Likes

Installed without problems, works as expected! :sunglasses:

2 Likes

@gecco I’m thinking about designing the File server Cockpit UI. I’d like to see the smbstatus output in the File server dashboard page …What do you think? Do you already have some plans for Samba Status on Cockpit?

https://github.com/NethServer/dev/wiki/File-server-UI

5 Likes

yes… but i have to understand cockpit :slight_smile:
i read some documentation but, for my skill, are a little complicated

3 Likes

What is causing trouble?

If you have any question about the cockpit UI or anything else, please ask!

I’d like also to catch some ideas from you or the Samba status users to improve the core Samba and AD accounts provider module!

Functions and json objects, yes it is a little strange at the beginning but this is what is the web development. However once you caught it, or you admitted the general behavior, my general feeling is that it could be quite simple.
I am sure you will have some troubles until you find the way to save/read your first property, then after you will go further and faster…at least this is what I experienced.

6 Likes

but how can i exec a command the print the output?

The log output we made for applications could be a good example, but I would prefer that @edoardo_spadoni answers

If you prefer a full js example you could look to nethserver-ejabberd

Obviously I will need the answer for nethserver-diagtools, so thank to ask it first

1 Like

Hi, you have different kind of API to exec a command and get an output. In this file: NethServer Lib you can use one of the methods listed to get an output.

  • exec: is used to call a script in /usr/libexec/nethserver/api/... JSON is used for input and output, you can see many examples in the nethserver-cockpit module, the core one.

    Es. echo '{"action":"list"}' | /usr/libexec/nethserver/api/system-network/read | jq: print network intefaces list

  • execRaw: is used to output a command without using JSON, it’s like calling a command from bash and get the output, probably what you searching for. Example here.

  • execHints: used to get system hints like: Backup: You should configure at least one data backup, Company: Change the default company. Example here

  • readLogs: used to get the logs output in dump o follow mode. Example here

A recap to written API o UI guidelines is here.

5 Likes

thank you @edoardo_spadoni

1 Like

Just to be clear, the samba status is already implemented inside the new UI: File server Cockpit UI

But currently it doesn’t include the list of joined machines along with their last logon because that should be part of the AD acount provider

1 Like

hello - latest rpm seems to not be able to install
any ideas?

I had to download the file first. It’s not possible to download with yum.

wget http://minucci.net/nethserver/nethserver-sambastatus-7.3-1.noarch.rpm
yum install nethserver-sambastatus-7.3-1.noarch.rpm

This module is for the stable server manager. You may have a look at the new server manager.

6 Likes