Alarm Definitions have empty Alarm Names in vCenter 8.x
search cancel

Alarm Definitions have empty Alarm Names in vCenter 8.x

book

Article ID: 385289

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

The alarm definitions that have empty alarm names are alarms that were removed from vCenter 8.x, but not removed from the vCenter database during the upgrade to 8.x. 
The upgrade process would have replaced the alarm localisation files with only the alarms it is expecting to find on 8.x.

The issue affects vCenter 8.x only and will be fixed in 9.x.

Environment

vCenter 8.x 

Cause

When the vCenter tries to retrieve the alarm name localisation from the localisation file, and it doesn't exist, it returns an empty alarm name instead of the alarm system name.

Resolution

There are 2 possible solutions. The easier and recommended solution is number 1, delete the missing alarms - as these alarms were supposed to be replaced by the upgrade anyway.

Solution 1;
Delete the empty alarms from the alarm definitions. 

Solution 2;
Create localisations for the missing alarms.

1. Take a snapshot/backup of the vCenter in question
2. Find the alarm names that don't have a localisation entry, by running the following 4 commands on the vCenter;

$ psql -U postgres VCDB -c "select name from vpx_alarm" -o alarms.txt
$ (cat alarms.txt | grep -vi exhaust | head -n -3 | tail -n +3 | sort | awk -F "alarm." '{print $2}') > /tmp/temp1.txt
$ (find /etc/vmware-vpx -name alarm.vmsg | grep "en/" | xargs cat | grep -v "#" | grep -v "^$" | awk '{print $1}' | sed 's/\.[^.]*$//' | sort -u) > /tmp/temp2.txt
$ grep -Fxvf temp2.txt temp1.txt

Sample output;
$ grep -Fxvf temp2.txt temp1.txt
HostConnectionStateAlarm

For each entry outputted here, create an entry in the localisation file like so;
1. vim /etc/vmware-vpx/locale/en/alarm.vmsg
2. Shift + G to go to the bottom of the file
3. Press 'i' to insert text
4. Create a summary and a label entry for the missing alarm;
HostConnectionStateAlarm.label                  = "Host connection and power state"
HostConnectionStateAlarm.summary           = "Default alarm to monitor host connection and power state"

5. Restart relevant services;

service-control --restart vpxd
service-control --restart vsphere-ui