ycahome / SNMPreader

With this plugin you can bring one SNMP OID each time on your Domoticz server.
GNU General Public License v3.0
4 stars 2 forks source link

Docker - Domoticz #5

Open nodecentral opened 3 years ago

nodecentral commented 3 years ago

Hi

I really like the potential of this plugin, thanks so much for posting it on GitHub.

I couldn’t work out how to install the pysnmp version you mentioned as it returned errors , perhaps due to the base linux version used on the Docker instance.? - https://hub.docker.com/r/domoticz/domoticz

sudo apt-get install python3-pysnmp4

But as a comment in the plugin.py said Ficed to work with python 3 I was able to get the following installed.

pip3 install pysnmp

running it I get the following error - which I assume is related to the version - but I just want to check?


2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 111 in '/usr/local/lib/python3.7/dist-packages/pysnmp/hlapi/asyncore/sync/cmdgen.py', function getCmd
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 130 in '/usr/local/lib/python3.7/dist-packages/pysnmp/hlapi/asyncore/cmdgen.py', function getCmd
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 39 in '/usr/local/lib/python3.7/dist-packages/pysnmp/hlapi/varbinds.py', function makeVarBinds
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 853 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/rfc1902.py', function resolveWithMib
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 421 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/rfc1902.py', function resolveWithMib
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 206 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function getNodeNameByOid
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 188 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 191 in '/usr/local/lib/python3.7/dist-packages/pysnmp/smi/view.py', function __getOidLabel
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 1182 in '/usr/local/lib/python3.7/dist-packages/pyasn1/type/univ.py', function __add__
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 376 in '/usr/local/lib/python3.7/dist-packages/pyasn1/type/base.py', function clone
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 267 in '/usr/local/lib/python3.7/dist-packages/pyasn1/type/base.py', function __init__
2021-05-09 09:16:24.278 Error: UPS Name Check: (UPS Name Check) ----> Line 1250 in '/usr/local/lib/python3.7/dist-packages/pyasn1/type/univ.py', function prettyIn
2021-05-09 09:16:34.386 Error: UPS Name Check: (UPS Name Check) 'onHeartbeat' failed 'PyAsn1Error'.
2021-05-09 09:16:34.386 Error: UPS Name Check: (UPS Name Check) ----> Line 89 in '/opt/domoticz/userdata/plugins/SNMPreader/plugin.py', function onHeartbeat
2021-05-09 09:16:34.386 Error: UPS Name Check: (UPS Name Check) ----> Line 155 in '/opt/domoticz/userdata/plugins/SNMPreader/plugin.py', function getSNMPvalue
2021-05-09 09:16:34.386 Error: UPS Name Check: (UPS Name Check) ----> Line 183 in '/usr/local/lib/python3.7/dist-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py', function getCmd
nodecentral commented 3 years ago

Looking in the plugin.py

Towards the top it says

import sys
sys.path.append('/usr/lib/python3/dist-packages/')
from pysnmp.entity.rfc3413.oneliner import cmdgen

Yet the errors refer to

/usr/local/lib/python3.7/dist-packages

is that a potential issue ?

nodecentral commented 3 years ago

Not sure is this is relevant/related either.