Guest User

Untitled

a guest
May 20th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 KB | None | 0 0
  1. #!/bin/bash
  2. host=$(basename $0|awk -F_ '{print $2}')
  3. #result= $(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51)
  4. #echo $result
  5. #pinga=$(echo $result|tail -2|head -1|cut -d'"' -f2)
  6. pinga=$(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51|tail -2|head -1|cut -d'"' -f2)
  7. pingl=$(snmpwalk -v 2c $host -c $community .1.3.6.1.4.1.2021.51|tail -3|head -1|cut -d'"' -f2)
  8.  
  9. #title= $( test -z $title || "ping to baidu1")
  10. printf "host_name $host\n"
  11. printf "graph_title $title\n";
  12. echo "graph_args --base 1000 -l 0\n"
  13. echo "graph_vlable respones time(+)ms /lost Percent(-) %\n"
  14. echo "graph_info this graph show the ping respones time and package lost percent\n"
  15. echo "graph_category $category\n"
  16. echo "pinga.value $pinga\n"
  17. echo "pingl.value $pingl\n"
  18.  
  19. echo "pinga.draw AREA\n"
  20. echo "pingl.draw AREA\n"
  21. echo "pinga.type GAUGE\n"
  22. echo "pingl.type GAUGE\n"
  23.  
  24. echo "pinga.lable pingtime\n"
  25. echo "pingl.lable lostper\n"
  26. printf "pinga.graph yes\n"
  27. printf "pinga.negative pingl\n"
Add Comment
Please, Sign In to add comment