跳转到内容
Ask AI

Exporter Configuration Guide

此内容尚不支持你的语言。

This document provides a detailed guide on deploying and configuring the AsterNOS Exporter for visual monitoring.

This manual is primarily intended for the following engineers:

  • Solution planners and implementers
  • Network administrators responsible for configuration and maintenance
  • Test personnel

Relevant personnel should possess the following competencies:

  • Familiarity with Asterfusion PacketBroker network switch products
  • Understanding of fundamental computer networking principles

CX102S-16GT Series

16x1G RJ45 PoE+@150W 3 Access Switch, 2x10Gb SFP+ Uplinks, Enterprise SONiC Distribution

CX202P-24Y Series

24 x 25Gb SFP28/ 10Gb SFP+, 2x 100Gb QSFP28 Uplinks, L3 Core/Leaf Switch, Marvell Aldrin3 Chip

CX206P-24S Series

24x10G SFP+ L3 Leaf & Core switch, 6 x 100G QSFP28 /40G QSFP+ Uplinks, SONiC NOS, Marvell Prestera Aldrin2 Chip

CX206P-48S Series

48x 10Gb SFP+, 6x 100Gb QSFP28/40Gb QSFP+ L3 Leaf Core Switch, Enterprise SONiC, Marvell Prestera Aldrin2 Chip

CX306P-48Y Series

48-port 25Gb SFP28 Switch with 6x100G Uplink, Enterprise SONiC, Marvell Falcon + OCTEON 10 CN103

CX308P-48Y Series

48x25Gb SFP28, 8x100Gb QSFP28 L3 Core/Spine Switch, Enterprise SONiC Ready, Marvell Falcon

CX532P-M-H

32x100Gb QSFP28 Spine and Core Switch Enterprise SONiC Ready Marvell Falcon

CX732Q-M-H

32-port 400 GbE QSFP-DD L3 Spine/Core Switch, Enterprise SONiC Ready, Marvell Falcon

To use AsterNOS Exporter’s visualization features for the first time, you must first enable the exporter feature on the switch to provide external APIs. Then install Prometheus on the monitoring server to collect data, with Grafana displaying the collected data.

  1. Enable Exporter on the switch requiring monitoring.
sonic# configure terminal
sonic(config)# exporter enable
  1. Save configuration
sonic(config)# exit
sonic# write
save running-config...
Existing files will be overwritten, continue? [y/N]: y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json

Prometheus Official Website:https://prometheus.io/docs/prometheus/latest/installation/

This section uses Rocky Linux 9.6 (Blue Onyx) running on a virtual machine as an example, with Docker components already pre-installed.

  1. Edit daemon.json to update Docker sources
vi /etc/docker/daemon.json
  1. Edit source information (optional). If the original source can pull the Prometheus image, there is no need to update the source.
{
"registry-mirrors": [
"https://w14ki3ju.mirror.aliyuncs.com",
"http://hub-mirror.c.163.com",
"https://registry.docker-cn.com",
"https://docker.m.daocloud.io"
]
}
  1. Restart Docker to load the updated sources.
systemctl daemon-reload
systemctl restart docker
  1. Pull the Prometheus image
docker pull prom/prometheus
  1. Create a Prometheus configuration file (to be mounted into the Docker container during creation) and edit and save it. 
vi prometheus.yml
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
scrape_configs:
- job_name: "exporter"
static_configs:
- targets: ["192.168.1.102:8101", "192.168.1.103:8101", "192.168.1.220:8101", "192.168.1.236:8101"]
  1. Create and run the prom/prometheus Docker container. Name the Docker container prometheus and run it on port 9090. Map the prometheus.yml file in the host’s current directory to /etc/prometheus/prometheus.yml within the Docker container.
docker run -d --name prometheus -p 9090:9090 -v ~/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
  1. Verify the deployment’s success by logging into the host machine’s IP address plus port 9090 via a browser to check the monitoring information status.

Grafana Official Website: https://grafana.com/docs/grafana/latest/setup-grafana/

This section uses Rocky Linux 9.6 (Blue Onyx) running on a virtual machine as an example, with Docker components already pre-installed.

  1. Edit daemon.json to update the Docker repository.
vi /etc/docker/daemon.json
  1. Edit source information (optional). If the original source can pull the Prometheus image, there is no need to update the source.
{
"registry-mirrors": [
"https://w14ki3ju.mirror.aliyuncs.com",
"http://hub-mirror.c.163.com",
"https://registry.docker-cn.com",
"https://docker.m.daocloud.io"
]
}
  1. Restart Docker to load the updated sources.
systemctl daemon-reload
systemctl restart docker
  1. Pull the Grafana image
docker pull grafana/grafana-oss
  1. Create and run a Docker container for grafana/grafana-oss:latest. Name the Docker container grafana and run it on port 3000.
docker run -d --name grafana -p 3000:3000 grafana/grafana-oss:latest
  1. Access the host machine via browser using its IP address plus port 3000. The initial username and password are admin/admin. After the first login, you can update the password.

  1. Add a Prometheus data source to Grafana

We recommend using the Dashboard templates provided by AsterNOS for visual monitoring.

The AsterNOS-Exporter_Dashboard_PB_Vxxx.json template serves as the base monitoring dashboard for tracking device status and related information.

Follow these steps:

  1. First, obtain the Dashboard JSON file corresponding to your version from Asterfusion personnel, then import it:

  1. View Template

3 Select the devices to monitor. At this point, all configuration is complete. You can now monitor the devices in real time via the visualization interface.