[Grok-dev] grok 1.4 I can't import netsnmp

3sso takz1977 at gmail.com
Tue Jun 28 04:44:19 EDT 2011


I'm install package from apt-set install and I can see package dir at
/dist-packages 
I can import in interpreter mode but can't in grok

I try modify buildout.cfg and setup.py now still not work

ps. I try reinstall it by easy-install have problem about package name not
same too. so now I don't sure install it from what package. maybe

python-pynetsnmp 
python-pysnmp-common
python-pysnmp2
python-twisted-snmp
libsnmp-python

all package name search from apt-cache search snmp command but can't use in
easy-install command


Christian Klinger wrote:
> 
> Hi,
> 
> i guess netsmnp is not available via pypi. I think you have to install
> this package in your environment. The installation process is decribed 
> here. If it's the right package?
> 
> https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/trunk/net-snmp/python/README
> 
> HTH Christian
> 
> 
>>
>> Owen Shepherd say I can add 'netsnmp' to setup.py
>>
>> I did it but still error
>>
>> now I dont sure what real package name for it (maybe pysnmp)
>>
>> at interpreter mode on ubuntu (run script on shell) it work with
>>
>> import snmp<<
>>
>> sample code
>>
>> result = netsnmp.snmpget(oid + str(int(v)+i), Version=2,
>> DestHost="10.255.105.10", Community="public")
>>
>> ----------------------
>>
>> the error is
>>
>> 2011-06-27 05:53:57,011 WARNING [root] Developer mode is enabled: this is
>> a
>> security risk and should NOT be enabled on production servers. Developer
>> mode can usually be turned off by setting the `devmode` option to `off`
>> or
>> by removing it from the instance configuration file completely.
>> 2011-06-27 05:53:57,587 WARNING [ZODB.blob] (9327) Blob dir
>> /home/takz/zte/var/blobstorage/ has insecure mode setting
>> Starting server in PID 9327.
>> serving on http://192.168.20.113:8080
>> 192.168.20.48 - - [27/Jun/2011:05:54:15 +0700] "GET / HTTP/1.1" 401 46
>> "-"
>> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like
>> Gecko)
>> Chrome/14.0.797.0 Safari/535.1"
>> 192.168.20.48 - - [27/Jun/2011:05:54:21 +0700] "GET / HTTP/1.1" 303 0 "-"
>> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like
>> Gecko)
>> Chrome/14.0.797.0 Safari/535.1"
>> 192.168.20.48 - - [27/Jun/2011:05:54:21 +0700] "GET
>> /%2B%2Bgrokui%2B%2B/%40%40applications HTTP/1.1" 200 2445 "-"
>> "Mozilla/5.0
>> (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko)
>> Chrome/14.0.797.0 Safari/535.1"
>> 2011-06-27 05:54:23,854 ERROR [SiteError]
>> http://192.168.20.113:8080/zte/@@index
>> Traceback (most recent call last):
>>    File
>> "/home/takz/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py",
>> line 132, in publish
>>      result = publication.callObject(request, obj)
>>    File
>> "/home/takz/.buildout/eggs/grokcore.view-2.5-py2.7.egg/grokcore/view/publication.py",
>> line 56, in callObject
>>      return super(ZopePublicationSansProxy, self).callObject(request, ob)
>>    File
>> "/home/takz/.buildout/eggs/zope.app.publication-3.13.1-py2.7.egg/zope/app/publication/zopepublication.py",
>> line 207, in callObject
>>      return mapply(ob, request.getPositionalArguments(), request)
>>    File
>> "/home/takz/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py",
>> line 107, in mapply
>>      return debug_call(obj, args)
>>    File
>> "/home/takz/.buildout/eggs/zope.publisher-3.12.6-py2.7.egg/zope/publisher/publish.py",
>> line 113, in debug_call
>>      return obj(*args)
>>    File
>> "/home/takz/.buildout/eggs/grokcore.view-2.5-py2.7.egg/grokcore/view/components.py",
>> line 139, in __call__
>>      return self._render_template()
>>    File
>> "/home/takz/.buildout/eggs/grokcore.view-2.5-py2.7.egg/grokcore/view/components.py",
>> line 143, in _render_template
>>      return self.template.render(self)
>>    File
>> "/home/takz/.buildout/eggs/grokcore.view-2.5-py2.7.egg/grokcore/view/components.py",
>> line 316, in render
>>      return template.pt_render(namespace)
>>    File
>> "/home/takz/.buildout/eggs/zope.pagetemplate-3.5.2-py2.7.egg/zope/pagetemplate/pagetemplate.py",
>> line 113, in pt_render
>>      strictinsert=0, sourceAnnotations=sourceAnnotations)()
>>    File
>> "/home/takz/.buildout/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py",
>> line 271, in __call__
>>      self.interpret(self.program)
>>    File
>> "/home/takz/.buildout/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py",
>> line 343, in interpret
>>      handlers[opcode](self, args)
>>    File
>> "/home/takz/.buildout/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py",
>> line 819, in do_loop_tal
>>      iterator = self.engine.setRepeat(name, expr)
>>    File
>> "/home/takz/.buildout/eggs/zope.tales-3.5.1-py2.7.egg/zope/tales/tales.py",
>> line 682, in setRepeat
>>      expr = self.evaluate(expr)
>>    File
>> "/home/takz/.buildout/eggs/zope.tales-3.5.1-py2.7.egg/zope/tales/tales.py",
>> line 696, in evaluate
>>      return expression(self)
>>    File
>> "/home/takz/.buildout/eggs/zope.tales-3.5.1-py2.7.egg/zope/tales/pythonexpr.py",
>> line 59, in __call__
>>      return eval(self._code, vars)
>>    File "<string>", line 1, in<module>
>>    File "/home/takz/zte/src/zte/app.py", line 14, in showstatall
>>      result = netsnmp.snmpget(oid + str(int(v)+i), Version=2,
>> DestHost="10.255.105.10", Community="public")
>> NameError: global name 'netsnmp' is not defined
>>
>>
>>
>>
>>
>>
>> Christian Klinger wrote:
>>>
>>> Hi,
>>>
>>> can you paste the traceback of the error you recive during startup?
>>>
>>> Christian
>>>>
>>>> I need to build web-app for check my network device by snmp (oid)
>>>>
>>>> I try my script on shell command it ok (it need import netsnmp)
>>>>
>>>> but on Grok got error if import netsnmp in app.py
>>>>
>>>> (in my case cant start paster serve it show error about netsnmp module)
>>>>
>>>>
>>>> please help
>>>>
>>>> regard
>>>
>>>
>>> _______________________________________________
>>> Grok-dev mailing list
>>> Grok-dev at zope.org
>>> https://mail.zope.org/mailman/listinfo/grok-dev
>>>
>>>
>>
> 
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
> 
> 

-- 
View this message in context: http://old.nabble.com/grok-1.4-I-can%27t-import-netsnmp-tp31927974p31944435.html
Sent from the Grok mailing list archive at Nabble.com.



More information about the Grok-dev mailing list