DX NetOps

 View Only

 About "Cause Code"

MARUBUN SUPPORT's profile image
MARUBUN SUPPORT posted Mar 04, 2025 03:56 AM

Hi Team,
We have received the following question from one of our customers. 
We would appreciate any advice you can give us.


[Product]
CA Spectrum 23.3

[Questions]
As shown in the Screen Shot below, there are "Event Code" and "Cause Code" items in the "Navigation" window.
Could you please tell me the meaning of the "Cause Code" displayed here?

Best Regards
Marubun Support

Catalin Farcasanu's profile image
Catalin Farcasanu

You should read this. Better off, read the entire chapter "Event Configuration". It describes how events and alarms are configured in the system. CsPCauses codes are related to files for each alarm that is created. 

Joern (DB Systel)'s profile image
Joern (DB Systel)

The short answer is: "Event Code" is the "Type/Code" of the Event - "Cause Code" is the "Type/Code" for the Alarm. The long answer is in the documentation as Catalin said.

Cheers,

Joern

MARUBUN SUPPORT's profile image
MARUBUN SUPPORT

Hi Joern-san,

Thank you for your advice.

I'm sorry for asking such a basic question, but I would be very grateful if you could point me to a manual or document that contains a list of "Type/Code" of the Event and "Type/Code" for the Alarm that include the Reason Code in the screenshot I have attached to this question.


Best Regards,
Marubun Support

Raj.A's profile image
Raj.A

There is no direct document that lists all the event/cause codes as it is a huge list. To view the configured and available event/cause code, you can use Event Configuration Editor or Respective Event Configuration files under $SPECROOT/SS/CsVendor/ folder or under $SPECROOT/custom/Events/ for any customized events.

Similarly, You can find probable cause files under $SPECROOT/SG-Support/CsPCause/ or $SPECROOT/custom/Events/CsPCause/ folders.

Please refer the below KB article.

https://knowledge.broadcom.com/external/article/15453/how-to-get-all-the-events-by-severity-in.html

Cheers.

Raj

Catalin Farcasanu's profile image
Catalin Farcasanu

Try this:

---

for event in $(find  $SPECROOT -type f -name EventDisp | xargs egrep " A " | gawk '{print $1}' | gawk -F":" '{print $2}'); do
  id=$(echo $event | gawk -F"0x" '{print $2}');
  alarm=$(find $SPECROOT/SG-Support -type f -name "Prob*${id}*" | xargs head -1);
  if [[ ${alarm} != "" ]]; then
  #alarm exists
  alarm_severity=$(find $SPECROOT -type f -name EventDisp |xargs egrep $event |grep -v Install-Tools |grep A |gawk -F" A " '{print $2}' | gawk -F"," '{print $1}');
  is_trap_alarm=$(find $SPECROOT -type f -name AlertMap |xargs egrep -w $event |grep -v Install-Tools |wc -l);
  if [[ ${is_trap_alarm} -gt 0 ]]; then
    case ${alarm_severity} in
    1)
    severity="MINOR";;
    2)
    severity="MAJOR";;
    3)
    severity="CRITICAL";;
    4)
    severity="4";;
    5)
    severity="5";;
    esac
    echo -e "$event | $severity | $alarm" >> /tmp/trap_alarms.txt
  else
    case ${alarm_severity} in
    1)
    severity="MINOR";;
    2)
    severity="MAJOR";;
    3)
    severity="CRITICAL";;
    4)
    severity="4";;
    5)
    severity="5";;
    esac
    echo -e "$event | $severity | $alarm" >> /tmp/event_alarms.txt
  fi
  #trap_alarm=$(echo $event | gawk -F"0x" '{print $2}');
  fi
done

---

It should output 2 files: /tmp/trap_alarms.txt and /tmp/event_alarms.txt. As the name say, each should contain the list of alarms that are created based on SNMP traps and the list of alarms that are created based on Spectrum Events. 

The format is:

EventCode/CauseCode | Criticality | Alarm Name

0x3e00009 | MAJOR | MONITORED LOG MATCH TRAP RECEIVED

It takes a while to finish.

David DuPre's profile image
David DuPre

This script worked for me without throwing an error:

for event in $(find "$SPECROOT" -type f -name EventDisp 2>/dev/null | xargs egrep " A " | gawk '{print $1}' | gawk -F":" '{print $2}'); do
  id=$(echo "$event" | gawk -F"0x" '{print $2}')
  alarm=$(find "$SPECROOT/SG-Support" -type f -name "Prob*${id}*" 2>/dev/null | xargs head -1)
  if [[ -n "$alarm" ]]; then
    # Alarm exists
    alarm_severity=$(find "$SPECROOT" -type f -name EventDisp 2>/dev/null | xargs egrep "$event" | grep -v Install-Tools | grep " A " | gawk -F" A " '{print $2}' | gawk -F"," '{print $1}')
    is_trap_alarm=$(find "$SPECROOT" -type f -name AlertMap 2>/dev/null | xargs egrep -w "$event" | grep -v Install-Tools | wc -l)
    if [[ "$is_trap_alarm" -gt 0 ]]; then
      case "$alarm_severity" in
        1) severity="MINOR";;
        2) severity="MAJOR";;
        3) severity="CRITICAL";;
        4) severity="4";;
        5) severity="5";;
      esac
      echo -e "$event | $severity | $alarm" >> /tmp/trap_alarms.txt
    else
      case "$alarm_severity" in
        1) severity="MINOR";;
        2) severity="MAJOR";;
        3) severity="CRITICAL";;
        4) severity="4";;
        5) severity="5";;
      esac
      echo -e "$event | $severity | $alarm" >> /tmp/event_alarms.txt
    fi
  fi
done