[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ip-{up,down} scripts



On Wed, Jun 02, 1999 at 02:33:52PM +0100, Edward Betts wrote:
> I would like to see some clever logging facilities. I would like a log with a
> single line for each connection, recording the name of the connection, user
> who connected, the time of connection, the length of the call, and the reason
> for disconnecting (user killed pppd, root killed pppd, modem hangup), and the
> cost. So, it might look like this:
> 
> provider edward Jun  2 14:20:00 1800 user £1.20
> 
> Is that easy to implement? Where would I start? Maybe include the number of
> bytes transfered in each direction. I think to be done properly it needs pppd
> to be hacked about a bit, or can it be done in the ip-up/down scripts?

pppd calls /etc/ppp/ip-up with the following parameters:
 interface-name  tty-device  speed  local-IP-address remote-IP-address ipparam

pppd already counts the number of bytes in/out at the end of the connection but 
you'll have to code the rest of the logging features. Couldn't be too tricky.
A nice to implement it is to make pppd call the ip-down script with the added
parms, then it won't interfere with the already existing code and the kernel
guys will probably take a patch for it so you won't have to recode everything
when a new pppd is released.

-- 
-----------------------------------------------------------------------------
Sarel Botha          |     Computer &           | +27 341 81341
(sjb@dundee.lia.net) |        Accounting        | BOX 2065, Dundee
                     |           Services       | 3000, South Africa
-----------------------------------------------------------------------------
 "The End is near." -- http://www.geocities.com/Athens/Olympus/7771/666.htm
-----------------------------------------------------------------------------


Reply to: