Cheat Sheets

Systemd - No failed services

Description

Ensure there are no failed services or units in maintenance

Check Script: systemd-no-failed.sh

#!/bin/bash

output=$(systemctl list-units 2>/dev/null) if [ "$output" != "" ]; then failed=$(/bin/echo "$output" | egrep " loaded (maintenance|failed) " | cut -d " " -f2) if [ "$failed" != "" ]; then result_warning "There are failed services: " $failed else result_ok fi fi
Comment on Disqus