Setup SNMP: VMware ESXi via vMA

Do you have an SNMP monitor you would like to tie together with your VMware infrastructure? Do you want to set this up quickly and efficiently?

If you answered ‘yes’ to both of those questions then continue reading this post!

There are 2 ways to do this – one is to loop through requesting the password from the user for each host (if each host has a different root password), or using the vifp and vifptarget commands (which come in handy for other scriptable items). using vifp/viptarget is another subject, possibly for a different blog post.

First – let me push out a shameless plug for LogicMonitor – the best tool I have found for doing monitoring and measurement of my hosts since 2011. I don’t work there and I get nothing for mentioning their name; I just feel that they are the best so far and deserve the kudos.

Second, create a text file with either host names or IP addresses, like so:

and we will use this as input to the for loop.

There you have it, simple, quick, efficient.

Updated: Setting trap receiver uses ‘-t’ (lowercase) instead of ‘-T’ (uppercase) from vMA 5.1 to ESXi v5.1. Hat tip to @vglen_mpls (Glen) for finding this so I could update this post!