Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- host=$(basename $0|awk -F_ '{print $2}')
- #result= $(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51)
- #echo $result
- #pinga=$(echo $result|tail -2|head -1|cut -d'"' -f2)
- pinga=$(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51|tail -2|head -1|cut -d'"' -f2)
- pingl=$(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51|tail -3|head -1|cut -d'"' -f2)
- #title= $( test -z $title || "ping to baidu1")
- printf "host_name $host\n"
- printf "graph_title $title\n";
- echo "graph_args --base 1000 -l 0\n"
- echo "graph_vlable respones time(+)ms /lost Percent(-) %\n"
- echo "graph_info this graph show the ping respones time and package lost percent\n"
- echo "graph_category $category\n"
- echo "pinga.value $pinga\n"
- echo "pingl.value $pingl\n"
- echo "pinga.draw AREA\n"
- echo "pingl.draw AREA\n"
- echo "pinga.type GAUGE\n"
- echo "pingl.type GAUGE\n"
- echo "pinga.lable pingtime\n"
- echo "pingl.lable lostper\n"
- printf "pinga.graph yes\n"
- printf "pinga.negative pingl\n"
Add Comment
Please, Sign In to add comment