NAME

SYNOPSIS

DESCRIPTION

ppplag.pl reads system log and shows table of all found ppp sessions
with stats for start time, duration, bytes in/out, speed in/out.
The system log file (syslog) usually is located at
/var/log/messages
however it could be different (also usually located in /var/log
directory but under different name: syslog, details, etc.)
The only thing you have to do is to run ppplag.pl. It has no
additional parameters and shows full ppp sessions grid. If you
need just partial information check the HINTS file inside
ppplag.pl package. If your system log file is different you may
either edit ppplag.pl to set real one or give correct path as
first (and only) parameter:
ppplag.pl /var/log/syslog
ppplag.pl depends on standard pppd log messages:
`pppd\[(\d+)\]: +Connect: +'
`Connect time ([\d\.]+) minutes'
`Sent (\d+) bytes, received (\d+) bytes'
`peer authentication succeeded for (.*)'
and one special one:
`user="([^\"]+)"'
this matches part of this line:
`sent [PAP AuthReq id=0x1 user="username" password=<hidden>]'
which is available only if pppd is started with `debug' option and works
for PAP authentication (possibly with CHAP but it is not tested)
If your pppd does not log anything or log format is different
ppplag.pl won't work. (which would be exception)

FAQ

Q: why -l does not work?
A: -l uses pppd debug messages, so you have to do two things:
1. start pppd with `debug' in the options file
2. edit /etc/syslogd.conf and put smilar line:
*.* /var/log/details
which means that everything will be logged into /var/log/details
(including pppd debug messages, which is by default off for
/var/log/messages)

ENVIRONMENT VARIABLES

PPPLAG_LOGFILE
tells ppplag where is default log file instead of /var/log/messages
PPPLAG_CURR
currency label, this text appears in the header
PPPLAG_COST
costs in local currency per time unit (defaults to 1)
PPPLAG_UNIT
time unit in minutes (this defaults to 1 minute)
PPPLAG_FEE
fee per month (defaults to 0)

HINTS

Hint 1: To get only summary info:
ppplag.pl | grep "^[ -]" | uniq
(there is `-s' option for this anyway)
Hint 2: To get info for specific month: (November in this example)
ppplag.pl | grep -E "^([ -])|(Nov)"
(there is `-m' option already for similar result)
Note: this will show all November's in case that your log is more
than year old...
(there is no simple way to get around this)

VERSIONS

ppplag.pl versions will be time marked, first one is 20001104.
(i.e. YYYYMMDD year,month,day of the release)
For changelog/history details see the header part of ppplag.pl.

LICENSE

ppplag.pl is distributed under the GPL license, see COPYING for
the full license text.
All notes, suggestions, ideas you may have are welcome. Thanx!