NSSF Alert Configuration

Follow the steps below for NSSFAlert configuration in Prometheus:

Note:

1. By default Namespace for OCNSSF is ocnssf that must be updated as per the deployment.

2. The OCNSSF-config-1.3.0.0.0.zip file can be downloaded from OHC. Unzip the OCNSSF-config-1.3.0.0.0.zip package after downloading to get NssfAlertrules-1.3.0.yamlfile.

Procedure

  1. Take a backup of current configuration map of Prometheus:

    kubectl get configmaps _NAME_-server -o yaml -n _Namespace_ > /tmp/ tempConfig.yaml

  2. Check and add OCNSSF Alert file name inside Prometheus configuration map:

    sed -i '/etc\/config\/alertsnrf/d' /tmp/tempConfig.yaml sed -i '/rule_files:/a\ \- /etc/config/alertsnrf' /tmp/tempConfig.yaml

  3. Update configuration map with updated file name of OCNSSF alert file:

    kubectl replace configmap _NAME_-server -f /tmp/tempConfig.yaml

  4. Add OCNSSF Alert rules in configuration map under file name of OCNSSF alert file:

    kubectl patch configmap _NAME_-server -n _Namespace_--type merge --patch "$(cat ~/NssfAlertrules.yaml)"

Note:

The Prometheus server takes an updated configuration map that is automatically reloaded after approximately 60 seconds. Refresh the Prometheus GUI to confirm that the OCNSSF Alerts have been reloaded.

OCNSSF Alert Config Details

Note:

By default the NameSpace is set to ocnssf. Must update it according to the requirement.

Sample

apiVersion: v1
data:
  alertsnssf: |
    groups:
    - name: OcnssfAlerts
      rules:
      - alert: ocnssfPolicyNotFoundWarn
        annotations:
          description: 'Policy Not Found Rate is above warning threshold i.e. 700 mps (current value is: {{ $value }})'
          summary: 'Policy Not Found Rate is above 70 Percent'
        expr: sum(rate(nsselection_policy_not_found_total[2m])) >= 700 < 850
        labels:
          severity: Warning
      - alert: ocnssfPolicyNotFoundMaj
        annotations:
          description: 'Policy Not Found Rate is above major threshold i.e. 850 mps (current value is: {{ $value }})'
          summary: 'Policy Not Found Rate is above 85 Percent'
        expr: sum(rate(nsselection_policy_not_found_total[2m])) >= 850 < 950
        labels:
          severity: Major
      - alert: ocnssfPolicyNotFoundCrit
        annotations:
          description: 'Policy Not Found Rate is above critical threshold i.e. 950 mps (current value is: {{ $value }})'
          summary: 'Policy Not Found Rate is above 95 Percent'
        expr: sum(rate(nsselection_policy_not_found_total[2m])) >= 950
        labels:
          severity: Critical
      - alert: ocnssfNrfDiscFailedWarn
        annotations:
          description: 'Rate of failed NRF discovery attempts is above warning threshold i.e. 500 mps (current value is {{ $value }})'
          summary: 'Failed NRF discovery Rate attempts is above 10 Percent'
        expr: sum(rate(nsselection_nrf_disc_failure_total[2m])) >= 100 < 300
        labels:
          severity: Warning
      - alert: ocnssfNrfDiscFailedMaj
        annotations:
          description: 'Rate of failed NRF discovery attempts is above major threshold i.e. 700 mps (current value is {{ $value }})'
          summary: 'Failed NRF discovery Rate attempts is above 30 Percent'
        expr: sum(rate(nsselection_nrf_disc_failure_total[2m])) >= 300 < 500
        labels:
          severity: Major
      - alert: ocnssfNrfDiscFailedCrit
        annotations:
          description: 'Rate of failed NRF discovery attempts is above critical threshold i.e. 900 mps (current value is {{ $value }})'
          summary: 'Failed NRF discovery Rate attempts is above 50 Percent'
        expr: sum(rate(nsselection_nrf_disc_failure_total[2m])) >= 500
        labels:
          severity: Critical