Guest User

Untitled

a guest
Feb 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. COLUMN=VPN # Name of the column
  4. COLOR=green # By default, everything is OK
  5. MSG="Customer Tunnel Status"
  6.  
  7. IP1=127.0.0.1
  8. IP2=127.0.0.1
  9. IP3=127.0.0.1
  10.  
  11.  
  12. ping -c 3 $IP1
  13. if [[ $? != 0 ]]; then
  14. IPRES1="ok"
  15. fi
  16.  
  17. pinng -c 3 $IP2
  18. if [[ $? != 0 ]]; then
  19. IPRES2="ok"
  20. fi
  21.  
  22. ping -c 3 $IP3
  23. if [[ $? != 0 ]]; then
  24. IPRES3="ok"
  25. fi
  26.  
  27. if $IPRES1="ok" & $IPRES2="ok" & $IPRES3="ok"
  28. then
  29. MSG=All is OK
  30. else
  31. COLOR=red
  32. MSG=Tunnel is down
  33. fi
  34.  
  35. # Tell Xymon about it
  36. $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
  37.  
  38. ${MSG}
  39. "
  40.  
  41. exit 0
Add Comment
Please, Sign In to add comment