You are not logged in.
I'm trying to adapt a debian-based nagios-script to arch. I'm having difficulties when the modules should be imported, basically because me being clueless.
The following is from the original script (http://oss.range-id.it/download/check_u … ps_socomec)
import sys, threading, StringIO
from optparse import OptionParser
from pysnmp import asn1, v1, v2c
from pysnmp import role
import pysnmp
The problem is that pysnmp related modules do not get imported. I think I can load asn1 with
import pyasn1.py
But importing v1 and v2c does not work the same way, even there is v1.py in python-pysnmp.
The question is how the import should be done?
Last edited by hwa (2014-03-14 06:50:48)
Offline
Solved it myself.
For other newbies:
There are amongst other things packages included with modulkes, biut those are not automatically loaded with the module itself. You should load packages in dotted format. In my case the correct syntax is
from pysnmp.proto.api import v1,v2c
The clue to me was thinking what might the path mean here, as clearly the module itself was higher in the tree.
/usr/lib/python2.7/site-packages/pysnmp/proto/api/v1.py
Offline