Discussion:
snmpget directly from Python
harsszegi
2012-03-06 12:05:57 UTC
Permalink
harsszegi [http://community.zenoss.org/people/harsszegi] created the discussion

"snmpget directly from Python"

To view the discussion, visit: http://community.zenoss.org/message/64965#64965

--------------------------------------------------------------
Hi,

I wish to display device specific values on a skin in my ZenPack as up-to-date as it can be.
My approach would be to issue the "snmpget" directly on the given OID, thus not relying on the
modeler, event manager, etc. infrastructure (it is insane to remodel the complete device
periodically, event manager is also doing per class shell script exection, which is not good for me).
So. How can I "snmpget" from Python to get an OID from my device? Also is there an example
to do this? I.e. snmpget from the device's IP, with proper snmp version/communicate set-up, etc.
so that I only have to set the OID, nothing else.
Thanks,
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64965#64965]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
harsszegi
2012-03-06 13:11:57 UTC
Permalink
harsszegi [http://community.zenoss.org/people/harsszegi] created the discussion

"Re: snmpget directly from Python"

To view the discussion, visit: http://community.zenoss.org/message/64966#64966

--------------------------------------------------------------
Ok, did a work around, to use Event transformation after-all.

Added this to the transform of the event:

log.info('applyTransform-device:%s evt.device:%s' % (device, evt.device))
o = dev.hw.printers.objectValuesAll()
log.info ("new printer status is %d" % evt.printerStatus)
o[0].status = evt.printerStatus
log.info ("updated printer status")

This works fine, however (obviously) changes are not commited back to the device.
How can I connect this with zendmd (i.e. 'dmd' variable in the transform)?
Thanks,
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64966#64966]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...