Add UUID in SNMP trap
FM sends alarm information for SNMP trap but it is lacking Alarm UUID, which needs to identify the alarm. This fix is adding uuid for all type of trap information. Closes-bug: 1971626 TEST PLAN: PASS: Confirm UUID is included in trap information in log /var/log/fm-manager.log. [Trap type] - wrsAlarmCritical - wrsAlarmMajor - wrsAlarmMinor - wrsAlarmWarning - wrsAlarmMessage - wrsAlarmClear - wrsAlarmHierarchicalClear Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com> Change-Id: I3e2b7e4a6a07876ff08e6a13d46d50285465a6b2
This commit is contained in:
parent
4a55539a8b
commit
ad1d95fdf5
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2017-2020 Wind River Systems, Inc.
|
||||
// Copyright (c) 2017-2022 Wind River Systems, Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
@ -25,6 +25,7 @@ const std::string ALARM_MSG = "wrsAlarmMessage";
|
||||
const std::string ALARM_CLEAR = "wrsAlarmClear";
|
||||
const std::string ALARM_HIERARCHICAL_CLEAR = "wrsAlarmHierarchicalClear";
|
||||
|
||||
const std::string ALARM_UUID = "wrsAlarmActiveUuid";
|
||||
const std::string ALARM_ID = "wrsAlarmActiveAlarmId";
|
||||
const std::string ALARM_INSTANCE_ID = "wrsAlarmActiveEntityInstanceId";
|
||||
const std::string ALARM_DATE_TIME = "wrsAlarmActiveDateAndTime";
|
||||
@ -36,6 +37,7 @@ const std::string ALARM_REPAIR_ACTION = "wrsAlarmActiveProposedRepairAction";
|
||||
const std::string ALARM_SERVICE_AFFECTING = "wrsAlarmActiveServiceAffecting";
|
||||
const std::string ALARM_SUPPRESSION = "wrsAlarmActiveSuppressionAllowed";
|
||||
|
||||
const std::string EVENT_UUID = "wrsEventUuid";
|
||||
const std::string EVENT_ID = "wrsEventEventId";
|
||||
const std::string EVENT_INSTANCE_ID = "wrsEventEntityInstanceId";
|
||||
const std::string EVENT_DATE_TIME = "wrsEventDateAndTime";
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2014-2020 Wind River Systems, Inc.
|
||||
// Copyright (c) 2014-2022 Wind River Systems, Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
@ -204,6 +204,7 @@ static std::string format_trap_json(int type, SFmAlarmDataT &data){
|
||||
}
|
||||
|
||||
if (operation_type == ALARM_CLEAR){
|
||||
add_value_json_trap(result, ALARM_UUID, data.uuid);
|
||||
add_value_json_trap(result, ALARM_ID, data.alarm_id);
|
||||
add_value_json_trap(result, ALARM_INSTANCE_ID,
|
||||
data.entity_instance_id);
|
||||
@ -211,12 +212,14 @@ static std::string format_trap_json(int type, SFmAlarmDataT &data){
|
||||
add_value_json_trap(result, ALARM_DATE_TIME, time_str);
|
||||
add_value_json_trap(result, ALARM_REASON_TEXT, data.reason_text);
|
||||
} else if (operation_type == ALARM_HIERARCHICAL_CLEAR){
|
||||
add_value_json_trap(result, ALARM_UUID, data.uuid);
|
||||
add_value_json_trap(result, ALARM_INSTANCE_ID,
|
||||
data.entity_instance_id);
|
||||
fm_db_util_make_timestamp_string(time_str, 0, true);
|
||||
add_value_json_trap(result, ALARM_DATE_TIME, time_str);
|
||||
add_value_json_trap(result, ALARM_REASON_TEXT, CLEAR_REASON_TEXT);
|
||||
} else if (operation_type == ALARM_MSG){
|
||||
add_value_json_trap(result, EVENT_UUID, data.uuid);
|
||||
add_value_json_trap(result, EVENT_ID, data.alarm_id);
|
||||
add_value_json_trap(result, EVENT_INSTANCE_ID,
|
||||
data.entity_instance_id);
|
||||
@ -234,6 +237,7 @@ static std::string format_trap_json(int type, SFmAlarmDataT &data){
|
||||
} else if (operation_type == WARM_START){
|
||||
// nothing to add to cmd
|
||||
} else {
|
||||
add_value_json_trap(result, ALARM_UUID, data.uuid);
|
||||
add_value_json_trap(result, ALARM_ID, data.alarm_id);
|
||||
add_value_json_trap(result, ALARM_INSTANCE_ID,
|
||||
data.entity_instance_id );
|
||||
|
Loading…
Reference in New Issue
Block a user