Unable to read a given SNMP OID

I’m trying to read into openHAB for Raspberry Pi the number of printed pages of my printer using the SNMP binding with no success.

I’ve found the right OID by using snmpwalk, but when I replace into the item definition the same OID nothing happens. The strange thing is that if I try to read other OIDs, they are read correctly. TCPDUMP displays noSuchName when no data is read. I attach in the following more detailed informations.

Do you have some suggestions on how I can try to debug this issue?
Thank you
LionHe


Working example

  1. Command line
snmpwalk -v 1 -c public 192.168.27.7 1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "HP ETHERNET MULTI-ENVIRONMENT"
  1. OpenHAB item
Number HP5520_Prints "Printed Pages [%s]" {snmp="<[192.168.27.7:public:.1.3.6.1.2.1.1.1.0:10000]"}
  1. tcpdump output
    sudo tcpdump -v port 1234
    tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
        23:21:23.489154 IP (tos 0x0, ttl 64, id 34001, offset 0, flags [DF], proto UDP (17), length 71)
            raspberrypiWLAN.fritz.box.1234 > Stampante.fritz.box.snmp:  { SNMPv1 { GetRequest(28) R=966145838  system.sysDescr.0 } }
        23:21:23.497885 IP (tos 0x0, ttl 64, id 6219, offset 0, flags [none], proto UDP (17), length 100)
            Stampante.fritz.box.snmp > raspberrypiWLAN.fritz.box.1234:  { SNMPv1 { GetResponse(57) R=966145838  system.sysDescr.0="HP ETHERNET MULTI-ENVIRONMENT" } }

Non Working example (in OpenHAB not in the command line)

  1. Command line
snmpwalk -v 1 -c public 192.168.27.7 1.3.6.1.2.1.43.10.2.1.4 
iso.3.6.1.2.1.43.10.2.1.4.0.1 = Counter32: 2582
  1. OpenHAB item
Number HP5520_Prints "Printed Pages [%s]"   {snmp="<[192.168.27.7:public:.1.3.6.1.2.1.43.10.2.1.4:10000]"}
  1. tcpdump
    sudo tcpdump -v port 1234
    tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
    23:24:53.622299 IP (tos 0x0, ttl 64, id 45386, offset 0, flags [DF], proto UDP (17), length 75)
        raspberrypiWLAN.fritz.box.1234 > Stampante.fritz.box.snmp:  { SNMPv1 { GetRequest(32) R=966145879  43.10.2.1.4.0.1 } } 
    23:24:53.629965 IP (tos 0x0, ttl 64, id 6239, offset 0, flags [none], proto UDP (17), length 75)
        Stampante.fritz.box.snmp > raspberrypiWLAN.fritz.box.1234:  { SNMPv1 { GetResponse(32) R=966145879  noSuchName@1 43.10.2.1.4.0.1= } }

In my SNMP reads i use “” like:
{snmp="<[192.168.27.7:public:.1.3.6.1.2.1.1.1.0:10000]"}

Thank you for replying.
The item is written with quotes as you suggest, I corrected the syntax in the post.

In order to debug further I think I should delve into the binding source, but that’s beyond my capabilities.
I think I will use the EXEC binding either for calling the SNMPWALK output, or, probably better, calling a simple python script with the HTML grabber extension (http://docs.python-guide.org/en/latest/scenarios/scrape/).

I ended up using the exec binding

Number HP5520_Prints "Printed Pages [%.1f]" {exec="<[snmpwalk -v 1 -c public 192.168.27.7 .1.3.6.1.2.1.43.10.2.1.4.0:60000:JS(ExtractPrint.js)]"} //OK

Using a simple javascript code to parse the line output.