Exporter Configuration Guide
18 min
introduction introduction this document provides a detailed guide on deploying and configuring the asternos exporter for visual monitoring target audience target audience 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 applicable hardware models applicable hardware models standard products standard products https //cloudswit ch/product/16x1g rj45 poe switch enterprise sonic/ 16x1g rj45 poe+\@150w 3 access switch, 2x10gb sfp+ uplinks, enterprise sonic distribution https //cloudswit ch/product/24 port 25g 2x100g core switch sonic nos/ 24 x 25gb sfp28/ 10gb sfp+, 2x 100gb qsfp28 uplinks, l3 core/leaf switch, marvell aldrin3 chip https //cloudswit ch/product/24x10gb 6x100gb switch enterprise sonic/ 24x10g sfp+ l3 leaf & core switch, 6 x 100g qsfp28 /40g qsfp+ uplinks, sonic nos, marvell prestera aldrin2 chip https //cloudswit ch/product/48x10gb sfp 6x100gb qsfp28 l3 leaf core switch enterprise sonic/ 48x 10gb sfp+, 6x 100gb qsfp28/40gb qsfp+ l3 leaf core switch, enterprise sonic, marvell prestera aldrin2 chip https //cloudswit ch/product/48 port 25g switch witch marvell octeon dpus/ 48 port 25gb sfp28 switch with 6x100g uplink, enterprise sonic, marvell falcon + octeon 10 cn103 https //cloudswit ch/product/48 port 25g aggregation switch sonic os/ 48x25gb sfp28, 8x100gb qsfp28 l3 core/spine switch, enterprise sonic ready, marvell falcon https //cloudswit ch/product/32 port 100g qsfp28 aggregation switch sonic/ 32x100gb qsfp28 spine and core switch enterprise sonic ready marvell falcon https //cloudswit ch/product/32x400g aggregation switch enterprise sonic/ 32 port 400 gbe qsfp dd l3 spine/core switch, enterprise sonic ready, marvell falcon environment deployment environment deployment 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 enabling exporter on the switch enabling exporter on the switch enable exporter on the switch requiring monitoring sonic# configure terminal sonic(config)# exporter enable 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 deploying prometheus on the server deploying prometheus on the server 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 edit daemon json to update docker sources vi /etc/docker/daemon json 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" ] } restart docker to load the updated sources systemctl daemon reload systemctl restart docker pull the prometheus image docker pull prom/prometheus 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"] notes the prometheus yml file has strict alignment requirements incorrect alignment may prevent the prom/prometheus docker container from starting properly specify the list of ip addresses for monitored devices in the targets section the exporter uses port 8101 additionally, prometheus provides other configurations and rules for detailed configuration templates and examples, please refer to the community https //prometheus io/docs/prometheus/latest/configuration/configuration/ 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 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 deploying grafana on a server deploying grafana on a server 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 edit daemon json to update the docker repository vi /etc/docker/daemon json 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" ] } restart docker to load the updated sources systemctl daemon reload systemctl restart docker pull the grafana image docker pull grafana/grafana oss 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 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 add a prometheus data source to grafana note the "scrape interval" in grafana must be configured to match the "scrape interval" parameter in prometheus grafana usage guide grafana usage guide 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 first, obtain the dashboard json file corresponding to your version from asterfusion personnel, then import it 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
