Re: [cups] Monitoring concurrent print jobs
Bryan Mason <[email protected]> Tue, 20 Jun 2023 13:20:34 -0700
| Newsgroups | gmane.comp.printing.cups.general |
|---|---|
| Organization | Red Hat |
| Message-ID | <[email protected]> |
On Mon, 2023-06-19 at 17:03 -0700, Dave Close wrote: > ... trying to discover the > actual number of concurrently active jobs (to any printer) has me > stymied. The CUPS log files don't seem to provide enough information. > > Is there a better way to get this information besides parsing the > logs? The lpstat command can give you a lot of information on jobs. "lpstat -p" gives you a list of all the print queues and their statuses. If one of the queues is actively processing a job, the status will begin with something like: printer rlap now printing rlap-12. "lpstat -o" will give you a list of all non-completed jobs in all print queues. "lpstat -W completed -o" will give you information on completed jobs, and that information includes the date/time the job was submitted, but I don't think it includes a timestamp for job completion. The output of this command is also limited to the number of jobs for which CUPS has history in /var/spool/cups. If you have "Loglevel info" (or "LogLevel debug") set in cupsd.conf, then the CUPS error log contains "Queued on" and "Job completed" messages with timestamps that will let you know when the job was submitted (when the Create-Job request was sent) and the time the job was completed. For example: # journalctl --no-host -u cups.service | grep -E '(Queued on)|(Job completed)' Jun 20 13:07:18 cupsd[742]: [Job 7] Queued on "rdn" by "root". Jun 20 13:07:18 cupsd[742]: [Job 7] Job completed. Jun 20 13:08:31 cupsd[3770]: [Job 8] Queued on "rdn" by "root". Jun 20 13:08:31 cupsd[3770]: [Job 8] Job completed. From that you should be able to calculate the number of jobs active at any given time. ~ Bryan _______________________________________________ cups mailing list [email protected] https://lists.cups.org/mailman/listinfo/cups