PCRF Alert Configuration

This section describes the Measurement based Alert rules configuration for CNPCRF. The Alert Manager uses the Prometheus measurements values as reported by microservices in conditions under alert rules to trigger alerts.

PCRF Alert Configuration

To configure cnPCRF alerts in Prometheus:

Note:

  1. The alert manager and prometheus tools should run in the default namespace.
  2. The PCRF Templates.zip file can be downloaded from OHC. Unzip the package after downloading to get cnpcrfalertrule.yaml and mib files.
  1. Find the config map to configure alerts in prometheus server by executing the following command:
    kubectl get configmap -n Namespace
    where, Namespace is the namespace used in helm install command.
  2. Take Backup of current config map of prometheus server by executing the following command:
    kubectl get configmaps NAME -o yaml -n Namespace  /tmp/t_mapConfig.yaml
    where, Name is the release name used in helm install command.
  3. Delete the entry alertscnpcrf under rule_files, if present, in the Alert Manager config map by executing the following command:
    sed -i '/etc\/config\/alertscnpcrf/d' /tmp/t_mapConfig.yaml
    

    Note:

    This command should be executed only once.
  4. Add entry alertscnpcrf under rule_files in the prometheus server config map by executing the following command:
    sed -i '/rule_files:/a\    \- /etc/config/alertscnpcrf'  /tmp/t_mapConfig.yaml

    Note:

    This command should be executed only once.
  5. Reload the modified config map by executing the following command:
    kubectl replace configmap <_NAME_> -f /tmp/t_mapConfig.yaml

    Note:

    This step is not required for AlertRules.
  6. Add cnpcrfAlertrules in config map by executing the following command :
    kubectl patch configmap _NAME_-server -n _Namespace_--type merge --patch
    "$(cat ~/cnpcrfAlertrules.yaml)"