node-exporter-textfile-collector-scripts
node-exporter-textfile-collector-scripts copied to clipboard
Improve node_reboot_required metric
https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/blob/a2b43e19be1e64c31b626ca827506977cac93488/apt_info.py#L112C31-L112C51
in Ubuntu,, script https://git.launchpad.net/ubuntu/+source/update-notifier/tree/data/update-motd-reboot-required#n6 not only tests if file exist but also examines content of this file.
The difference is that with live kernel patching, file exist but remains empty. This does not trigger *** System restart required *** message.
So, checking for a non-zero file size (if the file exists) would be a suitable test?