Is there a way to log who is printing how many pages to what printer on a
Samba Print Server?
We have an AD setup, and a plain Debian VM joined as a Domain Member
running CUPS and Samba. The printer is available to users, but every time
they print, it shows up as "Unknown" for the Name, and
"Withheld" for the
User.
The user we tested as so far is the Domain's Administrator account. We
would like it to list the Windows username (which is tied to AD) when
printing. Is there any way to do that?
I'm sure it's off topic, but I also cannot find the
/var/log/cups/page_log
file on this server - looking at an old thread from April, 2019 (
https://marc.info/?l=samba&m=155420955300420&w=4), it appears that even
if
I could, it would still list the unknown information.
Samba 4.9.5-Debian (installed from Buster repo, not Louis' repo)
CUPS 2.3.3 (installed from source)
Debian 10.9
smb.conf file (sanitized):
# Global parameters
[global]
bind interfaces only = Yes
client signing = required
disable netbios = Yes
interfaces = lo enp1s0
log file = /var/log/samba/%m.log
realm = DOMAIN.CA
security = ADS
server role = member server
server signing = required
template homedir = /home/test/%U
winbind separator = /
workgroup = DPTS
spoolss: architecture = Windows x64
rpc_daemon:spoolssd = fork
rpc_server:spoolss = external
idmap config dpts : range = 100000-199999
idmap config dpts : backend = rid
idmap config * : range = 70000-99999
idmap config * : backend = tdb
map acl inherit = Yes
vfs objects = acl_xattr
[printers]
browseable = No
path = /var/spool/samba/
printable = Yes
[print$]
path = /usr/local/share/printer_drivers/
read only = No
On Wed, 2021-05-12 at 15:46 -0700, Luke Barone via samba wrote:> Is there a way to log who is printing how many pages to what printer > on a > Samba Print Server?The number of pages bit is hard, because Samba typically uses the proprietary driver for the printer, not a generic postscript one (some very early configurations used that, but this was far from the norm), so counting pages is hard. CUPS just sees it as a RAW job. Looking online some have done this by querying the printer for page stats after each job. Otherwise, I suggest this ends up in the big 'print release system' space, as used at universities etc. Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions
Mandi! Luke Barone via samba In chel di` si favelave...> Is there a way to log who is printing how many pages to what printer on a > Samba Print Server?It is not really true that samba (really: CUPS) is not able to 'count' pages: there are tools/filters that can rather effectively count pages for most of the printer languages... The real topic here is... that pages have to be counted at printer, not at spooler level: eg, i can send a 200 page print to a printer (and CUPS count it), but paper was empty, i've changed my idea and i delete it on the printer. Effectively i've not printed nothing. To count pages at printer level you have to use some sort of complex 'toolkit'; the only free one i know is PyKota: http://www.pykota.com/ that seems a bit dead. To count pages at spooler level, you can use some filter (based on pkpgcounter, a pykota component) and a web interface, see: http://jasmine.berlios.de/ (DEAD) https://github.com/GabrielRocha/Jasmine-Cups (i use that). -- dott. Marco Gaiarin GNUPG Key ID: 240A3D66 Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/ Polo FVG - Via della Bont?, 7 - 33078 - San Vito al Tagliamento (PN) marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797 Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA! http://www.lanostrafamiglia.it/index.php/it/sostienici/5x1000 (cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)