# Add E-mail alert and create Alarm Trigger $actAlarm40 = “VMKernel NIC not configured correctly” $actAlarm39 = “Virtual machine memory usage” $actAlarm38 = “Virtual machine high availability error” $actAlarm37 = “Virtual Machine Fault Tolerance vLockStep interval Status Changed” $actAlarm36 = “Virtual machine Fault Tolerance state changed” $actAlarm34 = “Virtual machine cpu usage” $actAlarm33 = “Timed out starting Secondary VM” $actAlarm32 = “Status of other host hardware objects” $actAlarm31 = “No compatible host for Secondary VM” $actAlarm30 = “Network uplink redundancy lost” $actAlarm29 = “Network uplink redundancy degraded” $actAlarm28 = “Network connectivity lost” $actAlarm26 = “License user threshold monitoring” $actAlarm25 = “License inventory monitoring” $actAlarm22 = “Host service console swap rates” $actAlarm18 = “Host IPMI System Event Log status” $actAlarm16 = “Host hardware temperature status” $actAlarm15 = “Host hardware system board status” $actAlarm14 = “Host hardware power status” $actAlarm9 = “Host connection and power state” $actAlarm7 = “Host Baseboard Management Controller status” $actAlarm5 = “Health status changed alarm” $actAlarm4 = “External I%2fO workload detected on a datastore” $actAlarm2 = “Cluster high availability error” $MailToDefault1 = Default Alarm Definitions The end result of what I want is shown below.Ĭonnect-VIServer -Server $vCenterServer -Protocol https -User $user -Password $pass -WarningAction Silentl圜ontinue | Out-Null All I want is to do is add the “Send a notification email” action, set the email address, and include a notification event for a green to yellow transition. So when I came across this blog post at VMPros, I knew I had something I could work with.Īs is usually the case, the script doesn’t do exactly what I need it to do, but the gist of it is definitely there. Copying code and modifying to suit your needs is a way of life for a Windows admin. I know that many solutions have already been discovered and scripted to accomplish many of the very same or similar tasks you’re trying to solve. So I set out to find how PowerCLI could help me.Ĭoming from a Windows background, I’m an old VBScript guy. As the proverb goes, if you repeat it, script it. ![]() But with 40 default alarms in vSphere, three vCenters, and being lazy as I am, I knew there must be a better solution than right clicking 120 alarms and copying-and-pasting an email address. All those are fairly quick to configure or lack a way to script a quick solution. For instance, every SQL Server maintenance task sends a success/failure e-mail alert, the NetApp Virtual Storage Console plug-in can be configured to e-mail an administrator after snapshots are taken, and the Dell iDRAC can send e-mails on hardware status changes. During the initial setup I was using my own local email address to test various alerting processes, of which there are several. ![]() Towards the end of a customer’s virtualization implementation we’re doing some clean-up of the environment.
0 Comments
Leave a Reply. |