[Samba] MRTG + Samba

Mike Brodbelt m.brodbelt at acu.ac.uk
Tue Feb 11 18:11:11 GMT 2003


Ryan Beisner wrote:
> Hi all
> 
> 
> Just wondering if anyone has pointers for graphing data from Samba using
> MRTG.  I already have MRTG graphing things like signal strength (cisco
> aironet pci), total kbps in/out each interface, mem and disk i/o usage.
> 
> I'd like to graph, for example, average number connections over time; or
> maybe logins per hour .... or failed logins per hour.
> 
> I know MRTG's requirements for input formatting -- it's getting the
> first two of these four numbers that gets me hung up:

You'll probably have to do some scripting.

You can get the current number of service connection by parsing the
output of "smbstatus -S", and the current number of connected clients
with "smbstatus -b". For failed logins, you'd probably have to parse the
logfile, but you could have syslog write to a pipe, and sit a script on
the end of the pipe.

I haven't really done anything with mrtg except point it at a router, so
how you get that into it is another matter. Personally, I'd probably
cron a perl script, which would periodically get data from smbstatus,
and use the perl bindings for rrdtool to stick it directly in an RRD,
and then build your graphs from that. YMMV.

HTH,

Mike.



More information about the samba mailing list