SNMPreader - Is anyone using this successfully ?

Python and python framework

Moderator: leecollings

Post Reply
parkerc
Posts: 6
Joined: Sunday 24 April 2016 17:52
Target OS: -
Domoticz version:
Contact:

SNMPreader - Is anyone using this successfully ?

Post by parkerc »

Hi

I really like the look of this SNMPreader plugin (https://github.com/ycahome/SNMPreader), to capture the energy value (kWh) from my UPS, but I can’t seem to get it to work - it just shows a list of errors in the log and not being proficient in Python - I’m at a loss on what’s wrong - (FYI - I’m running the Docker instance of Domoticz).

I couldn’t work out how to install the pysnmp4 package mentioned as it was not found and returned errors.

Code: Select all

sudo apt-get install python3-pysnmp4
perhaps due to the base linux version used on the Docker instance.? - https://hub.docker.com/r/domoticz/domoticz - so as a comment in the plugin.py said “Ficed to work with python 3 “ I was able to get the following installed.

Code: Select all

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

Code: Select all

 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 
The only other observation is Looking in the plugin.py - Towards the top it says

Code: Select all

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

Code: Select all

/usr/local/lib/python3.7/dist-packages
is that a potential issue ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest