PPPUSAGE(1)
π PPPUSAGE(1) β like, the manual page, bestie
okay so real talk: this is PPUSAGE(1), section 1 of the manual, and it comes to you courtesy of User Contributed Perl Documentation. Yes, Perl. We stan a legacy icon. πͺβ¨
β¨ NAME β¨
pppusage β generates PPP connection summaries. That's the whole gig. π
πΈ SYNOPSIS πΈ
pppusage [-bcq] [-f datafile] [-t yyyy[mm[dd]][-yyyy[mm[dd]]]]
[logfile...]
pppusage [-hv]
Like, that's the shape of it. Flags, maybe a datafile, maybe a time range, maybe some logfiles. Very choose-your-own-adventure. π¦
π DESCRIPTION π
So pppusage summarizes average and total transfer volumes, number of connections, and average and total online time for all the logged PPP connections. It's giving accountant but make it dial-up. π
Where does the data come from? It reads the logfiles that contain the ppp[d] messages. That's the source of truth, periodt.
And here's the cute part: you can feed it multiple logfiles β like the active one and the rotated ppp[d] logfiles β so that new ppp[d] entries don't get missed when the relevant logfile gets rotated before pppusage has seen them. Chef's kiss. π«Ά
β οΈ but bestie, please go read "CAVEATS" below before you get too excited about that multiple-logfile thing. It's lowkey a trap.
pppusage saves the relevant data in datafile (a Berkeley DB database), and you can keep that updated automatically on a regular basis by using cron(5) or something similar. Set it and forget it, icon behavior. π
π OPTIONS π
By default, pppusage does all four steps: it parses the PPP syslog files, saves the data, reads the saved data, and spits out the summaries for all available data. One little overachiever. π
But you can split up building the database on the one hand and querying it on the other by using some of the following options:
-bβ don't use ANSI colors and attributes for thepppusageoutput. No sparkle. Monochrome era. π€-cβ parse the PPP syslog files, update the Berkeley DB database file (or create it, if it doesn't exist), and exit. This one is especially useful if you want the database updated automatically in the background on a regular basis. Like this:
05 14 * * * nice /usr/bin/core_perl/pppusage -c > /dev/null
That crontab(5) entry would update the database once a day (at 2:05 pm). 2:05 pm specifically. We respect the schedule. β°
-fdatafile β specify the database file that should be used bypppusage. ποΈ-qβ query the database: read the database file and spit out summaries. If the time range is not specified with-t, all available data will be processed. Everything. The whole buffet. π-hβ print out a quick overview of all available options and exit. Your little helper bestie. π-tyyyy[mm[dd]][-<yyyy>[mm[dd]]] β specify the time period for a query. You can do it either by specifying a single year, month or day, or by specifying a time range. A time range is used by specifying two dates, seperated with a`-`. The order in which the two dates are given is irrelevant β no clock-watching here. Any combination of days, months or years may be specified. Implies-q. β-vβ print version information and exit. π¦
π CONFIGURATION π
The configuration file used by pppusage simply is a perl file that is read on startup. Yes, a perl file. It's giving old money. π
Both the logfiles to parse and the database file to use may be adjusted by setting the following variables. However, specifying them on the command line will overwrite these settings. Command line stays winning. The default values are shown in brackets.
$logfiles = 'logfile...';[ls /var/log/messages*] β theppp[d]logfiles to parse. A space delimited list must be used to specify multiple files. Note that if you specify the files to parse directly (as opposed to using the output of a command likels), you must use normal"quotation marks", not`backticks`! This is not a drill, bestie, I cannot stress this enough. π$datafile = 'datafile';['/tmp/pppusage.db'] β the file that is used bypppusageto store it's data. Normally it makes sense to set this to a different path, especially if the/tmpdirectory gets wiped out every now an then (by, for example, acron(5)job or on boot). Like, protect your data, queen. π‘οΈ$configured = 0|1;[0] β forget about this one. We needed it to make sure that those of you who upgraded from older releases ofpppusagehave set$logfilescorrectly by forcing them to open the configuration file and setting$configuredto1;-) Actually, you can simply delete this variable completely. It will be removed from future releases ofpppusage. It's giving legacy baggage. π
π§ EXAMPLES π§
pppusage
Parses the syslog files that ppp[d] logs it's messages to, saves the relevant data to a Berkeley DB file and writes summaries regarding all available data to STDOUT. The full package. β¨
pppusage -t 2003
Searches the database file for all PPP connections logged in 2003 and writes the results to STDOUT. Ah, 2003. Vintage. π
pppusage -t 200305
Searches the database file for all PPP connections logged in May 2003 and writes the results to STDOUT. πΈ
pppusage -t 2003-200303
Searches the database file for all PPP connections logged in the first quarter of 2003 and writes the results to STDOUT. Q1 slay. π₯
pppusage -t 20030915-20030931
Searches the database file for all PPP connections logged in the second half of September 2003 and writes the results to STDOUT. π
pppusage -b -f /tmp/pppusage.2002.db -t 20020501
Searches the database file /tmp/pppusage.2002.db for all PPP connections logged at May 1st, 2002 and spits out the results without using any ANSI colors or attributes. Minimalist moment. π€
ποΈ FILES ποΈ
~/.pppusagercβ user configuration file. Your personal vibe file. π/etc/pppusagercβ system-wide configuration file. The communal vibe file. π
β οΈ CAVEATS β οΈ
okay bestie, sit down, this is the serious part. π
Since pppusage tries to get multiple logfiles in the right order simply by sorting them by their last modification time, feeding multiple logfiles to pppusage will most probably produce a broken database if they were modified after they have been rotated. Sorting by mtime is not the girlboss move it thinks it is. π
Even worse: updating an existing database with logfiles that contain data which is older than the already parsed data won't work either. This would again result in a broken database. Double π.
In both cases the database file must be deleted and recreated. No shortcuts, no workarounds. Recreate it. π¨
π BUGS π
Most probably, there are some. Please let me know if you find them! Honest king. π
π SEE ALSO π
ppp(8), pppd(8), syslog(8), syslog.conf(5), cron(5), crontab(1), crontab(5)
π AUTHOR π
Holger Weiss <holger@jhweiss.de>
and that's the whole page, bestie π β brought to you by perl v5.42.0, dated 2025-12-14, and lovingly stamped PPUSAGE(1) at the top and bottom like a little bow π go forth and summarize your PPP connections, no cap β¨
π¦ where this page comes from
- arch rolling: pppusage 0.2.5-18 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms