Skip to content

Instantly share code, notes, and snippets.

@codec
Created January 22, 2011 19:39
Show Gist options
  • Select an option

  • Save codec/791382 to your computer and use it in GitHub Desktop.

Select an option

Save codec/791382 to your computer and use it in GitHub Desktop.
munin plugin to show Quagga BGP prefix by IPv4 / IPv6
#!/bin/sh
#
# munin plugin to show Quagga BGP prefix by IPv4 / IPv6
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Quagga BGP4 prefixes'
echo 'graph_args --base 1000 -l 0'
echo 'graph_scale yes'
echo 'graph_vlabel Received routes via BGP4'
echo 'graph_category Network'
echo 'prfxv4.label IPv4 prefixes'
echo 'prfxv6.label IPv6 prefixes'
echo 'graph_info Route information provided by vtysh (quagga)'
exit 0
fi
datav4=($(vtysh -c "show ip bgp"|grep Total|cut -d" " -f5))
datav6=($(vtysh -c "show ipv6 bgp"|grep Total|cut -d" " -f5))
echo prfxv4.value $datav4
echo prfxv6.value $datav6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment