ESXi – How to configure and enable SNMP

Just a quick PowerShell script that sets up SNMP on ESXI hosts

 

#Script to enable and configure SNMP on ESXI host
Get-VMHost | Select Name
$host_name = Read-Host "Host name:"
$location="London HQ"
$esxcli = get-esxcli -vmhost $host_name
$esxcli.system.snmp.set($null,"public","true",$null,$null,$null,$null,$null,$null,$null,$null,$null,$location)
$esxcli.system.snmp.get()
Write-host "Now go to the host and start the service"

Once that is done you still need to go the ESXi host and enable/start the SNMP service.

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty − four =

This site uses Akismet to reduce spam. Learn how your comment data is processed.