System Admin
ESX ISCSI Re-Scan
by alowe on Sep.23, 2009, under System Admin
Sometimes ESX can lose the connection to disk storage over ISCSI. This can happen when rebooting either the storage device or the host, and potentially, at other times.
Run the following command to re-scan for ISCSI devices, and re-connect to them:
esxcfg-swiscsi -s
VMWare 3.5 ESX SNMP
by alowe on Jul.07, 2009, under System Admin
This will cover basic information on how to setup a SNMP service on VMWare’s ESX server and how to get values from it for you SNMP Client.  I use ESX server at work to reduce hardware requirements, and to provide independence of services. I am currently setting up Zabbix as a monitor server, and would like to be able to monitor our companies ESX servers, for disk space, system load, and other options.  I have previously setup a Nagios server, however it was lost due to hardware failure during the setup, before backup was setup.  This guide will provide the numeric values for VMWare’s ESX server MIB values, which are hard to discover using the administration guide.
SNMP stands for Simple Network Management Protocol, and allows you to query a server or router/network switch for different values.  These values might include free disk space, cpu usage, memory usage or network traffic.  You can also use SNMP to turn on or off different settings.
SNMP versions 1 and 2 are not secure in any way, and should not be exposed to then internet.  They use a “password” as such, called a “community”.  If you know this community string, then you can query/access the SNMP service.  Data is also transmitted in plain text, so could be watched on the wire.
SNMP version 3 introduces security, both encryption and community passwords, however not many devices (including VMWare ESX version 3.5) support version 3, so I will not concentrate on this version, as I have no experience with it, due to no devices supporting it.
This blog will concetrate on version 3.5 of VMWare’s ESX server.  Later versions may support different settings (I have seen version 4 will run a native SNMP server rather then the open source linux based SNMP server 3.5 supports) and earlier versions also support different settings, however are probably similar enough for this guide.
Vmware ESX 3.5 supports SNMP, however it is off by default. To enable SNMP, you need to open SNMP in the firewall settings.  Open the ESX server management interface, and go to “Configure” and select “Security”.  Under properties, enable the SNMP service in the firewall.
Next we need to enable the service. Ssh into the server, and edit the /etc/snmp/snmpd.conf file, to suit.  Make sure to change you rocommunity (Read Only community), as this is essentially the password for your SNMP service.  I will not cover traps as yet, as I have no need for that just yet.  Traps are a way of having your ESX server notify a monitoring system of events. Start the SNMP service, by running /etc/init.d/snmpd start.  To ensure that it runs on every boot, run the command ‘chkconfig snmpd on’.
Test that your server runs, by running on your linux workstation:
snmpwalk -v 2c -c ${ROCOMMUNITY} ${ESX_SERVER_IP} .iso.org.dod.internet.private.enterprise.6876
Where ${ROCIMMUNITY} is the rocommunity string (password) you setup earlier and the ${ESX_SERVER_IP} is the ip address of your ESX server.  The .iso.org.dod.internet.private.enterprises.6870 Structure of Management Information (SMI) describes what we want to see – in this case a private internet enterprise, 6870 being VMWare.  All of VMWare’s data will be a sub-category of this SMI.
This command should list a large amount of values relating to your ESX server, and you have successfully setup the server. Each of these values can be monitored by your network monitor tool, such as Zabbix, or Nagios.
The meaning of these values is found in the VMWare Basic Administration Guide available in PDF form.  It provides the method of determining the structure, however does not make it clear the numeric data.
I have not compiled the data into a more meaningful form, I was hoping to, but it does not seem worth it at the moment.
In your snmp client, or monitoring software, just put the SNMP OID in, and it should get the requested value.
I do hope to publish another entry on custom monitoring via SNMP, as I have setup some custom monitoring for work.