HP printer sharing: no info in snmpwalk

I have two HP printers installed and configured via cups+hplip, local printing works.

Network sharing of these printers fails. After reading the following guide: http://hplipopensource.com/node/216, I have tried

snmpwalk -Os -c public -v 1 127.0.0.1 1.3.6.1.4.1.11.2.3.9.1.1.7.0

It tells I should have seen something like


enterprises.11.2.3.9.1.1.7.0 = STRING:
"MFG:Hewlett-Packard;CMD:PJL,MLC,BIDI-ECP,PCL,POSTSCRIPT,PCLXL;MDL:hp
LaserJet 3380;CLS:PRINTER;DES:Hewlett-Packard LaserJet
3380;MEM:23MB;COMMENT:RES=1200x1;"

but in my case the output is empty.
Meanwhile, SNMP is running and works somehow: the same command without OID

snmpwalk -Os -c public -v 1 127.0.0.1

gives tons of stuff like


hrSWRunPerfCPU.1746 = INTEGER: 0
hrSWRunPerfCPU.1761 = INTEGER: 1
hrSWRunPerfCPU.2623 = INTEGER: 3
hrSWRunPerfCPU.2628 = INTEGER: 18
hrSWRunPerfCPU.2697 = INTEGER: 203
hrSWRunPerfCPU.2698 = INTEGER: 2

I have tried much searching on the net about SNMP, found a lot of developer information about protocol architecture and such, but almost nothing about configuring and troubleshooting. Probably my admin skills are not enough to get past this problem myself.

So, the question is: how could I make HP printers appear in snmpwalk output? Maybe someone more experienced in this subject could give some advice?

The file /etc/snmp/snmpd.conf has the following config parameters:


mibs  ALL
rocommunity public 127.0.0.1
rocommunity public <our.local.subnet>
dontLogTCPWrappersConnects yes

The file /etc/cups/snmp.conf:


Address @LOCAL
Community public

The installed packages:


<name>:/ # rpm -qa | grep snmp
libsnmp30-5.7.3-3.1.x86_64
snmp-mibs-5.7.3-3.1.x86_64
net-snmp-5.7.3-3.1.x86_64
<name>:/ # rpm -qa | grep cups
python-cupshelpers-1.4.5-2.5.1.noarch
cups-filters-foomatic-rip-1.0.58-2.11.1.x86_64
cups-1.5.4-21.9.1.x86_64
cups-pk-helper-0.2.5-4.1.4.x86_64
cups-filters-ghostscript-1.0.58-2.11.1.x86_64
cups-devel-1.5.4-21.9.1.x86_64
cups-libs-1.5.4-21.9.1.x86_64
cups-client-1.5.4-21.9.1.x86_64
python-cups-1.9.66-2.1.3.x86_64
cups-libs-32bit-1.5.4-21.9.1.x86_64
<name>:/ # rpm -qa | grep hplip
hplip-sane-3.14.6-2.2.4.x86_64
hplip-3.14.6-2.2.4.x86_64
hplip-hpijs-3.14.6-2.2.4.x86_64

On Thu 14 Apr 2016 12:26:01 PM CDT, xppblbl wrote:

I have two HP printers installed and configured via cups+hplip, local
printing works.

<snip>

snmpwalk -Os -c public -v 1 127.0.0.1

Hi
Use the actual OID name, but if you use the less command it’s at the
very beginning of the output…


snmpwalk -Os -v 1 -c public localhost|less
snmpget -Os -v 1 -c localhost sysDescr.0

Anyway, I’m assuming both printers are connected to localhost and work,
therefore you need to open the firewall ports for other systems on the
network to see the devices…

Fire up YaST -> Security and Users -> Firewall, then under Allowed
Services in the ‘Service to Allow’ dropdown select cups, else open port
631 via advanced options. Or turn it off temporarily to see if it is the
firewall…


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 SP1|GNOME 3.10.4|3.12.53-60.30-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Thanks for reply.

Sorry, I did not get the point concerning «actual OID name».
The output of snmpget is the following:


<user>@<machine>:~> snmpget -Os -v 1 -c public localhost sysDescr.0
sysDescr.0 = STRING: Linux <machine> 3.16.7-35-desktop #1 SMP PREEMPT Sun Feb 7 17:32:21 UTC 2016 (832c776) x86_64

How is it related to printers? Maybe I should check something more?

The firewall stuff is more or less obvious.

Hi
What about from a machine your trying to connect from to (again I’m assuming) the printer ip address…

Probably to clarify, these printers are connected via usb to a machine running cups, or are they real network printers with an ip address?

The architecture is following:
There is a machine running CUPS (let’s name it <server>) running CUPS and SNMP and having 2 USB printers (HP LaserJet 1022 and HP Photosmart C3100) connected to it and configured via hplip (I have found no open drivers at least for 1022 so I had to use hplip). Both CUPS and SNMP daemons are running, local printing works without any problems. Ports 631 (CUPS), 161 and 162 (SNMP), 9100 (hp-pdl-datastr) in the firewall are open, local subnet is listed as allowed in cupsd.conf and snmpd.conf and both services respond to remote connections in some way (checked using telnet localhost <port> from <server> and telnet <server> <port> from possible clients).

The problem is that nothing similar to the listed printers appears in snmpwalk output when trying to run it either from localhost or from other machines in the subnet. I suppose it is the reason why printers are not visible to remote clients, but have no idea how to make SNMP service provide information about them.

On Thu 14 Apr 2016 10:56:01 PM CDT, xppblbl wrote:

The architecture is following:
There is a machine running CUPS (let’s name it <server>) running CUPS
and SNMP and having 2 USB printers (HP LaserJet 1022 and HP Photosmart
C3100) connected to it and configured via hplip (I have found no open
drivers at least for 1022 so I had to use hplip). Both CUPS and SNMP
daemons are running, local printing works without any problems. Ports
631 (CUPS), 161 and 162 (SNMP), 9100 (hp-pdl-datastr) in the firewall
are open, local subnet is listed as allowed in cupsd.conf and snmpd.conf
and both services respond to remote connections in some way (checked
using telnet localhost <port> from <server> and telnet <server>
<port>
from possible clients).

The problem is that nothing similar to the listed printers appears in
snmpwalk output when trying to run it either from localhost or from
other machines in the subnet. I suppose it is the reason why printers
are not visible to remote clients, but have no idea how to make SNMP
service provide information about them.

Hi
So do these printers on the <server> have web pages, I have my doubts
about getting snmp via USB…

On a host that’s wanting to connect to the printer, all you need to do
is run hp-setup as root user and use the info gleaned from the
<server>:631 to add the usb/ipp connection.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 SP1|GNOME 3.10.4|3.12.53-60.30-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I concur with Malcolm’s assessment. You won’t get SNMP information from a USB-connected printer. The CUPS client needs to be configured to work with the remote CUPS server hosting the local printers ie as a CUPS printer.

Thank you very much, I understood my mistake. I have read the wrong troubleshooting guide http://hplipopensource.com/node/216 — looks like it is intended for printers connected directly to Ethernet.

After I realized this, I continued research.

Before I was used to the way sharing printers via ipp. Now I tried to set the printers as network printers and succeeded.

I still failed to make printers work as local printer with address like ipp://<server>:631/printers/<name_of_printer>, CUPS doesn’t print a page giving: cups Error: This module is designed to work with HP Printers only. But as the printers now work, I will probably postpone this issue for later.

Thanks again for explanations.

Just a late comment…
The reference used the snmpwalk tool…

I don’t know if snmp can be used at all in any case unless <all> machines have snmp running, and from what was posted I saw only the one machine running snmp.

It should also be noted that all HP Enterprise software I’ve seen and used implement snmp extensively, and assume it’s always on and configured on all machines, so you have to be watchful for that when reading HP Enterprise support and documentation.

As for whether USB is relevant or not…
If the machine is properly configured as a Print Server (since the Printer is direct attached), shouldn’t CUPS or any other tool work?
Shouldn’t snmp find this Print Server?

TSU