mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-05 00:11:06 +01:00
b6215e649c
Currently Node Exporter has a metric called `node_uname_info` which of course exposes uname info. While this is nice, it does not help if you are running different OSes which could have similar uname info. Therefore parse `/etc/os-release` or `/usr/lib/os-release` and expose a `node_os_info` metric which provide information regarding the OS release/version of the node. Also expose the major.minor part of the OS release version as `node_os_version`. Since the os-release files will not change often, cache the parsed content and only refresh the cache if the modification time changes. This `os` collector will read files outside of `/proc` and `/sys`, but the os-release file is widely used and the format is standardized: https://www.freedesktop.org/software/systemd/man/os-release.html Bug: https://github.com/prometheus/node_exporter/issues/1574 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
13 lines
382 B
Plaintext
13 lines
382 B
Plaintext
NAME="Ubuntu"
|
|
VERSION="20.04.2 LTS (Focal Fossa)"
|
|
ID=ubuntu
|
|
ID_LIKE=debian
|
|
PRETTY_NAME="Ubuntu 20.04.2 LTS"
|
|
VERSION_ID="20.04"
|
|
HOME_URL="https://www.ubuntu.com/"
|
|
SUPPORT_URL="https://help.ubuntu.com/"
|
|
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
|
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
|
VERSION_CODENAME=focal
|
|
UBUNTU_CODENAME=focal
|