How To Enable Alerts In Automation Suite?

How to enable alerts in Automation Suite?

Description: It is very important for a server administrator to know the status of the servers are always and that’s why Automation Suite provides different ways to enable alerts for you to be up to date with the server status and in case of a critical alert you can address the issue with the Product support team to avoid downtime or similar.

Here are all the receivers that can be created for the alerts. In this approach, use email.


Resolution:

  1. Access Rancher, the structure of the URL is:
  • https://monitoring.domain.com
  1. The user is admin, get the password from the Linux terminal with a kubectl command:
  • kubectl get secrets/rancher-admin-password -n cattle-system \
-o "jsonpath={.data['password']}" | echo $(base64 -d)

  1. After getting the password, access the Rancher website and log in. After accessing, click Local.

  1. After that at the left is a panel with several options, look for monitoring.

  1. For the Alerts to work, create Routes and Receivers, so under monitoring search for Routes and Receivers.

Note: This option is always inside Monitoring but could be in a different place depending on your automation suite version.

  1. Once in Routes and Receivers, click on email and something like below will be obtained, click Add email.

  1. Get the following configuration screen:

  1. Add a name for the receiver, in the target, set up the recipient address (who gets the alerts when any), under SMTP, set up the sender address, this could be any address desired.

Recommendation: Check the enable send resolved alerts box

  1. As for the host is the SMTP server, here there is something you need to check carefully, and that is the port, if running the SMTP server over port 25 the SMTP server will be like this:
  • domain.com:25

  1. Add the port to the SMTP server domain
  2. When this is set click Create.

Note: The blue button at the end “add email” allows to add another recipient.

  1. Now is the time for the route, so click the Routes tab

  1. Once in Route, click on the Create button.

  1. Get a configuration screen like this one.

  1. Click on add match regex.

  • key=Severity | value=warning|critical

  1. This means that alerts will be obtained with a warning or critical value, it is also possible to set the info value but this will trigger a lot of alerts,

  1. When this configuration is done, always check this over the Linux terminal, so enable kubectl with the following command.
  • export KUBECONFIG="/etc/rancher/rke2/rke2.yaml" \ && export PATH="$PATH:/usr/local/bin:/var/lib/rancher/rke2/bin"

  1. When kubectl is enabled, the following command checks if the configuration is populated correctly. If you run the following command:
  • kubectl -n cattle-monitoring-system exec -it alertmanager-rancher-monitoring-alertmanager-0 -- cat /etc/alertmanager/config/alertmanager.yaml

  1. All the smtp configuration performed before in the monitoring tab on Rancher.

  1. If not looking for the configuration, run the following command:
  • kubectl -n cattle-monitoring-system rollout restart sts alertmanager-rancher-monitoring-alertmanager