Skip to content

In this article, we will present the integration of Prometheus with FreeRouter, with a topology of 2 routers being monitored by prometheus.

Notifications You must be signed in to change notification settings

rare-freertr/freeRtr-prometheus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FreeRouter-Prometheus

Overview FreeRouter

freeRouter is a free, open source router os process. it speaks routing protocols, and (re)encapsulates packets on interfaces.

Requirements

To run this experiment, it is necessary to use a Debian-based Linux operating system.

Update's dashboards

All 26 of Grafana's freeRtr dashboard's have been updated and improved. One of the main differences is that we now have the router name.

Sensor example universal:

  • You can use this universal sensor (copy and paste).
sensor ifaces-sw
path interfaces-sw/interface/counter
prefix freertr-ifaces
key name interfaces-sw/interface
command sho inter swsumm
prepend iface_sw_byte_
name 0 ifc=
replace \. _
column 1 name st
column 1 replace admin -1
column 1 replace down 0
column 1 replace up 1
column 2 name tx
column 3 name rx
column 4 name dr
.
exit

freeRtr agent prometheus configuration

server prometheus pr
 sensor ifaces-hw
 sensor ifaces-sw
 vrf <PROMETHEUS_VRF>
 exit

Configure Prometheus Server file

global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 30s
alerting:
  alertmanagers:
  - static_configs:
    - targets: []
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: router
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - <prometheus_agent_ip_1>:9001
    labels:
      node_name: <prometheus_agent_1_node_name>
  - targets:
    - <prometheus_agent_ip_2>:9001
    labels:
      node_name: <prometheus_agent_2_node_name>

Configuration and Install FreeRouter

To work the FreeRtr just have java.

Consult the freerouter documentation for installing java:

Install the latest and greatest Java Runtime Environment (JRE).

$ sudo apt-get install --no-install-recommends --no-install-suggests --yes default-jre-headless

Download the freeRouter jar binary.

$ wget http://www.freertr.org/rtr.jar

Experiment Topology

Topology

Topology Configuration

Dependencies and technologies

Badge Badge Badge

Install Docker and docker-compose

$ sudo apt install docker.io 
$ sudo apt install docker-compose 

Prometheus Configuration

Docker Compose file

Start Deploy

$ git clone https://github.com/Tetzdesen/FreeRouter-Prometheus.git
$ cd FreeRouter-Prometheus

Move directory prometheus for /etc

$ sudo mv prometheus /etc
  • Check the IP from your interface
$ ifconfig
  • Change the IP in the prometheus.yml file with your preferred text editor
$ sudo nano /etc/prometheus/prometheus.yml

Start Docker Container's

$ cd docker
$ sudo docker-compose up -d

Check Container's

$ sudo docker ps

Run Configuration Router's

Start Router's Configuration

  • R1
$ java -jar <path>/rtr.jar routersc topology/r1/r1-hw.txt topology/r1/r1-sw.txt 
  • R2
$ java -jar <path>/rtr.jar routersc topology/r2//r2-hw.txt topology/r2/r2-sw.txt 

Grafana Configuration

  • User: admin

  • Password: freerouter

  • Once installed configure Prometheus as Grafana data source.

Img-Grafana-01

  • Fill in all the prometheus server information.
Img-Grafana-02

  • Check the the data source is defined correctly by clicking the "Save & test" button.
Img-Grafana-03

Verification

Verification Prometheus

Img-Grafana-04

Verification Grafana

  • Download freeRouter interface bytes dashboard here.
Img-Grafana-05

Img-Grafana-06

  • Dashboard Verify

  • R1

Img-Grafana-07

  • R2
Img-Grafana-07

Integration AlertManager

Integration Alerts Grafana

Dataplane Monitoring

About

In this article, we will present the integration of Prometheus with FreeRouter, with a topology of 2 routers being monitored by prometheus.

Resources

Stars

Watchers

Forks

Packages

No packages published