Exporting Systemd service status with node exporter

One9twO
Mar 16, 2022

--

Depending on which version of node exporter you are using, one of the following options will work.

Node exporter version go1.14.4

/usr/local/bin/node_exporter \
--collector.systemd \
--collector.system.unit-whitelist=(graylog-server|mongod|elasticsearch).service

Node exporter version go1.15.8

Since the option “collector.system.unit-whitelist” was deprecated, the syntax has changed to “collector.systemd.unit-include”.

Note that there might be a bug in this version such that it won’t work if you put an equal (=) sign before the value:

/usr/local/bin/node_exporter \
--collector.systemd \
--collector.systemd.unit-include "(graylog-server|mongod|elasticsearch).service"

--

--