I’m quite new to checkmk and this forum, so please apologize if I address my question not in the appropriate way.
In the forums archive I found a topic about using SNMPv3 with HP Printers
==> [Check_mk (english)] SNMP v3 with HP printer - #5 by michael-nydegger.ch
I was not able to reply to this post, so created a new one…
I tested this with 1.16.0p16 and it still seams to be an issue
So situation is:
I created a check with SNMPv3 (authPriv) and the snmp-context “Jetdirect” set as parameter
Results:
in WATO I can test the access successfully
with CLI and snmp I could also get access
but no access with WATO => Services => “full scan” possible
I’ve been using SNMP v2 for our HP printers since the bottom line of the other topic. It sound like the same problem as I had then:
I’ve reported the bug at 09.11.2016, 08:03 to the address feedback@check-mk.org. I didn’t track, if the bug was resolved.
Sorry, for not having a solution. Maybe you can switch to snmp v2 as a workaround. If you have the paid “Checkmk Enterprise Standard” edition you can ask the support.
Thanks for your reply.
Yes, I’m also using SNMPv2 and it works.
But it makes no sense, to not fix this bug.
“Save&Test” in WATO works with SNMPv3, why not make the check able to use the proper snmp-context?
I got all my devices to work with SNMPv3, would be great to have also the HP Printers work with SNMPv3.
I will give it a try and send a mail to the address you mentioned above.
Let’s see
Only problem, it will not do discovery for this OIDs .1.3.6.1.2.1.1.1.0 and .1.3.6.1.2.1.1.2.0 with context.
I added rule for “Hosts without system description OID”
and its started working.
many thanks. This helped, but still no final success.
The Situation is somehow wired and still pretty much the same as Michael described in his initial post.
Setup:
I just installed a brand new system with checkmk 1.6.0p17, doing only the HP Printer checks.
Also I added two rules:
A) “SNMPv3 contexts to use in requests”
B) “Hosts without system description OID”
C) setup SNMPv3 credentials
Situation:
a “full scan” in WATO ends with [Errno 111] Connection refused, but if I do “automatic refresh” the services show up eventually
a Test in WATO => “Save & Test” is 100% predictable successful, everything “green”
all services show up in “Main Overview” but stuck in “stalled” forever. 2 problems pop up, both with [Errno 111]
So basically it’s still the same result a described by Michael.
Any hint, how to get SNMPv3 with HP Printers up and running?
I had a look at the code and found the following strange comments
The referenced file is ~/lib/python/cmk_base/snmp.py - version inspected was 1.6.0p16 - it should be not relevant if it is Enterprise or Raw
Starting Line 267
# Contextes can only be used when check_plugin_name is given.
...
# get_single_oid() can only return a single value. When SNMPv3 is used with multiple
# SNMP contexts, all contextes will be queried until the first answer is received.
if check_plugin_name is not None and snmp_utils.is_snmpv3_host(snmp_config):
snmp_contexts = _snmpv3_contexts_of(snmp_config, check_plugin_name)
else:
snmp_contexts = [None]
console.vverbose(" Getting OID %s: " % oid)
for context_name in snmp_contexts:
try:
snmp_backend = SNMPBackendFactory().factory(snmp_config,
enforce_stored_walks=_enforce_stored_walks)
value = snmp_backend.get(snmp_config, oid, context_name)
if value is not None:
break # Use first received answer in case of multiple contextes
except:
if cmk.utils.debug.enabled():
raise
value = None
The first comment is what i find strange - why?
I have here no devices to test but on thing i would test if possible is the following.
change the following line
if check_plugin_name is not None and snmp_utils.is_snmpv3_host(snmp_config):
to
if snmp_utils.is_snmpv3_host(snmp_config):
After this change it is important to test if not only the scan is working but also the checking.
I would do this first on the command line after the change with.
cmk --debug -vvI device
and
cmk --debug -vvn device
After i read a little bit inside the source a found no reason why you cannot use the context for scan.
Hi Andreas,
Many thanks indeed!
I changed the code-line and did the checks via cli.
BTW: I found one config error in my setup which has lead to the [Errno 111]
I can confirm, that the check makes use of the snmp context! That’s great
But of course I got still error in the debug output
My take is, that everything good until the snmpbulkwalk hits the last OID .1.3.6.1.2.1.43.8.2.1.13.
But why in snmpbulkwlak not just ignoring the missing OID response?
Any way the exclude this OID or any other way to get this error solved?
If the normal walk don’t work you can only disable the “printer_input” check for this device.
Look for the rule “Disabled checks”.
Good news for the v3 context problem. Inside the code for version 1.7 this looks like already removed and there should be no problem anymore with the original problem
since some time the check via snmpv3 runs absolutely reliable on the various HP printers (HP PageWide Pro Series).
So I want to share the result and details here, maybe someone else can use it.
the update from Checkmk 1.6.0p17 to Checkmk 1.6.0p18 has shown that the small patch (~/lib/python/cmk_base/snmp.py) from Andreas is absolutely necessary:
change the following line
if check_plugin_name is not None and snmp_utils.is_snmpv3_host(snmp_config):
to
if snmp_utils.is_snmpv3_host(snmp_config):
it was necessary to create some additional rules in “Host & Service Parameters”, otherwise the tests run with OK but not the checks themselves.The following rules are necessary:
A) Timing settings for SNMP access
(Response timeout for a single query = 2sec / Number of retries = 10)
B) Check intervals for SNMP checks
(All SNMP checks: Do check every = 10min)
C) SNMPv3 contexts to use in requests
(All SNMP Checks: SNMP Context IDs = Jetdirect)
The set timing values work reliably and I did not try to optimize them further, because in this constellation they are absolutely sufficient.
The HP printers return 15 values each via Checkmk. Among them just as relevant values as toner level.
The SNMPv3 values for Auth Priv have to be set correctly in Checkmk according to the settings of the HP printers. This seems to be different between the different old HP Printer model series. But it can be seen very well in the settings of the HP printers and be taken over in Checkmk.