In this lab, I am going to demonstrate the vCenter Server Alarm Feature
An Alarm is a notification that mainly occurs in response to selected events and conditions that happen with an object in the inventory. The alarm is the important to monitor the vCenter inventory because it is very difficult to check each of inventory activities manually. It gives you acknowledge of the object’s activities in the vCenter Server inventory.
By default, VMware provides a set of predefined alarm for the objects in the vCenter Server inventory. But You can also define your own custom alarm for your resources in the vCenter Server inventory.
VMware predefined alarms are configurable. You can edit, modify it if it does not fulfil your requirement such as condition, state or event that you want to monitor.
The tasks for the lab 20:
- Create a Virtual Machine Alarm that Monitor for a Condition
- Create a Virtual Machine Alarm that Monitor for an Event
- Trigger Virtual Machine Alarms and Acknowledge the Alarm
- Disable the Virtual Machine Alarms
- Log in the VMware vSphere web client portal: https://vCenter Server Appliance Name.domainname:9443/vshpere-client/# or VMware vSphere Client via root user and password.
Steps for the task: Create a Virtual Machine Alarm That Monitors for a Condition
In this task, I am going to create a VM alarm for monitoring VM activity with a condition.
Step1: Go to the Home -> vCenter -> Hosts and Clusters
Step 2: Select the name of the VM in the inventory for setting alarm. In my case, I chose “momatajvmclient 1-2” for performing this task. Note: As I am creating this alarm for “momatajvmclient 1-2” specific Virtual machine, this alarm only monitors that “momatajvmclient 1-2” VM. If you create the alarm on the vCenter Server object, the alarm will apply to all VMs in your system.
Select Manage -> Alarm Definitions Note: VM inherited alarms defined at the vCenter Server level
Click “Add” (+)
Step 3: A new Alarm Definition wizard is displayed. Now you need to perform the following action that I showed on the Screenshot.
Option 1: General tab:
Alarm name: Give an appropriate name. I gave VM CPU Usage-Momataj
Alarm type: Virtual Machine from drop-down menu
Monitor for: Select Specific Conditions or State, for example, CPU Usage
Enable the alarm: Selected
Option 2: Trigger -> Click Add (+)
Perform the following action to set a trigger for the alarm.
Option: Trigger name: VM CPU Usage
Operator: Is above
Warning Condition: Double click the current value on the column and set it 25% for 30 Minutes. That means after 25% CPU usage in 30 minutes, the trigger condition must trigger a warning alarm.
Condition length: 30 seconds from the drop down menu. That means Trigger will take 30 seconds to generate an alarm.
Critical Condition: 50% for 5 minutes. That means: Above 50% for 5 minutes will be considered as critical condition for CPU and trigger must generate an alarm
Option 3: Action. Click add (+) icon. Note: An action specifies when the alarm is triggered. It is an operation that occurs in response to the trigger such as send an email notification to the administrator.
Now you need to configure the following action settings for generating an alarm.
Action: Click ” Send a Notification email below the action header to activate the drop-down menu. Select Suspend VM from the list.
Configuration: leave it blank
Green to Yellow: Select “Once”
Leave rest of the setting by default.
Step 4: Verify that newly created alarm from the list of the alarms
Steps for the task: Create a Virtual Machine Alarm that Monitors for an Event
Event triggers use arguments, operators, and values to identify the triggering condition. It does not rely on the thresholds or durations.
Creating an alarm comprises setting up general alarm, triggers, triggers reporting and alarm actions.
Step 1: Select Home ->vCenter ->Hosts and Clusters -> datacenter in the inventory
Click Add (+)
Step 2: You need to perform the following configuration to set alarm action as I showed the following on the screenshot
Step 3: Verify your newly created alarm from the alarm definition list: VM Suspended-Momataj [in my case]
Steps for the task: Trigger Virtual Machine Alarms and Acknowledge the Alarms
The acknowledge alarm feature is used to track when triggered alarm is addressed. When you acknowledge an alarm, its alarm actions are discontinued and the
alarm is neither cleared nor reset.
Step 1: Click on the VM for that you configure the alarm [ momatajvmclient1-2] I configured alarm so I am going to select it and triggering an alarm on this specific VM.
Monitor -> Issues-> Triggered Alarms
Step 2: Right click on your VM and select Open console. Log in your VM as I did.
Run the “Cpubusy.vbs” script with “Open with Command prompt“
Step 3: Monitor the performance of your VM CPU Usage. Monitor -> Performace -> Advanced
Step 4: After waiting 30 seconds, the alarm is triggered. You can monitor it from “Recent Task” Activity name is: Suspended Virtual Machine
Step 5: You can monitor it also from Monitor -> Tasks
Step 6: Monitor -> Issues: Now you can see an issue there: VM Suspended-momataj
In the triggered alarm, you can see critical trigger alarm with red warning sign
Verify the suspended alarm from the summary. You can see VM is showing “Suspended”
Step 8: Now Power on the Suspended Virtual Machine
Stop the CPU busy script by pressing Ctrl+C
Step 9: Go to the ” Monitor -> Issues -> Triggered Alarm and Click on Critical Severity and Select “Reset to Green“
Steps for the task: Disable Virtual Machine Alarms
In this task, I am going to show how to disable the alarm for the object on which alarm was defined. Note that, You can enable the alarm again after disabling it.
Step 1: The first task is to disable the VM CPU Usage Alarm
Select you VM on which you applied the alarm in the inventory.
Click Manage -> Alarm Definitions Tab . Righ-Click on your VM CPU Usages alarm and Select Edit.
In the General tab: Deselect the “Enable this alarm”
Step 2: Disable VM suspended alarm
Home ->vCenter -> Hosts and Clusters -> DataCenters -> Manage -> Alarm Definitions -> Select “Edit”
Deselect the “Enable this alarm“
Thank you 🙂