Clearing the Alerts and Alarms Tables in vRealize Operations
search cancel

Clearing the Alerts and Alarms Tables in vRealize Operations

book

Article ID: 315973

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • After selecting multiple alerts in VMware vRealize Operations Manager and clicking Cancel Alert, one or more of the selected alerts remains active.
  • An error states that a few alerts which were deleted may still be present.
  • The cluster suffers performance issues while a high number of historical alerts and/or alarms are present.


Environment

VMware vRealize Operations Manager 6.2.x
VMware vRealize Operations Manager 7.0.x
VMware vRealize Operations 8.1.x
VMware vRealize Operations Manager 6.7.x
VMware vRealize Operations 8.x
VMware vRealize Operations Manager 6.4.x
VMware vRealize Operations Manager 6.3.x
VMware vRealize Operations Manager 7.5.x
VMware vRealize Operations 8.0.x
VMware vRealize Operations Manager 6.5.x
VMware vRealize Operations Manager 6.0.x
VMware vRealize Operations Manager 6.1.x
VMware vRealize Operations Manager 6.6.x

Resolution

To resolve these issue, delete alerts directly from the database, or clear the tables.
  1. Log into the primary node as root via SSH or Console, pressing ALT+F1 in a Console to log in.
  2. Launch the psql utility and connect to the vPostgres database by running this command::
su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -p 5432"

Note: The prompt changes to vcopsdb=> when the command is completed.
  1. Choose option 1 or 2, depending on what you would like to do:
Note: The alarms table correlates to Symptoms, and the alerts table correlates to Alerts in the vRealize Operations UI.

Option 1: Clear all alerts and alarms

truncate table alert cascade;
truncate table alarm cascade;
 

Option 2: Clear alerts and alarms related to a specific resource

delete from alert where resource_id = resource_id;
delete from alarm where resource_id = resource_id;

Note: The resource_id value can be obtained from the Administration > Inventory page, click on the Show Columns icon in the bottom and select Internal ID.  Filter for the object and use the Internal ID as the resource_id value.
  1. Type \q to exit the psql utility.
  2. Repeat steps 1 to 4 on all other analytic (primary, replica, and data) nodes in the cluster.
  3. Log into the vRealize Operations Admin UI as the local admin user.
  4. Click Take Offline under Cluster Status.
Note: Wait for Cluster Status to show as Offline.
  1. Click Bring Online under Cluster Status.
Note: Wait for Cluster Status to show as Online.


Additional Information

To be alerted when this document is updated, click the Subscribe to Article link in the Actions box.
 
If the Alerts and Alarms tables are large, it's recommended to truncate both tables to clear out historical alerts and alarms to avoid cluster performance issues.
The sizes can be check with this command:
su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -A -t -c 'select count(*) from alert'"; su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -A -t -c 'select count(*) from alarm'"
Note: A few thousand is an acceptable number.
Alternatively, the Global Settings value for Symptoms/Alerts can be lowered so the age of deleted alerts and alarms can be better controlled.
在 VMware vRealize Operations Manager 6.0.x 中,取消选定的警报后,其中的一个或多个警报仍处于活动状态
vRealize Operations Manager 6.xで選択したアラートをキャンセルすると、選択したアラートの1つ以上がアクティブのまま残ります
Nach dem Abbrechen der ausgewählten Warnungen in VMware vRealize Operations Manager 6.0.x ist mindestens eine der ausgewählten Warnungen weiterhin vorhanden

Impact/Risks:
It is recommended to take snapshots or backups before doing any database work.
See How to take a Snapshot of vRealize Operations for more information.