[mrtg] Re: SMB user / share count script

John Adams jadams007 at earthlink.net
Sat Oct 30 00:36:46 MEST 2004


try something like this..

netstat -n | grep 139 | wc -l
You may want to stick "uniq" in there also to remove duplicate 
connections.  It's up to you


Not sure if this will work, but try something like this..

#!/bin/sh
# SMB Connections


UPTIME="/usr/bin/uptime"
HOSTNAME="/bin/hostname"

echo "netstat -n | grep 139 | wc -l"
echo "netstat -n | grep 139 | wc -l"

$UPTIME | gawk '{print $3, $4, $5}'
$HOSTNAME

I am sure you can elaborate on this, and make it much better, but
this should get you going..

John





On Oct 29, 2004, at 2:29 PM, Dan Tappin wrote:

> Does any one have or seen a quick and dirty script (shell ,perl etc) 
> to output current smb users / shares for MRTG?
>
> Thanks,
>
> Dan T
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list