Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 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.  
  16.  
  17. ng -c 3 $IP2
  18. if [[ $? != 0 ]]; then
  19. IPRES2=ok
  20.  
  21. ping -c 3 $IP3
  22. if [[ $? != 0 ]]; then
  23. IPRES3=ok
  24.  
  25. if $IPRES1=good & $IPRES2=good & $IPRES3=good
  26. then
  27. MSG=All is OK
  28. else
  29. COLOR=red
  30. MSG=Tunnel is down
  31.  
  32. fi
  33.  
  34. # Tell Xymon about it
  35. $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
  36.  
  37. ${MSG}
  38. "
  39.  
  40. exit 0
Add Comment
Please, Sign In to add comment