Slackware HowTo

Monitor services with Bash scripts and cron

Periodic checks without external tools.

1. Script

Basic example:

pgrep sshd >/dev/null || echo 'sshd down'

2. Cron

Schedule the script every 5 minutes.

3. Logs

Redirect output to /var/log.

4. Verify

Test the script manually.

Quick checklist

[ ] Steps completed
[ ] Config updated
[ ] Service tested
[ ] Restart/rollback ready
[ ] Logs checked

Back to Linux HowTo