1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 10:28:36 +00:00

Initial version

This commit is contained in:
spleen 2011-01-13 23:29:51 +01:00 committed by Steve Schnepp
parent 6d6805f0cb
commit a80edcab85

39
plugins/other/bgpd Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
# bgpd.sh
#
#
# Created by spleen.
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title bgp pfxs'
echo 'graph_args -l 0'
echo 'graph_vlabel PfxRcvd'
echo 'graph_category System'
echo 'graph_scale no'
echo 'graph_info show ip bgp summary'
mfs=0
/usr/local/bin/vtysh -c "sh ip bgp su" | /usr/bin/awk '{ if (( $2 == "4" ) || ( $2 == "6")) print $1 }' | while read i; do
case $i in
*) name=`echo $i | /usr/bin/awk '{ gsub("[^a-zA-Z0-9_]", root_, $1); print $1 }'` ;;
esac
dn=`echo $i | sed 's/_/ /g'`
echo "$name.label $dn"
done
exit 0
fi
/usr/local/bin/vtysh -c "sh ip bgp su" | /usr/bin/awk '{ if (( $2 == "4" ) || ( $2 == "6")) print $1,$10 }' | while read i; do
case $i in
*) name=`echo $i | /usr/bin/awk '{ gsub("[^a-zA-Z0-9_]", root_, $1); print $1 }'` ;;
esac
dn=`echo $i | awk '{print $2}'`
echo "$name.value $dn"
done