Skip to main content

Prometheus Monitoring SONiC-based PoE Switches and Sending Alerts to Slack

written by Asterfuison

March 7, 2024

Prometheus is an open source system monitoring and alerting toolkit. Since its launch in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community.

For more detail about Prometheus, please read : https://cloudswit.ch/blogs/critical-information-you-should-know-about-open-source-network-monitoring-tools-and-prometheus/

About Asterfusion SONiC-based Campus Switches (with optional PoE switch)

The Asterfusion family of SONiC switches for campus networks (CX-M series) is equipped with AsterNOS, an enterprise-ready SONiC with rich L2/L3 functionality and many other improvements in network virtualization and management. Asterfusion’s SONiC-based switches for campus networks now have a wide range of models from 1G to 100G, and each access-class switch is available in an optional PoE model.

Based on its rich functionality and high compatibility across multiple ASICs, we can build scalable, highly reliable campus access networks that are simpler and easier to configure and manage.

Today, we will configure a network monitoring system using the Asterfusion CX-M Series, Prometheus, and the Grafana panel for visualization. Thanks to the containerized architecture of AsterNOS, all monitoring-related software can be run on the CX-M switch and installed smoothly as a docker, and no extra server is required.

Monitoring Workflow Overview

Monitoring Workflow Overview

Configuration Steps

Enable SNMP on CX-M

Configurations of snmp exporter

  1. Generate snmp.yml file according to MIB file through generator program
  • Install generator
  • Upload MIB file to /root/go/src/github.com/prometheus/snmp_exporter/generator/mibs
  • Configure generator.yml
  • Generate snmp.yml
  1. Install snmp exporter in docker
  1. Visit snmp exporter via web browser

Configurations of Prometheus

  1. Install Prometheus in docker
  1. Edit configuration file

Configurations of Grafana

  1. Install grafana in docker (10.230.1.11)
  1. Configure dashboard

Access to 10.230.1.11:3000 requires a password the first time. Once you log in and go to dashboard, you can create the panel. If you have already created a json file with the required display information, you can import that file directly into it (as we did).

Configurations of Alertmanager

  1. Install and configure alertmanager in docker
  1. Integrate to Slack
  • Create a separate Slack Channel for monitoring infomations
  • Add an application( incomming webhooks) into the Monitoring channel
  • Verify your webhook URL: copy the url and send test data using postman

3. Configure AlertManager

4. Set alerting rules

5. Configure Prometheus: Add alertmanager and rule_files to Prometheus.yml

Result: We can receive alert information in this Slack channel along with a notification email.

Latest Posts