Re: online-usage cgi

Dale E. Reed Jr. ( (no email) )
Sun, 24 May 1998 11:27:42 -0700

Danny Sinang wrote:
> I would like to make an online usage graph like the MRTG one at
> but I don't know if MRTG could access
> RRAS's info.
> So, I would want to base the graph on the Calls table populated by RadiusNT.
> I've been pushing my brain to the limit on how to do it, but I just can't
> think of a neat, clean-cut SQL-based way of doing it.
> All I've figured out so far is to programmatically create a "Stack" table
> and "Push" values ( Calldate, NasPort, Username ) in for each login, along
> with an incrementing counter value ( to indicate increase in number of ports
> being used ). For each logout, I would "Push" a row also, but this time
> with decrementing ctr value ( to indicate a decrease in ports in use ).
> Then after this "Stack" table is populated, I would simply use Crystal
> Reports Web Report to graph the increasing / decreasing Counter value
> against their associated Calldate's.
> Can you show me a better way of doing this ?

We do this, but its SQL Server based.

First, Go into your Servers table and make sure your Location fields are
setup so that they match (typically your regions or pops).

Then create a table like this:

CREATE TABLE dbo.OnlineCount (
Date smalldatetime NOT NULL ,
Location varchar (15) NOT NULL ,
UserCount int NOT NULL

Lastly, using SQL Executing to execute a command like this on what ever
interval you want your granularity:

Insert Into OnlineCount
Select GetDate(), Location, Count(Username)