We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

Finding and resolving the root cause can help in preventing the recurrence of such issues and avoid unplanned downtime.

There are several ways we can find out what triggered a reboot.

For CentOS/RHEL systems, youll find the logs at/var/log/messageswhile for Ubuntu/Debian systems, its logged at/var/log/syslog.

you could simply use thetailcommand or your favorite text editor to filter out or find specific data.

Always trace out events that give signs of warnings or errors which may lead to the system powering off/crashing.

Verify auditd Logs

For systems withauditd, it is a great place to check different events usingausearchtool.

Use the below command to check the last two entries from audit logs.

This will report the two most recent shutdowns or reboots.

If this reports aSYSTEM_SHUTDOWNfollowed by aSYSTEM_BOOT, everything should be good.

The above examples provide you a starting place to begin your troubleshooting.

Next, find out some of the light-weightsmonitoring software for Linux.