Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event mgmt #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Event mgmt #48

wants to merge 2 commits into from

Conversation

spenugondaa
Copy link

@spenugondaa spenugondaa commented Jun 7, 2021

This is dependent on PR and follows the HLD

The changes involve yang definitions and transformer changes to support various show/exec commands. Translib code is updated with the new DB. A go library to raise events/alarms is introduced.

sonic# show event summary
Event summary
---------------------------------
Total:                         40000
Raised:                        14004
Acknowledged:                  7002
Cleared:                       14004
----------------------------------
sonic# show alarm summary
Alarm summary
---------------------------------
Total:                         0
Critical:                      0
Major:                         0
Minor:                         0
Warning:                       0
Acnowledged:                   0
----------------------------------
sonic# show event

----------------------------------------------------------------------------------------------------------------------------
Id           Action          Severity        Name                           Timestamp                   Description
----------------------------------------------------------------------------------------------------------------------------
2013         RAISE           WARNING         DUMMY_ALARM                    2021-06-07T04:21:55.256Z    RAISing for unit testing
2014         ACKNOWLEDGE     WARNING         DUMMY_ALARM                    2021-06-07T04:21:55.457Z    ACKNOWLEDGing for unit testing
2015         UNACKNOWLEDGE   WARNING         DUMMY_ALARM                    2021-06-07T04:21:55.658Z    UNACKNOWLEDGing for unit testing
2016         CLEAR           WARNING         DUMMY_ALARM                    2021-06-07T04:21:55.859Z    CLEARing for unit testing
2017         -               INFORMATIONAL   CUSTOM_EVPROFILE_CHANGE        2021-06-07T04:21:55.860Z    Raised for unit testing
sonic# show event
  details   Detailed view of events
  from      Set start id
  id        Display event
  profile   Display active Event Profile
  recent    Event recent
  severity  Display all events with a given severity
  start     Set start time
  summary   Display event summary
  |         Pipe through a command
  <cr>

sonic# sonic# show alarm
  acknowledged  Display all alarms
  all           Display all alarms
  detail        Active alarm details
  from          Set start id
  id            Display alarm
  recent        Alarm recent
  severity      Display all alarms with a given severity
  start         Set start time
  summary       Display alarm summary
  |             Pipe through a command
  <cr>

sonic# event
  profile  Select an event profile as active

sonic# event profile default.json
sonic# alarm
  acknowledge    Acknowledge an active alarm
  unacknowledge  Unacknowledge an active alarm

sonic# 

Dependent PRs:
sonic-buildimage
sonic-swss-common
sonic-mgmt-framework

)

func init() {
XlateFuncBind("DbToYang_event_severity_xfmr", DbToYang_event_severity_xfmr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see event_severity_xfmr in any annotation file. Did we miss the corresponding YANG and annotation file?

@@ -0,0 +1,39 @@
module sonic-alarm-annot {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All sonic yangs need to be in the buildimage folder.

XlateFuncBind("rpc_acknowledge_alarms", rpc_acknowledge_alarms)
XlateFuncBind("rpc_get_events", rpc_get_events)
XlateFuncBind("rpc_get_alarms", rpc_get_alarms)
XlateFuncBind("YangToDb_event_stats_key_xfmr", YangToDb_event_stats_key_xfmr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need event_stats_key_xfmr if the two functions does not do anything? Where is this defined in annotation file?

dell-engops pushed a commit to project-arlo/sonic-mgmt-common that referenced this pull request Feb 14, 2022
…a logging enhancements to improve debuggability - (sonic-net#48)

* Xfmr infra logging enhancements to improve debuggability - Log in/out messages/params from overloaded xfmr callbacks

* Addressed code review comment to change log messsages around callbacks to have before and after
@ndas7
Copy link

ndas7 commented Dec 6, 2023

Is this PR obsolete, or does it need to be rebased to reflect the changes for the previous comments? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants