Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #!/bin/bash
  2. SERVERIP=192.168.2.3
  3. NOTIFYEMAIL=test@example.com
  4.  
  5. ping -c 3 $SERVERIP > /dev/null 2>&1
  6. if [ $? -ne 0 ]
  7. then
  8. # Use your favorite mailer here:
  9. mailx -s "Server $SERVERIP is down" -t "$NOTIFYEMAIL" < /dev/null
  10. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement