How to Configure VMware ESXi 5.0 Email Alerts for MegaRAID SAS 9260-4i Degraded RAID Status


2 views

When working with whitebox servers running VMware ESXi 5.0 on LSI MegaRAID controllers, you'll quickly discover that the native "host storage status" alarms don't reliably trigger for hardware RAID events. This creates a dangerous blind spot for production environments.

Here are three proven methods to get RAID degradation alerts:

Create a cron job that periodically checks RAID status using MegaCLI:

#!/bin/bash
RAID_STATUS=$(/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aAll | grep "State")
if [[ "$RAID_STATUS" != *"Optimal"* ]]; then
    echo "RAID Degradation Detected: $RAID_STATUS" | mail -s "RAID Alert" admin@example.com
fi

For more advanced integration with vCenter:

use VMware::VIRuntime;
my $host_view = Vim::find_entity_view(view_type => 'HostSystem');
my $storage_system = Vim::get_view(mo_ref => $host_view->configManager->storageSystem);
if ($storage_system->storageDeviceInfo->softwareCompatibilityStatus->status ne 'green') {
    # Implement your email notification logic here
    send_alert_email();
}

Configure your MegaRAID controller to send SNMP traps to a monitoring solution:

# In /opt/MegaRAID/MegaCli/MegaCli64.cfg
SNMPEnable=1
SNMPCommunity=public
SNMPTrapDest=192.168.1.100

Remember that inbox drivers (as indicated in VMware's HCL) often provide basic functionality without full monitoring capabilities. For production environments, consider:

  • Implementing multiple notification methods (email + SMS)
  • Setting up test scenarios to verify your alerting works
  • Monitoring battery backup unit status on your RAID controller

When working with VMware ESXi 5.0 and LSI MegaRAID SAS 9260-4i controllers, you'll quickly discover that the built-in "host storage status" alarm doesn't reliably trigger for hardware RAID events. This creates a dangerous blind spot in your monitoring infrastructure.

The "inbox" driver support means basic functionality works, but advanced monitoring capabilities aren't included. The vCenter alarms primarily monitor:

  • VMFS volume status changes
  • Storage path failures
  • Datastore capacity thresholds

Hardware RAID events don't propagate through this channel.

Here are three approaches to solve this:

Method 1: MegaCLI Script Monitoring

Create a cron job that periodically checks RAID status:

#!/bin/bash
# Check RAID status via MegaCLI
STATUS=$(/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aAll | grep "State")

if [[ $STATUS != *"Optimal"* ]]; then
  echo "RAID array degraded!" | mail -s "RAID Alert" admin@example.com
  # Trigger additional actions like:
  # /usr/bin/vim-cmd hostsvc/maintenance_mode_enter
fi

Method 2: SNMP Trap Configuration

Configure the RAID controller to send SNMP traps:

# On ESXi host:
esxcli system snmp set --communities public
esxcli system snmp set --enable true

# On MegaRAID controller:
/opt/MegaRAID/storcli/storcli64 /c0 set trap=enable
/opt/MegaRAID/storcli/storcli64 /c0 set trapdest=

Method 3: vCenter Alarm Enhancement

Create a custom alarm that monitors the hardware sensor:

# PowerCLI script to create custom alarm
$alarmMgr = Get-View AlarmManager
$alarm = New-Object VMware.Vim.AlarmSpec
$alarm.Name = "RAID Degradation Alert"
$alarm.Description = "Triggers on RAID health changes"
$alarm.Enabled = $TRUE

$trigger = New-Object VMware.Vim.AlarmTriggeringAction
$trigger.Action = New-Object VMware.Vim.SendEmailAction
$trigger.Action.ToList = "admin@example.com"
$trigger.Action.Subject = "RAID Array Degraded!"
$alarm.Action = $trigger

$alarm.Expression = New-Object VMware.Vim.OrAlarmExpression
$alarm.Expression.Expressions = @(
  (New-Object VMware.Vim.EventAlarmExpression -Property @{
    EventType = "LsiMegaraidEvent"
    EventTypeId = "storage.megaraid.degraded"
  })
)
$alarmMgr.CreateAlarm("HostSystem", $alarm)

For production environments, I recommend combining methods:

  1. Use MegaCLI scripts for immediate local detection
  2. Configure SNMP traps for centralized monitoring
  3. Implement vCenter alarms for integration with existing workflows

The exact solution depends on your:

  • Monitoring infrastructure maturity
  • Available management tools
  • Organizational notification requirements