Monday, 30 April 2012

ESXi - Configuring SNMP

Background

We had to configure our ESXi Hosts so they were being reported on in SCOM. This blog covers the steps I did to get there.......

Step 1: Configure SNMP on our ESXi hosts.
Step 2: Configure the ESXi hosts to point t the Syslog server.

Tools: VMware vSphere CLI & VI Client

Step 1

1. Check the current SNMP configuration
 C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --show
 (you will be prompted for the username and password)

Current SNMP agent settings:
Enabled  : 1
UDP port : 161
Communities :
Notification targets :
10.10.10.10@162/public

2. Configure SNMP
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl -server <hostname or IP> -c <community string> -t <target server>@162/<community string>
 (you will be prompted for the username and password)

Changing community list to: <community string>...
Complete.
Changing notification(trap) targets list to: <target server>@162/<community string>...
Complete.

3. Recheck SNMP configuration
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --show
(you will be prompted for the username and password)

Current SNMP agent settings:
Enabled  : 1
UDP port : 161
Communities :
<community string>
Notification targets :
<target server>@162/<community string>

4. Enable SNMP agent
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --enable
(you will be prompted for the username and password)

Enabling agent...
Complete.

5. Test SNMP
C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-snmp.pl --server <hostname or IP> --T
(you will be prompted for the username and password)

Sending test nofication(trap) to all configured targets...
Complete. Check with each target to see if trap was received.

NOTE: While configuring one of the hosts I kept getting error messages. I deleted the snmp.xl file (/etc/vmware) and restarted the services (services.sh) and a new snmp.xml file appeared - I then repeated tasks 1-5 with no problem.
The host wasn't running any VMs when I restarted the services - if I can, I only do host work when it is clear of VMs just in case......

Step 2


1. Open up a VI Client session (either to the Virtual Center or direct to the Host) - I'm connecting to the Host via the Virtual Center.

2. Go to Home > Inventory > Hosts and Clusters

3. Click on the Host you want then go to the Configuration tab - Software > Advanced Settings > Syslog > Remote.

4. Type in the Hosts name into the Syslog.Remote.Hostname box of the Syslog server.

Get the SCOM Admin to check for incoming data.....

No comments:

Post a Comment