TECHZEN Zenoss User Community ARCHIVE  

Use API to poll device / change device config

Subject: Use API to poll device / change device config
Author: MIke McBain
Posted: 2017-06-26 17:33

I am writing a wrapper in golang for the Zenoss API. I have managed to get device info (uid, events, etc) successfully with my wrapper. Now I am looking to use this wrapper to help shepherd some conversions from SNMP v2 to v3 on devices. I have looked through the included HTML documentation and can not find the methods to do this. I was hoping someone here would have insight on how to call the Zenoss back-end API to:
1) Run an snmpwalk, or poll a specific attribute live, or otherwise use the API to determine if Zenoss can successfully connect to the device.
2) Use the API to tell Zenoss to switch from using SNMPv2 and a community string to using SNMP v3 and a specific user/auth/priv set.
3) Once #2 has been completed, re-run #1 to verify Zenoss can poll the device with the new SNMP v3 config.

I've come very far on my own, but have hit a roadblock. Any help would be appreciated.

------------------------------
MIke McBain
Network Security Infrastructure Architect
Rackspace
------------------------------


Subject: RE: Use API to poll device / change device config
Author: krishna reddy
Posted: 2017-06-26 22:32

Hi Mike,
  you can use developers tool in chrome or firefox to determine which call zenoss is making to server. Once you get snmp version from api by polling config properties on devices you can basically include snmpwalk commands in your wrapper(if else).

1) if snmpwalk is succesfull depending on above output (zenoss can connect to device) else snmpwalk is failing zenoss can't connect to device(above output)
2) if you want to change snmp configs in zenoss you should do api call to change device configs(please look api call in developer tools)
3) rerun your above snmpwalk commands to check status

Try this
    


------------------------------
krishna
verinon
------------------------------


Subject: RE: Use API to poll device / change device config
Author: krishna reddy
Posted: 2017-06-26 22:41

Mike,

forgot to say that snmpwalk may take very long time for each device depending on device. Better way on determining zenoss connectivity to devices is to see if device has any event saying snmp agent is disabled or device can't reach. you can get this from event details from api call you make to device.(parse for event details)

------------------------------
krishna reddy
verinon
------------------------------


< Previous
Circular ZenPack installation
  Next
Calculated Performance ZenPack - using attributes and methods of components
>