SYNOPSIS | DESCRIPTION | FAQ | ENVIRONMENT VARIABLES | HINTS | VERSIONS | LICENSE | AUTHOR | CONTRIBUTORS | SEE ALSO
ppplag.pl <option(s)> <logfile1> <logfile2> ... ppplag.pl -h prints help on options and usage
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
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 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)
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)
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)
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)
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.
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!
Vladi Belperchinov-Shabanski <firstname.lastname@example.org> <email@example.com> http://cade.datamax.bg
Gabor Z. Papp <gzp -AT- papp.hu> for the pppd ads help and remarks Robert Hoekstra <robert.hoekstra -AT- parox.nl> for user auth patch (server-side logs) Lewi Supranata .K (ichtus) <ichtus -AT- mbone.petra.ac.id, http://mbone.petra.ac.id/mypages/ichtus for costs patch Andrea Spadaccini <lupin85 -AT- email -DOT- it> for -d, -r and -n options
Other similar program is:
PPP Summary - A PPP daemon log analizer by Ricardo Basto <ricbasto -AT- dglnet -DOT- com -DOT- br>