Date: Sun, 18 Jul 1999 11:19:34 -0400 From: Mark Conway Wirt <mark@intrepid.net> To: Chris Cook <ccook@tcworks.net>, freebsd-isp@FreeBSD.ORG Subject: Re: Connected Users Message-ID: <19990718111934.D7635@intrepid.net> In-Reply-To: <378F80AD.541ACD7F@tcworks.net>; from Chris Cook on Fri, Jul 16, 1999 at 01:57:49PM -0500 References: <378F80AD.541ACD7F@tcworks.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 16, 1999 at 01:57:49PM -0500, Chris Cook wrote:
> Hello all,
>
> I was wondering if anyone has setup some sort of HTML interface to view
> active dialup sessions? Would you go about doing this with SNMP or is
> there someway to use RADIUS to output the list of active sessions into a
> file that I could use on a web page? We use Livingston PM3's with
> Livingston Radius. Any feedback would be appreciated!
There is a utility called pmwho:
http://www.vii.com/portmaster/pmwho.html
that operates more-or-less like a finger command, and you could easily
pipe that to an HTML interface. The problem with that, though, is
that it telnet's into the portmaster, and must therefore be compiled
(or called) with the portmaster's password. If you're careful, and on
a trusted machine, this wouldn't be too bad.
A better solution is to use SMNP as you can do this with the read
community string, which is safer than putting your PM's passwords in a
file somewhere. The following snippet of Perl does just this, using
snmpwalk (note that this is an old version -- newer versions of
snmpwalk may require SNMP version information on invocation.
-------------
$script = "pmfinger";
use Getopt::Std;
$public="Your public string";
getopt('p');
if ($opt_p eq "")
{
die "usage: $script -p portmaster\n";
}
$date = `date`;
chop($date);
@users = `snmpwalk $opt_p $public .1.3.6.1.4.1.307.3.2.1.1.1.4 | grep \
-E \"\\\".+\\\"\" | cut -d\"\\\"\" -f 2 `;
print "Current login utilization for $opt_p:\n";
foreach $user (@users)
{
chop ($user);
print "User: $user\n";
}
------------
A more elegant solution would to be to use the SNMP perl module, and
do something like:
use SNMP 1.7;
$session = new SNMP::Session ( DestHost => $host,
Community => "$community");
$host = $session->{DestAddr};
########################
# We assume 48 ports :-)
########################
for ($i=1; $i<48;$i++)
{
$port = $session->get("enterprises.307.3.2.1.1.1.2.$i");
$type = $session->get("enterprises.307.3.2.1.1.1.3.$i");
$user = $session->get("enterprises.307.3.2.1.1.1.4.$i");
$time = $session->get("enterprises.307.3.2.1.1.1.9.$i")/100;
# ...and do stuff here.....
}
Safer: no password compromise...
--Mark
On Fri, Jul 16, 1999 at 01:57:49PM -0500, Chris Cook wrote:
> Hello all,
>
> I was wondering if anyone has setup some sort of HTML interface to view
> active dialup sessions? Would you go about doing this with SNMP or is
> there someway to use RADIUS to output the list of active sessions into a
> file that I could use on a web page? We use Livingston PM3's with
> Livingston Radius. Any feedback would be appreciated!
>
> --
> Chris Cook
>
> The Computer Works
> http://www.tcworks.net
>
>
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-isp" in the body of the message
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990718111934.D7635>
