vmware-archive / vmware-vcenter

VMware vCenter Module
Other
87 stars 102 forks source link

Implement SNMP settings #176

Open ggeldenhuis opened 8 years ago

ggeldenhuis commented 8 years ago

It would be useful to extend the module to allow for the setting of SNMP community strings and other SNMP related settings as allowed by the API.

ggeldenhuis commented 8 years ago

brain/chat dump: For 6.0, they added some kind of thumbprint security that you have to enable prior to CLI connecting smoothly. Based on my (super-cursory) attempt to get it to work, the docs on how to do that don't seem accurate so YMMV there. Additionally they added a line to the snmpd script that disables snmp if you run it from the command line. which is why the reload is bracketed by enables. I was in a hurry so I just did it via SSH. Here's my very hurried recipe. The only thing you have to change is the community string: For Each ESXi host (from the GUI): CONFIGURATION - SERVICES START SSH SERVICE Using Putty or whatever - LOGIN SSH AS ROOT STOP SSH SERVICE From the SSH command line: esxcli system snmp set --communities COMMUNITYNAME esxcli system snmp set --enable true esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true esxcli network firewall ruleset set --ruleset-id snmp --enabled=true /etc/init.d/snmpd restart sleep 5 esxcli system snmp set --enabled true esxcli system snmp get SNMPD - START SERVICE

ggeldenhuis commented 8 years ago

API calls for SNMP from https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/index.html

crayfishx commented 8 years ago

I've been looking at this, currently I have problems getting the confguration property for HostSnmpSystem out of the API - I've raised it as an issue on rbvmomi, but maybe somewhere here has some input....

https://github.com/rlane/rbvmomi/issues/39

ggeldenhuis commented 8 years ago

(Note to self) The vmware/rbvmomi repo has recently got v6 support so retesting with that library might deliver better results.

ggeldenhuis commented 8 years ago

Since we are using the rbvmomi library from vmware the relevant ticket is https://github.com/vmware/rbvmomi/issues/89