uname -aDebian / Ubuntu
node_exporter -version*
Negative
Debian flavour operating systems have the capability to perform unattended upgrades. These are fairly reliable; enough so that fault tolerant systems can be upgraded automatically. However, in some cases the upgrades are such that they require a machine restart. In some cases, it may not be desirable to restart the system on an ad-hoc basis -- instead, to schedule the restart at a later date.
They express this need by writing a file to /var/run/reboot-required. This is picked up in /etc/update-motd.d/, were it's existence is checked.
This might not be within the scope of what the node exporter should be querying. Currently, I plan to write a cron job that polls this file, and writes whether it exists to the textfile dir. Alternatively, something like osquery and the exporter therein might be suitable.
Having a gauge metric for the existence of /var/run/reboot-required is a good idea. It's simple enough and doesn't require root. My only hesitation is this is very distribution specific. Do any other distributions use this pattern?
We could possibly support it, but have the feature disabled by default due to the distribution specific nature of it.
This has come up previously in various forms such as needing to do an apt-get upgrade. It's very distribution specific and we've previously said to use the textfile collector.
This specific one is much more appropriate as it's checking for file existence, rather than needing to execute or access a package database.
@andrewhowdencom Related, if you wanted to contribute a cleaned up version of https://github.com/prometheus/node_exporter/pull/496, I would appreciate it.
@SuperQ I had intended to do that with OSQuery and the relevant exporter: https://github.com/zwopir/osquery_exporter (not something I've gotten around to just yet). Still, doing it with bash seems like a trivial solution daily or something -- I'll take a look as I have time.
I am going to close this -- it seems reasonable to mark distro specific stuff out of bounds of the exporter. All else fails, i can always write "debian_exporter"
A debian_exporter helper script would be great to add to this repo in the textfile helper section. I recommend this because we typically don't want to have a scrape fork processes. Doing the updates via cron + textfile make things much safer.
Most helpful comment
A
debian_exporterhelper script would be great to add to this repo in the textfile helper section. I recommend this because we typically don't want to have a scrape fork processes. Doing the updates via cron + textfile make things much safer.