Hello:
I wonder if there is a way to configure snmp.xml file on ESXi host (/etc/vmware/snmp.xml) via script? I have root password and want to be able update/change this file remotely...
Thank you very much!
To use the Set-VMHostSnmp cmdlet you have to be connected to the ESXi host directly. The following example will connect to an ESXi host named ESX01 and sets SNMP to enabled and a read-only community example-community (Example 1 from the Set-VMHostSnmp help):
Connect-VIServer ESX01
$vmhostSNMP = Get-VMHostSNMP
Set-VMHostSNMP $vmhostSNMP -Enabled:$true -ReadOnlyCommunity 'example-community'
You can use the PowerCLI Set-VMHostSnmp cmdlet to configure the /etc/vmware/snmp.xml file in a script.
Thank you very much for your answer!
do you have any syntax examples? I read somewhere you should use different approach for different versions of ESXi...
Thanks a lot!
To use the Set-VMHostSnmp cmdlet you have to be connected to the ESXi host directly. The following example will connect to an ESXi host named ESX01 and sets SNMP to enabled and a read-only community example-community (Example 1 from the Set-VMHostSnmp help):
Connect-VIServer ESX01
$vmhostSNMP = Get-VMHostSNMP
Set-VMHostSNMP $vmhostSNMP -Enabled:$true -ReadOnlyCommunity 'example-community'
Thanks a lot!