node_exporter --version not an easy way to grep the version for further autom. processing

98 views
Skip to first unread message

jobenvil

unread,
Nov 5, 2021, 4:09:07 AM11/5/21
to Prometheus Users

node_exporter --version output is not possible either to grep nor to pipe to a file.

Usecase: run automatical node_exporter update depending on the outputed version and the latest GitHub release.

Is there an insider way to retrieve the node_exporter version like just 1.1.2?


output of node_exporter --version

node_exporter, version 1.1.2 (branch: HEAD, revision: b597c1244d7bef49e6f3359c87a56dd7707f6719) build user: root@f07de8ca602a build date: 20210305-09:29:10 go version: go1.15.8 platform: linux/amd64



jobenvil

unread,
Nov 5, 2021, 5:01:08 AM11/5/21
to Prometheus Users
OK, the trick is to pipe output instead of to error, to the terminal. A colleague of me, expert in golang, told me the issue.


node_exporter --version 2>&1 ...




Julien Pivotto

unread,
Nov 5, 2021, 5:56:01 AM11/5/21
to jobenvil, Prometheus Users
In 1.2.0 it is not needed to do the resurrection anymore.

Regards,

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/6de932ee-2854-409f-b080-0cd4134251e6n%40googlegroups.com.

jobenvil

unread,
Nov 5, 2021, 6:23:31 AM11/5/21
to Prometheus Users
Great, thanks for the feedback and super, that version 1.2.0 has improved that 👍

Johannes Ziemke

unread,
Nov 5, 2021, 7:19:36 AM11/5/21
to Prometheus Users
fwiw, there is also the node_exporter_build_info metric you can use to check/automate your updates
Reply all
Reply to author
Forward
0 new messages