mirror of
https://git.dn42.dev/wiki/wiki
synced 2025-03-14 11:33:33 +00:00
munin scripts for logging amount of routes
This commit is contained in:
parent
0a3bb181ab
commit
e09cd9676b
31
Munin.md
Normal file
31
Munin.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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)
|
Loading…
x
Reference in New Issue
Block a user