Alarm Configuration and Settings
Scenario Overview
This guide explains how to configure and customize alarm and event settings in the Crosswork Network Controller. These configurations allow network administrators to monitor devices effectively, receive timely alerts, and tailor notifications to specific operational requirements. You can customize alarm notification destinations, device notifications, and adjust gNMI settings, among other available options.
Prerequisites
Before running these examples, ensure:
- You have obtained an access token. Refer to the 'Getting Started' section for instructions.
- The 'cnc-api-common.sh' script is properly configured.
- Necessary input/output directories exist for storing and retrieving configuration files.
Update and Retrieve Alarm and gNMI Settings
Update and retrieve alarm settings for cleanup options, device notification processing, and gNMI settings.
Run the alarm_manager.sh
script from the example directory.
cd cnc-fault-api-examples;./alarm_settings.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
alarm_settings() {
# 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 : Update alarm settings for cleanup options and device notification processing from CNC_API_INPUT
# STEP 2 : Store the server's response in the CNC_API_OUTPUT file.
CNC_API_URL=$CNC_FAULT_API_CTX/settings
CNC_API_INPUT="$PRJ/input/alarm_settings.json"
CNC_API_OUTPUT="$PRJ/output/alarm_settings.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
# STEP 3 : Retrieve alarm settings for cleanup options and device notification processing
CNC_API_URL=$CNC_FAULT_API_CTX/settings
CNC_API_OUTPUT="$PRJ/output/alarm_settings.json"
http_get $CNC_API_URL $CNC_API_OUTPUT
# STEP 4 : Update GNMI settings from CNC_API_INPUT
# STEP 5 : Store the response in CNC_API_OUTPUT file
CNC_API_URL=$CNC_FAULT_API_CTX/gnmi/settings
CNC_API_INPUT="$PRJ/input/alarm_gnmi_settings.json"
CNC_API_OUTPUT="$PRJ/output/alarm_gnmi_settings.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
}
alarm_settings
Device Alarm Manager
Crosswork Network Controller lets you customize the set of Cisco devices from which you want to receive alerts.
Run the script alarm_manager.sh from the example directory.
cd cnc-fault-api-examples;./alarm_manager.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
alarm_manager() {
# 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 alarm manager to output in CNC_API_OUTPUT file
CNC_API_URL=$CNC_FAULT_API_CTX/manager/settings
CNC_API_INPUT="$PRJ/input/alarm_manager.json"
CNC_API_OUTPUT="$PRJ/output/alarm_manager.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
}
alarm_manager
Alarm Severity and Auto Clear Settings
Crosswork allows you to customize whether an alarm can be automatically cleared and how many minutes to wait before doing so. You can also customize the Crosswork alarm database to assign your chosen severity levels to specific alarms.
Run the script alarm_severity_autoclear_settings.sh from the example directory.
cd cnc-fault-api-examples;./alarm_severity_autoclear.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
alarm_severity_autoclear() {
# 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 event type severity from CNC_API_INPUT
# STEP 2 : store the output in CNC_API_OUTPUT file
CNC_API_URL=$CNC_FAULT_API_CTX/autoclear
CNC_API_INPUT="$PRJ/input/alarm_severity_settings.json"
CNC_API_OUTPUT="$PRJ/output/alarm_severity_settings.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
# STEP 4 : Update auto clear value from CNC_API_INPUT
# STEP 5 : store the output in CNC_API_OUTPUT file
CNC_API_URL=$CNC_FAULT_API_CTX/autoclear
CNC_API_INPUT="$PRJ/input/alarm_autoclear_settings.json"
CNC_API_OUTPUT="$PRJ/output/alarm_autoclear_settings.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
# STEP 6 : Update recommended for event type from CNC_API_INPUT
# STEP 7 : store the output in CNC_API_OUTPUT file
CNC_API_URL=$CNC_FAULT_API_CTX/recommended-action
CNC_API_INPUT="$PRJ/input/alarm_recommondedaction_settings.json"
CNC_API_OUTPUT="$PRJ/output/alarm_recommondedaction_settings.json"
http_post $CNC_API_URL @$CNC_API_INPUT $CNC_API_OUTPUT
# STEP 8 : Retrieve alarm severity and auto clear
CNC_API_URL=$CNC_FAULT_API_CTX/autoclear
CNC_API_OUTPUT="$PRJ/output/alarm_autoclear.json"
http_get $CNC_API_URL $CNC_API_OUTPUT
}
alarm_severity_autoclear