Compare commits

..

1 Commits
main ... preset

Author SHA1 Message Date
David f3cfa3a61d add a preset, although it doesn't seem necessary 2022-10-23 13:31:24 -04:00
2 changed files with 7 additions and 7 deletions

View File

@ -27,12 +27,7 @@ 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,extension-release.d}}
mkdir -p prometheus/usr/{bin,lib/{systemd/{system,system-preset},extension-release.d}}
tar xzf node-exporter.tgz
cp -vrf node_exporter-*/node_exporter prometheus/usr/bin/node_exporter
cat > /etc/systemd/system/prometheus-node-exporter.service <<- EOM
cat > prometheus/usr/lib/systemd/system/prometheus-node-exporter.service <<- EOM
[Unit]
Description=Prometheus exporter for machine metrics
Requires=network-online.target
@ -31,6 +31,11 @@ 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