Snmp binding - Item never filled with data

Hello,
I have one problem to SNMP binding with OH2.

Question for the /etc/snmp/snmptrapd.conf (and /etc/openhab2/services/snmp.cfg) entries: Is this only necessary for TRAP operations?
Question for the “GET” operation: Parameter is not documented. Can this parameter be interpreted like “update this item every milliseconds” or how is the GET operation scheduled?

My Item seems never to be used. This means I don’t find any log entries - even in debug mode:

String smp_mem_totl “%s” <it_server> (g_net_snmp_0001, g_typ_srvr) { “snmp=”<[127.0.0.1:public:.1.3.6.1.4.1.2021.4.5.0:10000] }

I also tried to use “Number smp_mem_totl “%d” …”

/etc/snmp/snmptrapd.conf:

disableAuthorization yes
forward default udp:127.0.0.1:5950

/etc/openhab2/services/snmp.cfg:
port=5950
community=public
timeout=1500
retries=0

logging:

2017-04-26 10:10:02.818 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Unable to find table for query ‘smp_mem_totl’.
2017-04-26 10:10:03.323 [DEBUG] [org.openhab.binding.snmp ] - BundleEvent STARTING - org.openhab.binding.snmp
2017-04-26 10:10:03.329 [DEBUG] [.binding.snmp.internal.SnmpActivator] - SNMP binding has been started.
2017-04-26 10:10:03.334 [DEBUG] [org.openhab.binding.snmp ] - BundleEvent STARTED - org.openhab.binding.snmp
2017-04-26 10:10:03.342 [DEBUG] [org.openhab.binding.snmp ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.snmp.SnmpBindingProvider}={component.name=org.openhab.binding.snmp.genericbindingprovider, component.id=166, service.id=301, service.bundleid=208, service.scope=bundle} - org.openhab.binding.snmp
2017-04-26 10:10:03.402 [DEBUG] [org.openhab.binding.snmp ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler}={event.topics=openhab/*, service.pid=org.openhab.snmp, component.name=org.openhab.binding.snmp, component.id=165, service.id=303, service.bundleid=208, service.scope=bundle} - org.openhab.binding.snmp
2017-04-26 10:10:03.462 [DEBUG] [ab.binding.snmp.internal.SnmpBinding] - SNMP binding activated
2017-04-26 10:10:03.629 [DEBUG] [ab.binding.snmp.internal.SnmpBinding] - SNMP binding is listening on 0.0.0.0/5950
2017-04-26 10:10:03.646 [INFO ] [b.core.service.AbstractActiveService] - SNMP Refresh Service has been started

So - what to check now?

Thanks in advance …

Have you done an SNMPWalk? That may shed some light on the matter for you. Also have you made sure that your strings match.

These commands are working well:
snmpget -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.9.1.9.1
snmpwalk -v1 -c public 127.0.0.1
snmpget -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.11.11.0
snmpget -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.4.5.0
snmpget -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.4.6.0

@kedvsk Where you able to get this to work? I also get ‘SNMP Refresh Service has been started’ on the log and snmpget -v 1 -c public also works, but the items never gets populated.

String AL_Status_NAS “NAS5 [%s]” (AL_Status) { snmp="<[10.0.1.252:public:.1.3.6.1.2.1.1.5.0:2000]" }

Post your items using Code Fences

check this for troubleshooting: [SOLVED] SNMPget does not work

Solved my issue by tracing org.openhab.binding.snmp. It turns out the binding was not using the port setup in snmp.cfg. I ended up addding the port to the Items file.

1 Like

don’t confuse the 2 settings:

the port set in services/snmp.cfg is the listening port for your OH2 system
the port set in the items file is the port that remote systems use