How to check how many times RKE2 was restarted?
Issue description
How to check how many times RKE2 was restarted.
Resolution
systemctl show rke2-server -p NRestarts
- Purpose: This command shows the number of times the RKE2 server process has been restarted.
- systemctl show – Retrieves detailed properties of a systemd service.
- rke2-server – Refers to the RKE2 server service.
- -p NRestarts – Filters and displays only the NRestarts property, which indicates the total number of restarts for the service.
Output Example: NRestarts=3
journalctl -u rke2-server | grep -i fatal | wc -l
journalctl -u rke2-server – Displays logs specifically for the rke2-server service.
| grep -i fatal – Filters the logs to show lines containing the word "fatal" (case insensitive).
| wc -l – Counts the number of matching lines, providing a total of fatal errors found.
Output Example:
5
This means there are 5 fatal errors in the RKE2 server logs.