add check services

This commit is contained in:
vincent 2019-01-12 14:36:49 +01:00
parent 09a0439896
commit 2e4058b147

14
script/script/check_service.sh Executable file
View File

@ -0,0 +1,14 @@
SERVICES=("mariadb" "nginx" "php-fpm" "gitea" "tt-rss" "named" "autofs" "rsyncd")
HOST=$(hostname)
echo "device $HOST have reboot curent status of critic service:"
for service in ${SERVICES[@]}
do
status=$(systemctl is-active $service)
echo "$service is $status"
if [ $status = "inactive" ]
then
echo $(journalctl -u $service --lines=10 )
fi
done