Emailgency logo
Emergency
mail access

Esxmon: VMware hardware monitoring

You can monitor and backup your VMware at the same time using the ghettoVCB fronend.

MKSBackup allows you to monitor your VMware ESX(i) server hardware. This include RAID array, redundant power supplies, cooling fans or any other components being monitored by the VMware layer.
Now, it is easy to backup and check the status at the same time.

How it works   

You don't need to install anything on your ESX(i) server, MKSBackup when installed on a friendly Windows or Linux host, communicates with your VMware server using the CIM-XML protocol, usually on port 5989.

It will enumerate the specified WBEM provider class instances and search for properties OperationalStatus and HealthState. If any of them have a bad status, MKSBackup will report the error.

An email can be sent at every check or only when the status has changed using the mail_when option.

You can also monitor your server from the MagiKmon board and be warned as soon as something goes wrong or if the status has not been updated for too long !

You can schedule a regular check in your Un*x cron or in your Windows Task scheduler.

Getting Started

For more information on how to install and start MKSBackup, visit the Overview page. You have the choice between multiple scenarios:

Monitor from a Windows host

After you have installed MKSBackup into C:\Magik\MKSBackup, create C:\Magik\mksbackup.ini like this:

[DEFAULT]
smtp_host=smtp.yourprovider.com
sender=backup.operator@server01.example.com
recipients=me@example.com  someone.else@domain.com

[ESXMON]
program=esxmon
url=https://<your vmware host ip>:5989
login=root
password=<your vmware password>
mail_when=status
verbose=yes
friendly_value=yes

Modify the url and password to match your server configuration. Also setup the mail configuration to match your network setup.

Now start the program !

C:\Magik> c:\Magik\mksbackup\mksbackup.exe -c C:\Magik\mksbackup.ini -d backup ESXMON

The backup command is a little confusing, but remember MKSBackup is first a backup tools :-). And look at the output !

08:00:57,655 INF start version=0.9.8 cmd=['mksbackup', '-c', 'mk.ini', '-d', 'backup', 'ESXMON']
08:00:58,030 INF class list: CIM_Sensor, CIM_PowerSupply, CIM_Chassis, CIM_ComputerSystem, CIM_NumericSensor, CIM_Memory, CIM_PhysicalMemory, CIM_Processor, CIM_LogRecord, CIM_RecordLog, CIM_EthernetPort, CIM_SoftwareIdentity, OMC_SMASHFirmwareIdentity, OMC_DiscreteSensor, OMC_Fan, OMC_PowerSupply, OMC_RawIpmiSensor, OMC_RawIpmiEntity, VMware_StorageExtent, VMware_Controller, VMware_StorageVolume, VMware_Battery, VMware_SASSATAPort, OMC_PhysicalMemory
08:00:58,046 INF No errors in section: ESXMON
08:00:58,046 INF start command=backup job=ESXMON archiver=esxmon
08:00:58,046 INF start url=https://192.168.1.11:5989
08:00:59,217 WAR class CIM_Memory: The requested object could not be found
08:01:03,467 INF status: OK
08:01:03,467 INF end command=backup job=ESXMON archiver=esxmon
08:01:03,467 INF name=ESXMON
08:01:03,467 INF program=esxmon
08:01:03,483 INF version=0.9.8
08:01:03,483 INF status=OK
08:01:03,483 INF hostname=pcasx
08:01:03,483 INF exit_code=0
08:01:03,483 INF start=Wed Oct 20 08:00:58 2010
08:01:03,483 INF end=Wed Oct 20 08:01:03 2010
08:01:03,483 INF start_epoch=1287554458
08:01:03,483 INF end_epoch=1287554463
08:01:04,265 INF mail sent to: me@example.com, someone.else@domain.com

You should have received the report to your email addresse. To avoid the warning, we will exclude CIM_Memory class from the check by adding this line:

class_exclude=CIM_Memory

Now you can schedule this check on a regular basis ! On Windows, it is a little tricky to start a program every 5min. Read this article. Mix it with How to schedule MKSBackup.

Monitor from a Linux host

Since version 0.9.22 PyWBEM package is include in MKSBackup and you don't need to install it on you linux host anymore.

The use under Linux is quasi identical to the Windows sample above. Read it for more !

You can run the command at regular interval in your cron like this.

# mksbackup VMware monitoring
*/5 * * * * [root] /usr/bin/mksbackup -q -l /var/log/mksbackup.log -c /etc/mksbackup/mksbackup.ini backup ESXMON

Be careful to include or not the root user depending you are using crontab -e or you are editing system cron files. Go back to How to schedule MKSBackup for more.

Integration with MagiKmon

The status can be sent to a monitoring service called a guard. Create such a service under your MagiKmon account and take note of the URL of this service, then add this URL to your mksbackup.ini file like this.

magikmon=http://monitoring.magikmon.com/guard/51/myesxi

Now, every time MKSBackup runs, it will send the status of your VMware server to your MagiKmon board every time it has changed or at least once every hour.

If the email configuration is active, you will receive the status by email depending on how you setup the mail_when option. You can also disable the email adding this line to your ESXMON section.

mail=no

Job parameters

program (mandatory)

To use this back-end, program must be set to esxmon.

program=esxmon

url (mandatory)

This is the address where CIM service is waiting for connections. Usually the service bind to the port 5989 and use https communication protocol.

url=https://192.168.1.11:5989

login (mandatory)

This is the account used to login to your ESX(i) server. You can use the root account.

login=root

password (mandatory)

This is the password of your login account on your ESX(i) server.

password=secret

mail_when (optional, default is always)

This option tell MKSBackup when to send the mail report:

mail_when=always

magikmon (optional)

If you choose to monitor your server using MagiKmon, this is the address of the magikmon service in charge of your server. MKSBackup will send the status at this URL. You can find this address in the definition of the service in the MagiKmon interface.

magikmon=http://monitoring.magikmon.com/guard/51/myesxi

verbose (optional, default is yes)

This is a boolean switch, possible values are yes or no. If set to yes, the status of all properties will be included in the output report. When set to no, only properties used to calculates the status are included.

verbose=yes

friendly_value (optional, default is no)

This is a boolean switch, possible values are yes or no. Usually values of properties are senseless numerical values. When set to yes, and when a translation table exists, MKSBackup will replace the value by its more friendly equivalent in the table.

friendly_value=no

class_list

This is a space separated list of classes MKSBackup will check. If not specified a default list will be used. Don't modify this list, use instead class_include and class_exclude to alter the default.

class_list=CIM_Sensor CIM_PowerSupply CIM_Chassis CIM_ComputerSystem CIM_NumericSensor CIM_MemoryCIM_PhysicalMemory CIM_Processor CIM_LogRecord CIM_RecordLog CIM_EthernetPort CIM_SoftwareIdentity OMC_SMASHFirmwareIdentity OMC_DiscreteSensor OMC_Fan OMC_PowerSupply OMC_RawIpmiSensor OMC_RawIpmiEntity VMware_StorageExtent VMware_Controller VMware_StorageVolume VMware_Battery VMware_SASSATAPort

class_include

This is a space separated list of classes MKSBackup will add to the above class_list parameter.

class_include=OMC_PhysicalMemory

class_exclude

This is a space separated list of classes MKSBackup will not check at all. This allow you to remove classes that are generating useless error message or reporting incorrect values.

class_exclude=CIM_Memory

property_exclude

This is a space separated list of properties that MKSBackup will ignore. This is useful to ignore a false positive value or if MKSBackup generate error when handling the property.

You can ignore a property using its name: Capacity, or qualify the property with it class like this CIM_PhysicalMemory.Capacity to ignore the property for one class and all its instances. Or fully qualify the property with it class and instance like this CIM_PhysicalMemory.DIMM3.Capacity to ignore one specific instance !

property_exclude=Capacity, CIM_PhysicalMemory.Capacity, CIM_PhysicalMemory.DIMM3.Capacity

Mail report

The mail report reproduce the usual structure but can also include the following attachments.

output.txt

This is a list of properties=values for every specified classes. The file looks like this :

...
===== CIM_PhysicalMemory DIMM3 =====
           BankLabel=BANK3
           Capacity=2147483648
           Caption=DIMM3
           CreationClassName=OMC_PhysicalMemory
           DataWidth=64
           Description=DIMM3
           ElementName=DIMM3
           FormFactor=DIMM
           InterleavePosition=0
           IsSpeedInMhz=True
           Manufacturer=Manufacturer3
           MaxMemorySpeed=800
           MemoryType=DDR-2
OK         OperationalStatus= (Unknown)
           PartNumber=PartNum3
           PositionInRow=1
           SerialNumber=SerNum3
           Speed=1
           Tag=32.3
           TotalWidth=64
===== CIM_Processor LGA775 =====
           CPUStatus=Unknown
           Caption=LGA775
           Characteristics= (64-bit Capable, Enhanced Virtualization, NX-bit, Power/Performance Control)
           CreationClassName=OMC_Processor
           CurrentClockSpeed=2400
           DataWidth=64
           Description=LGA775
           DeviceID=3.1024
           ElementName=LGA775
           EnabledDefault=Enabled
           EnabledProcessorCharacteristics= (Enabled, Enabled, Enabled, Disabled)
           EnabledState=Enabled
           ExternalBusClockSpeed=266
           Family=Pentium(R) 4
OK         HealthState=OK
           IdentifyingDescriptions=(Brand ID)
           MaxClockSpeed=3800
           ModelName=Intel(R) Core(TM)2 Quad CPU @ 2.40GHz
           NumberOfEnabledCores=4
OK         OperationalStatus= (OK)
           OtherIdentifyingInfo=(0x ff)
           RequestedState=Not Applicable
           Stepping=7
           SystemCreationClassName=OMC_UnitaryComputerSystem
           SystemName=00020003-0004-0005-0006-000700080009
           TransitioningToState=12
           UpgradeMethod=Socket LGA775
...