![]() ![]() Prometheus identifies the issue when the memory usage reaches 60% and will be ready to send an alert to the Alert Manager. To visually analyze the metrics of the server, we use a Grafana dashboard. This will increase the memory usage up to 90% and we get an alert that the usage reaches 60%. Summary: "High CPU usage on ' < /proc/meminfo)k -vm-keep -m 10 Rule 1: Create a rule to get an alert when the CPU usage goes more than 60%. Let’s create a couple of alert rules in separate rule YAML files and validate them by simulating thresholds. We can create multiple rules in YAML files as per the alert requirements. Based on the rules, Prometheus will identify the situations and send an alert to the Alert Manager. ![]() Prometheus rules are essential to trigger the alerts. Sudo systemctl status rvice Step 6: Create Prometheus Rules Once the configuration part is done, restart the Alert Manager service and ensure everything is working fine by checking the status of the service. Modify the - channel with the slack channel name in slack_configs section. auth_username as SMTP user name and auth_password as SMTP password. In the receivers section, modify the to address and from address, and provide the SMTP endpoint and port number in smarthost section. In the global section, provide the Slack webhook that you have created already. Inside the configuration file, you should add the Slack and SES information to get the notifications as highlighted below in bold. sudo vim /etc/alertmanager/alertmanager.yml Open the Alert Manager configuration file. Step 5: Configure Alert Manager With SMTP and Slack APIĪll the configurations for the Alert manager should be part of the alertmanager.yml file. The output user interface you will get is this. Instead of, provide your instance public IP with the default Alert Manager port number, which is 9093. Sudo chown alertmanager:alertmanager /etc/alertmanager/alertmanager.yml Step 2: Setup Alert Manager Systemd ServiceĬreate a service file in /etc/systemd/system and the file name is rvice. Sudo cp alertmanager.yml /etc/alertmanager/alertmanager.yml Sudo chown alertmanager:alertmanager /usr/bin/amtool Sudo chown alertmanager:alertmanager /usr/bin/alertmanager As well as copy the configuration file alertmanager.yml to the /etc directory and change the owner and group name to alertmanager. tar -xvf alertmanager-0.26.0.Ĭopy the alertmanager and amtol files in the /usr/bin directory and change the group and owner to alertmanager. Unzip the Alert Manager binaries file and enter it into the directory. Sudo chown alertmanager:alertmanager /var/lib/alertmanager Udo chown alertmanager:alertmanager /etc/alertmanager sudo mkdir -p /etc/alertmanager/templates Sudo useradd -g alertmanager -no-create-home -shell /bin/false alertmanagerĬreating directories is /etc and /var/lib to store the configuration and library files and change the ownership of the directory only for the specific user. wget Ĭreate a user and group for the Alert Manager to allow permission only for the specific user. here we use the latest version, which is v0.26.0. Step 1: Download Prometheus Alert Managerĭownload a suitable Alert Manager binaries, which is suitable for your server. In this guide, we will only look at the Alert Manager setup and its configurations related to email and Slack alerting. The second server ( server-02), contains the Node Exporter utility.īefore starting the alert manager setup, ensure you have Prometheus and Grafana configured on the server. Server-01, ie the monitoring server contains Prometheus, Alert Manager, and Grafana utilities. You need two Ubuntu servers for this setup. ![]() In this comprehensive guide, I have converted detailed steps to set up Prometheus Alert Manager and configure email and Slack alerts. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |