HP JetDirect with syslogd and Linux

18. Oktober 2008 | Know-How | Kein Kommentar | geschrieben von Robert Scheck |

The following blog post was originally published on our old website and was moved to the weblog now:

The HP JetDirect network printer support the logging of events using a remote syslogd on a Unix/Linux server. This is very useful to stay informed about your network printers. This article describes how to use this feature. It is based on the setup of an HP Color LaserJet 4600 together with a SuSE Linux 9.2 server. But you can apply it easily to other Linux distributions.

The general setup fields for the printer configuration can be found in the HP JetDirect administrator’s guide. Please note that the four parameters described in table A.4 there can be found in different areas of the setup system. The syslog server ip address is part of the normal network setup which you can access via your printers display. The parameters syslog maximum messages and syslog priority are placed in the network configuration which can be reached using the HTTP setup interface. The last parameter syslog facility is is also part of the HTTP setup interface but placed under other settings. I only had to configure the IP of the syslogd server and increased the number of syslog maximum messages from 10 to 100 per minute.

On your logging server make sure that syslogd accepts connection from other hosts. For syslogd 1.4.1 this is done using the command line parameter -r. For SuSE Linux 9.2 place this parameter in /etc/sysconfig/syslog as SYSLOGD_PARAMS.

Now you have to configure the place where “lpr” messages (the default syslog facility for HP JetDirect) are stored. To do this, edit the file /etc/syslog.conf and check for lines starting with “lpr.”. If it is missing, just add a line like:


lpr.* -/var/log/hpclj4650n

This will write all printer messages to the given file.

But you will see that the messages are logged to /var/log/messages too. To suppress double logging, just search the line for /var/log/messages and add the “lpr.none” there so that your line looks similar to this one:


l*.*;mail.none;news.none;lpr.none -/var/log/messages

After changing the configuration restart your syslogd and you can read the messages from your new logging file. To test this, with the setup above (100 messages per minute) it is enough to remove and put back the paper tray which will produce an output like:


May 23 12:30:20 192.168.0.6 printer: error cleared
May 23 15:03:37 192.168.0.6 printer: offline or intervention needed

Ihre Meinung ist gefragt