Fix #1543. Add check if server is running for more than a year.

This commit is contained in:
Romain Dessort 2016-05-10 17:28:09 -04:00
parent e59adc86f9
commit ec3713fbe3

View file

@ -65,6 +65,7 @@ IS_APACHEIPINALLOW=1
IS_MUNINAPACHECONF=1
IS_SAMBAPINPRIORITY=1
IS_KERNELUPTODATE=1
IS_UPTIME=1
IS_MUNINRUNNING=1
#Proper to OpenBSD
@ -389,6 +390,13 @@ if [ -e /etc/debian_version ]; then
echo 'IS_KERNELUPTODATE FAILED!'
fi
fi
# Check if the server is running for more than a year.
if [ "$IS_UPTIME" = 1 ]; then
if is_installed linux-image* && [ $(date -d "now - 1 year" +%s) -gt $(date -d "$(uptime -s)" +%s) ]; then
echo 'IS_UPTIME FAILED!'
fi
fi
# Check if munin-node running and RRD files are up to date.
if [ "$IS_MUNINRUNNING" ]; then