Compare commits

3 Commits
preset ... main

Author SHA1 Message Date
c1adba5514 Update 'README.md' 2023-01-06 03:11:09 +00:00
8e7685802a Update 'README.md' 2023-01-06 03:10:36 +00:00
a8ce5a7ebf write the service directly into place 2022-10-23 13:53:01 -04:00
2 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,12 @@ sudo systemctl start prometheus-node-exporter
Installing a collector for the metrics now available on `:9100` is left as an exercise for the reader, but I figure if you're devoted to tracking system metrics enough to try and install prometheus on your Steam Deck you've probably already got a setup for that.
## Future Incompatabilities
If and when SteamOS is "rebased" onto a newer version of Arch (that is, the `VERSION_ID` in `/etc/os-release` is incremented), you'll need to update the `VERSION_ID` in `/var/lib/extensions/prometheus-node-exporter/usr/lib/extension-release.d/extension-release.prometheus-node-exporter` to match, then re-merge the extensions via `sudo systemd-sysext refresh`.
## References
* <https://tailscale.com/blog/steam-deck/>
* <https://blogs.igalia.com/berto/2022/09/13/adding-software-to-the-steam-deck-with-systemd-sysext/>
* <https://forum.tailscale.com/t/steam-deck-support/2583/7>

View File

@@ -9,11 +9,11 @@ cd "${dir}"
BINARY=$(curl https://api.github.com/repos/prometheus/node_exporter/releases/latest | jq -r '.assets[] | select(.name | contains("linux-amd64")) | .browser_download_url')
curl -L $BINARY -o node-exporter.tgz
mkdir -p prometheus/usr/{bin,lib/{systemd/{system,system-preset},extension-release.d}}
mkdir -p prometheus/usr/{bin,lib/{systemd/system,extension-release.d}}
tar xzf node-exporter.tgz
cp -vrf node_exporter-*/node_exporter prometheus/usr/bin/node_exporter
cat > prometheus/usr/lib/systemd/system/prometheus-node-exporter.service <<- EOM
cat > /etc/systemd/system/prometheus-node-exporter.service <<- EOM
[Unit]
Description=Prometheus exporter for machine metrics
Requires=network-online.target
@@ -31,11 +31,6 @@ ProtectSystem=strict
WantedBy=multi-user.target
EOM
cat > prometheus/usr/lib/systemd/system-preset/00-prometheus-node-exporter.preset <<- EOM
# enabling prometheus
enable prometheus-node-exporter.service
EOM
source /etc/os-release
echo -e "SYSEXT_LEVEL=1.0\nID=steamos\nVERSION_ID=${VERSION_ID}" >> prometheus/usr/lib/extension-release.d/extension-release.prometheus-node-exporter