sergio_educacionit

hostmonitor

Jun 4th, 2022 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. source /etc/hostmonitor.conf
  5.  
  6.  
  7. while :;do
  8.  
  9.  
  10.         if ping -c 1 $host > /dev/null 2>&1; then
  11.  
  12.                 echo "El host $host esta caido" | mail -s "Estado de $hosts" $usermonitor
  13.  
  14.         fi
  15.  
  16.         sleep $interval
  17.        
  18.  
  19. done
  20.  
Add Comment
Please, Sign In to add comment