howto/Munin

  • Search
  • Home
  • All
  • Files
  • History
  • Latest Changes
  • Home

    • Getting Started
    • Registry Authentication
    • Address Space
    • BGP communities
    • FAQ
  • How-To

    • Wireguard
    • Openvpn
    • IPsec With Public Keys
    • Tinc
    • GRE on FreeBSD
    • GRE on OpenBSD
    • IPv6 Multicast (PIM-SM)
    • SSM Multicast
    • MPLS
    • Bird2
    • FRRouting
    • OpenBGPD
    • Mikrotik RouterOS
    • EdgeRouter
    • Static routes on Windows
    • Universal Network Requirements
    • VyOS
    • NixOS
  • Services

    • IRC
    • Whois registry
    • DNS
    • IX Collection
    • Public DNS
    • Looking Glasses
    • Automatic Peering
    • Repository Mirrors
    • Distributed Wiki
    • Certificate Authority
    • Route Collector
    • Registry
  • Internal

    • Internal services
    • Interconnections
    • APIs
    • Show and Tell
    • Historical services
  • Historical

    • Bird 1
    • Quagga
  • External Tools

    • Paste Board
    • Git Repositories

dn42

Number of routes by AS

IPv4:

#!/bin/bash
if [ "$1" = "config" ];then
	echo graph_title Number of routes
	echo graph_vlabel num. routes
	echo graph_category network
	echo graph_scale no
	for AS in $(ip r|sed 's/.* dev //;s/ .*//'|sort|uniq -c|grep as|awk '{print $2}');do
		echo $AS.label $AS
	done
else
	ip r|sed 's/.* dev //;s/ .*//'|sort|uniq -c|grep as|awk '{print $2".value "$1}'
fi

IPv6:

#!/bin/bash
if [ "$1" = "config" ];then
	echo graph_title Number of routes
	echo graph_vlabel num. routes
	echo graph_category network
	echo graph_scale no
	for AS in $(ip -6 r|sed 's/.* dev //;s/ .*//'|sort|uniq -c|grep as|awk '{print $2}');do
		echo $AS.label $AS
	done
else
	ip -6 r|sed 's/.* dev //;s/ .*//'|sort|uniq -c|grep as|awk '{print $2".value "$1}'
fi
(hint: The difference just the -6 on the ip command)

Graph routes and activity for every neighbour

This munin-plugin makes it very easy to graph the announced routes and activity for each neighbour over time:
https://github.com/luben/bird-multigraph-plugin

It's also possible to get notified by Munin when a problem with the peering persists. You have to define a critical value in line 138:

imported.critical 1:
This will send execute the command (set in munin-node.conf) to alert you, if the imported route count falls under 1.

You might also want to change line 125 from

graph_title $proto->{title} routes
to
graph_title $name routes

Example installation: http://stats.tbspace.de/munin-cgi/munin-cgi-graph/tbspace.de/server.tbspace.de/dn42_crest_routes-day.png

Hosted by: BURBLE-MNT, GRMML-MNT, XUU-MNT, JAN-MNT, LARE-MNT, SARU-MNT, ANDROW-MNT, MARK22K-MNT | Accessible via: dn42, dn42.dev, dn42.eu, wiki.dn42.us, dn42.de (IPv6-only), dn42.cc (wiki-ng), dn42.wiki, dn42.pp.ua, dn42.obl.ong

Last edited by lare, 2023-04-08 21:53:12