ninpaths project is a fast inpaths reporting program.
It works as follows: you feed it the Path lines via an INN channel feed, and from time to time the program writes all its internal counters accumulated so far to a dump file. Another instance of the program picks up all the dump files, adds them up and formats them into the report.
A working setup goes as follows:
0. Make a directory MOST_LOGS/path
1. Set up a channel feed like
if your INN supports WP, else see below.
2. Enter in your crontab:
6 6 * * * ctlinnd flush !inpaths
(the actual time doesn't matter)
This will generate the dump files, one a day.
3. Once a month run the "sendinpaths" script, which collects the dumps,
makes a report and deletes old dumps.
(You can generate a report without mailing it and without deleting
any old files with "sendinpaths -n".)
On my small test box, where the collected Path lines from the older inpaths accumulated about 4MB daily, the daily dump file runs around 50-100k. The program is fast; writing the dump doesn't take more than a few seconds, preparing a report a bit more.
ninpaths takes the following parameters:
-p Read Path lines from standard input.
-d file Dump data to file. A "%d" in the file name will be replaced by
the current system time when the dump proceeds.
-u file Read a dump file.
The "-u file" argument can be repeated to collect several dumps.
-r site Produce a report for "site".
-v n Set report verbosity (n=0,1,2; default=2).
No check is made (by now) whether the given arguments make any sense.
If your INN doesn't have the WP feed flag (1.5 has not, 1.6 has, 1.7
I don't know, 2.0 has) use the following:
where "ginpaths" is the following script:
exec egrep '^Path: ' | ninpaths -p -d MOST_LOGS/path/inpaths.%d
(of course, replace MOST_LOGS with the right directory in all of the above)
The idea and some implementation details for ninpaths come from the original inpaths program, but most of the code has been rewritten for clarity. This program is in the public domain.