[cups] accounting to mysql database?

Pförtsch, Franz Franz.Pfoertsch at brose.com
Tue Jan 17 05:14:04 PST 2017


Hello Allan,

did you take a look at PyKota, at http://www.pykota.com/software/ ?
I did not use it, but it is known to be very powerfull

I have done my "accounting" via printanalyzer.pl or phpprintanalyzer.php.
Nowerday I have a python script which pushest the pagelog into a mysql-database

Regards,
Franz

-----Original Message-----
From: cups-bounces at cups.org [mailto:cups-bounces at cups.org] On Behalf Of hw
Sent: Tuesday, January 17, 2017 1:11 PM
To: The CUPS user discussion list. <cups at cups.org>
Subject: Re: [cups] accounting to mysql database?

Alan Corey schrieb:
>> is there a way to have cups write accounting information directly 
>> into a mysql database rather than to the page.log?
>
> Such a thing would give preference to Mysql when SQLite and PostgreSQL 
> plus a few more are equally valid options.  Better I think to do 
> something generic like tab-delimited text which can be easily imported 
> into any of them and doesn't require any special libraries.  Please, 
> no XML. :)
>

Yes, it doesn´t need to be mysql and could be anything.

If it was possible to give SQL statements to be executed when data is to be written to the page_log, any SQL database could be used.

However, I´m getting different log entries from different printers and had to adjust my log-conversion program to deal with all the different formats.

Reading from a named piped has, IIUC, the disadvantage that the program reading from it must be running and reading the data, for otherwise the pipe will get full and the program writing to it is halted until the pipe is emptied.  If that´s true, I wouldn´t like doing this because it makes for a point of failure.

Starting a program that retrieves the data every time something would be written to the log comes with all the overhead of starting a program, which isn´t ideal, either.

XML sucks, and for some variant of CSV, cpus would need to make sure to correctly escape field delimiters and text-markers.  If it wasn´t for that, you could have cups write your own CSV variant by specifying the PageLogFormat to create it.

Still you would need to poll from a CSV file same way you need to poll the log file, so it won´t be too great of an improvement.

I resorted to having the job-name written as the last field of the line in the log file, thus avoiding problems with spaces within the job name making it impossible to use regular expressions to obtain the fields.

This really is a missing feature.

_______________________________________________
cups mailing list
cups at cups.org
https://lists.cups.org/mailman/listinfo/cups


More information about the cups mailing list