Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # shyam jos
- # Icinga plugin to check if server was rebooted less than 30 minutes ago
- read -d. uptime < /proc/uptime
- days=$(( uptime/60/60/24 ))
- if (( uptime > 1800 ))
- then
- echo -n "OK! UP $days days | uptime_days=$days"
- exit 0
- else
- echo "Critical: Reboot Detected! - Server Rebooted Less than 30 minutes ago! | uptime_days=$days"
- exit 2
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement