Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Zabbix + samba4

231 views
Skip to first unread message

Gian Henriques

unread,
Nov 26, 2013, 11:10:02 AM11/26/13
to
Hello there,

I'd like to know if there are some way to gather statistics from samba4,
like quantities of active users and other things that it can offer then
use it in zabbix to generate some graphs and triggers.

I can do somethings in smbstatus of samba3, but i couldn't find anything
like this in samba4.

is there anybody here who could do it?

Thank's a bunch!

--

*Gian Luca Henriques*
Analista de Redes
(31) 3769-2000 -- ramal 2105
gia...@viareal.com.br

Via Real Telecom <www.viareal.com.br>
Soluções em Internet e Telefonia
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Gian Henriques

unread,
Nov 27, 2013, 5:30:01 AM11/27/13
to
Nobody?

Niels Dettenbach

unread,
Nov 27, 2013, 6:10:01 AM11/27/13
to
Am Mittwoch, 27. November 2013, 08:25:41 schrieb Gian Henriques:
> > I'd like to know if there are some way to gather statistics from
> > samba4, like quantities of active users and other things that it can
> > offer then use it in zabbix to generate some graphs and triggers.
> >
> > I can do somethings in smbstatus of samba3, but i couldn't find
> > anything like this in samba4.
Take a look at i.e. the

net
or

net status

command (should be on board with samba4 too i assume - not tried it so far).


> > is there anybody here who could do it?

Some years ago i've fiddeled with zabbix. I remember that i've worked mainly
with nagios plugins within zabbix for functionality zabbix did not has "on
board" byself.

Take a look at nagios plugins like i.e.:

check_smb_share
check_smb

zabbix allows easily to create own commands - i.e. if you want to get the
active samba sessions you may use something like:

net status sessions | wc -l

(gives the amount of active sessions as an integer)


hth at least a little...

best regards,


Niels.
--
---
Niels Dettenbach
Syndicat IT & Internet
http://www.syndicat.com
PGP: https://syndicat.com/pub_key.asc
---




signature.asc

Gian Henriques

unread,
Nov 27, 2013, 11:30:02 AM11/27/13
to
Thanks!

Now I'm trying to run 'net status' with my zabbix user but it fails.

"Failed to initialize session_global: NT_STATUS_ACCESS_DENIED"

All my samba4 directory (/usr/local/samba) have as owner the user and
group 'root'. I try to change the owner user and group of all files to
my user zabbix but it not work's. I need to give permission to my zabbix
user in some files/directories?

Rowland Penny

unread,
Nov 27, 2013, 11:40:03 AM11/27/13
to
Can you not run the command with sudo?

Doesn't Zabbix have the ability to run commands as root via sudo?

Don't alter ownership of files & directories unless you know what you
are doing, you are likely to break something else.

Rowland

Niels Dettenbach (Syndicat IT&Internet)

unread,
Nov 27, 2013, 12:00:03 PM11/27/13
to


Gian Henriques <gia...@viareal.com.br> schrieb:
>Thanks!
>
>Now I'm trying to run 'net status' with my zabbix user but it fails.
>
>"Failed to initialize session_global: NT_STATUS_ACCESS_DENIED"

You have at least two options:

- give zabbix user proper administrator access in samba
or
- use sudo with a passwordless config for zabbix user

hth,
best regards,


Niels.
--
Niels Dettenbach
Syndicat IT&Internet
http://www.syndicat.com

Rowland Penny

unread,
Nov 27, 2013, 12:10:04 PM11/27/13
to
On 27/11/13 16:52, Niels Dettenbach (Syndicat IT&Internet) wrote:
>
> Gian Henriques <gia...@viareal.com.br> schrieb:
>> Thanks!
>>
>> Now I'm trying to run 'net status' with my zabbix user but it fails.
>>
>> "Failed to initialize session_global: NT_STATUS_ACCESS_DENIED"
> You have at least two options:
>
> - give zabbix user proper administrator access in samba
Please don't do this, do you really want the zabbix user to have that
much power just to run 'net' ?
> or
> - use sudo with a passwordless config for zabbix user
Better idea, this is not a samba problem really, but you could try
adding the zabbix user to /etc/sudoers (via visudo) with a line similar
to this:

zabbix ALL=(ALL) NOPASSWD: /path/to/net

Rowland
>
> hth,
> best regards,
>
>
> Niels.

--

Jean Dias

unread,
Nov 27, 2013, 12:40:01 PM11/27/13
to
Em 27-11-2013 15:03, Rowland Penny escreveu:
> On 27/11/13 16:52, Niels Dettenbach (Syndicat IT&Internet) wrote:
>>
>> Gian Henriques <gia...@viareal.com.br> schrieb:
>>> Thanks!
>>>
>>> Now I'm trying to run 'net status' with my zabbix user but it fails.
>>>
>>> "Failed to initialize session_global: NT_STATUS_ACCESS_DENIED"
>> You have at least two options:
>>
>> - give zabbix user proper administrator access in samba
> Please don't do this, do you really want the zabbix user to have that
> much power just to run 'net' ?
>> or
>> - use sudo with a passwordless config for zabbix user
> Better idea, this is not a samba problem really, but you could try
> adding the zabbix user to /etc/sudoers (via visudo) with a line
> similar to this:
>
> zabbix ALL=(ALL) NOPASSWD: /path/to/net
>
> Rowland
>>
>> hth,
>> best regards,
>>
>>
>> Niels.


Hey All,

I and Gian are colleagues and Thanks for the replies.

Although I think it's not a secure way, We had already granted sudo
permissions for zabbix user but the same error message was returned.

I've done this way now:

in crontab, I scheduled to run the command and then redirect the result
for a file in /tmp.
Then the zabbix daemon get the result in this file.

Its working fine, but I think its not the best way yet. But the zabbix
user can only read the file, turning into more secure.
0 new messages