Monday 30 April 2012

vMA - Time Zone configuration

Problem

There is a little used vMA server in our environment which needed to be used - when I got on it I found that the timezone was set to PDT.....

Since the work I wanted to do was to do with Syslog and AD having the right time would be critical!

Solution

I found a useful article after a bit of Googling and reading of the vSphere Management Assistant Guide which helped me: http://xtravirt.com/using-vma-your-esxi-syslog-server the article was written by Simon Long and obviously he deserves all the credit and not me!!

If the article ever disappears I'll just go over the bits I used:

1. Adding of the sites NTP server(s).
sudo nano /etc/ntp.conf

(I added the entries under #use the public servers from the...... )

2. Remove the local time file
sudo rm /etc/localtime

3. Replace the local time file with the correct one for your timezone
sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime

4. Turn the NTP daemon on
sudo /sbin/chkconfig ntpd on

5. Restart the ntpd service to pick up the "new time"
sudo /sbin/service ntpd restart

6. Checking that your time server configuration has taken
sudo ntpq -p

7. Changing the keyboard from US to EN
sudo vi /etc/sysconfig/keyboard

Change the KEYTABLES entry from "us" to "en"

NOTE: I need to check whether UTC is good enough for our needs and if not I'll be amending the blog with what I actually used - Again, thanks to Simon for such a great article :-)

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.....