Alarm Life Cycle Actions

Scenario Overview

Manage your alarms effectively to maintain network health and ensure prompt responses to potential issues. Crosswork Network Controller allows you to acknowledge, unacknowledge, clear, and annotate alarms within the controller using CNC Fault APIs

Prerequisites

Before running these examples, ensure:

  1. You have obtained an access token. Refer to the 'Getting Started' section for instructions.
  2. The cnc-api-common.sh script is properly configured.
  3. Necessary input/output directories exist for storing and retrieving alarm configuration files.

Acknowledge or Unacknowledge an Alarm

An alarm can have two statuses: Not Acknowledged or Acknowledged.

Not Acknowledged means the problem is not being worked on. It could indicate a new fault condition in the network, or a cleared fault condition that has recurred.

Acknowledged means a fault(alarm or event) has been recognized and is being worked on, or it has been recognized and ignored safely. Moving an alarm to the Acknowledged state is a manual operation and changes the alarm Status to Acknowledged. An acknowledged event is still considered to be open (that is, not cleared), so if any related events recur, the events are added to the alarm.

Run the script alarm_acknowledge.sh from the example directory.

cd cnc-fault-api-examples;./alarm_acknowledge.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

alarm_acknowledge() {
    # assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
    # read from jwt file and export it as AUTH_TOKEN_HDR
     export_jwt

      
    # STEP 1 : Update acknowledge as true for corresponding alarmid from  CNC_API_INPUT
    # STEP 2 : store the output in CNC_API_OUTPUT file
      CNC_API_URL=$CNC_FAULT_API_CTX/acknowledge
      CNC_API_INPUT="$PRJ/input/alarm-acknowledge.json"
      CNC_API_OUTPUT="$PRJ/output/alarm-acknowledge.json"
      http_put $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
    
}
alarm_acknowledge

Annotation / Add Notes to an Alarm

Alarm notes are a handy way to share and record important information missed by automated monitoring. Notes are permanently attached to the alarm and can be retrieved until the alarm is cleared from the database or deleted by a user. The user ID of the note-taker is stored with the note. You can annotate a single alarm or multiple alarms at the same time to add a note. Notes only support plain text entries.

Run the script alarm_note.sh from the example directory.

cd cnc-fault-api-examples;./alarm_note.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

alarm_note() {
    # assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
    # read from jwt file and export it as AUTH_TOKEN_HDR
     export_jwt

      
    # STEP 1 : Add alarm note for corresponding alarmid  from  CNC_API_INPUT
    # STEP 2 : store the output in CNC_API_OUTPUT file
      CNC_API_URL=$CNC_FAULT_API_CTX/note
      CNC_API_INPUT="$PRJ/input/alarm-note.json"
      CNC_API_OUTPUT="$PRJ/output/alarm-note.json"
      http_put $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
    
    
    # STEP 3 : Retrieve alarm note based on alarmid and type ( type can be system, network, device)
    # STEP 4 : store the output in CNC_API_OUTPUT file
      CNC_API_URL=$CNC_FAULT_API_CTX/note
      CNC_API_INPUT="$PRJ/input/alarm-note-retrieval.json"
      CNC_API_OUTPUT="$PRJ/output/alarm-note-retrieval.json"
      http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
    
}
alarm_note

Manually Clear an Alarm

Cleared means the fault condition no longer exists. You can clear one or multiple alarms. You can also choose to clear all alarms reporting the same alarm condition (such as "lostFlow" or "mplsTunnelDown"). If an alarm is cleared but an associated event recurs, Crosswork Network Controller opens a new alarm. An alarm can be cleared by a user or by Crosswork Network Controller system. Cleared alarms are removed from the active alarms list.

Run the script alarm_clear.sh from the example directory.

cd cnc-fault-api-examples;./alarm_clear.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

alarm_clear() {
    # Assume the CNC JWT has already been obtained by running the get-cnc-jwt.sh script.
    # Read from jwt file and export it as AUTH_TOKEN_HDR
     export_jwt

      
    # STEP 1 : Add note to clear alarm for corresponding alarmid ( type can be system/network/device) from  CNC_API_INPUT
    # STEP 2 : store the output in CNC_API_OUTPUT file
      CNC_API_URL=$CNC_FAULT_API_CTX/clear
      CNC_API_INPUT="$PRJ/input/alarm-clear.json"
      CNC_API_OUTPUT="$PRJ/output/alarm-clear.json"
      http_put $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
    
}
alarm_clear