add check services
This commit is contained in:
parent
09a0439896
commit
2e4058b147
14
script/script/check_service.sh
Executable file
14
script/script/check_service.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user