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:
- The alert manager and prometheus tools should run in the default namespace.
- The PCRF Templates.zip file can be downloaded from OHC. Unzip the package after downloading to get cnpcrfalertrule.yaml and mib files.
- 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. - 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. - 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. - 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. - 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. - Add cnpcrfAlertrules in
config map by executing the following command :
kubectl patch configmap _NAME_-server -n _Namespace_--type merge --patch "$(cat ~/cnpcrfAlertrules.yaml)"