From df7c3dec6ce38347f7ba5e9b5ee3a739554d93df Mon Sep 17 00:00:00 2001 From: spleen Date: Sun, 13 Feb 2011 02:07:13 +0100 Subject: [PATCH] Initial version --- plugins/other/quagga_routes | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 plugins/other/quagga_routes diff --git a/plugins/other/quagga_routes b/plugins/other/quagga_routes new file mode 100755 index 00000000..75e36a83 --- /dev/null +++ b/plugins/other/quagga_routes @@ -0,0 +1,31 @@ +#!/bin/sh +# Created by spleen on 13.02.11. +# +# put into plugin-conf.d/plugins.conf +# [quagga_routes] +# user root +# + +if [ "$1" = "config" ]; then + echo 'graph_title quagga routes' + echo 'graph_args -l 0' + echo 'graph_vlabel routes' + echo 'graph_category System' + echo 'graph_scale no' + /usr/local/bin/vtysh -e "sh ip ro sum" | awk ' + /connected/ {print $1 ".label " $1 "\n" $1 ".draw AREASTACK"} + /static/ {print $1 ".label " $1 "\n" $1 ".draw AREASTACK"} + /ebgp/ {print $1 ".label " $1 "\n" $1 ".draw AREASTACK"} + /ibgp/ {print $1 ".label " $1 "\n" $1 ".draw AREASTACK"} + /Totals/ {print $1 ".label " $1 "\n" $1 ".draw LINE1"} + ' + exit 0 +fi + +/usr/local/bin/vtysh -e "sh ip ro sum" | awk ' +/connected/ {print $1 ".value "$2} +/static/ {print $1 ".value "$2} +/ebgp/ {print $1 ".value "$2} +/ibgp/ {print $1 ".value "$2} +/Totals/ {print $1 ".value "$2} +'