View Only
  • 1.  vCenter Alarms via SNMP

    Posted Feb 26, 2010 07:17 PM


    Does anyone know if there is a document from VMware that includes all the alarm trigger names that are available? For example, every alarm has a trigger. Every trigger has a present name. I need to filter alerts sent to our monitoring server by the alarm trigger. For example, the default alarm Host Connection Failure has a line in our receiving SNMP server with a entry "alarm.HostConnectivityAlarm". I need a list of all names in the format of "alarm.alarmname".

    Thank you.

  • 2.  RE: vCenter Alarms via SNMP

    Posted Oct 15, 2015 01:47 PM

    I know this is a REALLY old post-- but I had a similar question recently and stumbled on this.  I ended up figuring out that the DEFAULT vCenter Alarm names that get send to the SNMP Trap in the $4 varbind are actually the vCenter SYSTEM NAME for the alarm and not the gui "name".  So for every vCenter trap that fires from an Alarm, $4 will always begin with the system name of the alarm followed by the alarm data all as a string variable.

    For custom/user created alarms, instead of $4 starting with the system name, it simply uses the friendly/gui name.

    I wrote a powercli script to query vcenter and pull all the alarm names + their system name + their description.  From here we could feed this into our SNMP Receiver logic for additional handling.

    Hopefully this will help others!  :smileyhappy:

    #Name:  Get-VCAlarmName.ps1
    #Author: Matt Osburn
    #Exports Alarm Names from vCenter to csv for SNMP String Reads
    #EXAMPLE      [vSphere PowerCLI].:\> .\GetAlarms.ps1

    # Set vCenter Variables
    $vCenter = Read-Host -Prompt "Enter your VC (FQDN)"
    $currentPath = Split-Path ((Get-Variable MyInvocation -Scope 0).Value).MyCommand.Path

    # Add PowerCLI Snapins
    Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue

    #Ask for vCenter Creds
    $Creds = $host.ui.PromptForCredential("vCenter Credentials Required", "Please enter your Active Directory user name and password.", "", "NetBiosUserName")

    # Connect to the vCenter server
    Connect-VIServer $vCenter -Credential $Creds | Out-Null

    $output = foreach ($alarm in (Get-AlarmDefinition | Sort Name))
        $alarm | Select-Object @{N="Alarm";E={$alarm | %{$}}},
                               @{N="SystemName";E={$alarm | %{$}}},
                               @{N="Description";E={$alarm | %{$}}}
    $output | Export-Csv AlarmDef.csv -UseCulture -NoTypeInformation

    Disconnect-VIServer -Server $vCenter -Confirm:$false


    Example Output

    Cannot find vSphere HA master agentalarm.HAcannotFindMasterDefault alarm to alert when vCenter Server has been unable to connect to a vSphere HA master agent for a prolonged period
    Cannot connect to storagealarm.StorageConnectivityAlarmDefault alarm to monitor host connectivity to storage device