Hi People
I'm looking for a script to enable and update snmp configuration on close to 200 esxi 5.5/5.0/4.1/4.0 hosts altogether
I have the snmp server name, community string and port number to update.
As i am new to powercli appreciate your help in advance
Thnks
sree
Take a look at this one: PowerCLI Collection – Adding SNMP settings to ESXi hosts | Pascal's Wereld
Be aware that the SNMP setup changed between vSphere 4 and 5, so you will probably need a different script for vSphere 4.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Team,
I wanted to run the script to configure the SNMP settings the list of esxi hosts which are saved in the txt file.
I able to run it 6.5 but NOT 6.7 . can you help me if any changes need to change. Here is script:
********************
$esx_list = Get-Content -Path "C:\\servers.txt"
foreach ($item in $esx_list) {
Connect-VIServer -Server $item -User root -Password "i88888888888888888888888n"
Get-VMHostSnmp | Set-VMHostSnmp -Enabled:$true -TargetCommunity "******" -TargetHost "10.******" -AddTarget
Disconnect-VIServer -Server $item -Confirm:$false
}
Are you getting any errors?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes getting's some errors
Looks like the Disconnect-VIServer can't find the server.
Did the Connect-VIServer complete correctly?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes I have disconnected server correctly.
Even when I closed and tried its not working.
I am able to write the 6.7 host as well with above script. but Just I wanted to make change in the community string. but its not happening with script.
Desired resuts in the esxi hosts
[root@e****:~] esxcli system snmp get
Authentication:
Communities: nosaltandesgrp
Enable: true
Engineid: 00000063000000a100000000434354121
Hwsrc: indications
Largestorage: true
Loglevel: info
Notraps:
Port: 161
Privacy:
Remoteusers:
Syscontact:
Syslocation:
Targets:
Users:
V3targets:
You are showing that you get errors on the Disconnect-VIServer.
I just wanted to know if the Connect-VIServer works.
That part your screenshot doesn't show.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Please find the screenshot of connection VIServer.
Now able to run this script vis powercli 12.0 but unable update communiti only.
Ok, that confirms that your Connect-VIServer doesn't work.
That can have many reasons.
To list just a few: bad certificate, FW rules prohibit you to reach the VCSA, the FQDN of the VCSA can not be resolved...
You will first have to solve that issue.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference