Check needs-restarting
Overview
Checks for processes that started running before they or some component that they use were updated. Returns WARN if a full reboot is required or if services might need a restart, and in any other case OK. May take more than 10 seconds on Red Hat to execute.
Hints:
- Linux only 
- needs-restarting3runs on Red Hat- and Debian-based OS’s
- needs-restarting2runs on Red Hat-based OS’s only
Fact Sheet
| Fact | Value | 
|---|---|
| Check Plugin Download | https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/needs-restarting | 
| Check Interval Recommendation | Once a day (or after a system update only) | 
| Can be called without parameters | Yes | 
| Compiled for Windows | No | 
| Requirements | RHEL:  | 
Help
usage: needs-restarting [-h] [-V]
Checks for processes that started running before they or some component that
they use were updated. Returns WARN if a full reboot is required or if
services might need a restart, and in any other case OK. Should be called once
a day or after applying updates only.
options:
  -h, --help     show this help message and exit
  -V, --version  show program's version number and exit
Usage Examples
./needs-restarting
Output on Red Hat:
Found 17 running processes that have been updated and may need a restart:
1595 : /usr/lib/systemd/systemd-udevd
1483 : sshd: root@pts/1
1223 : qmgr -l -t unix -u
1222 : pickup -l -t unix -u
...
Output on Debian:
A system reboot may be required. Running Kernel 4.19.0-20-amd64 != Installed Kernel 5.10.0-13-amd64 (version upgrade pending). Found 3 running processes that have been updated and may need a restart:
* dbus.service
* getty@tty1.service
* systemd-logind.service
States
- WARN on needed service or system restarts. 
- Does not alert on other problems like - Modular dependency problem(yum/dnf) etc.
Perfdata / Metrics
There is no perfdata.
Credits, License
- Authors: Linuxfabrik GmbH, Zurich 
- License: The Unlicense, see LICENSE file.