Compare commits

...

2 Commits

Author SHA1 Message Date
ecf66a5fb2 add grafana and graphite to podman incubating
All checks were successful
Reese's Arch Toolbox / build-and-push-arch-toolbox (push) Successful in 44m47s
2025-03-09 19:27:22 -04:00
74d1f7364a add ups monitoring and data size monitoring to truenas docs 2025-03-09 19:27:02 -04:00
6 changed files with 130 additions and 0 deletions

View File

@@ -31,6 +31,8 @@
- [Corrupted data](#corrupted-data)
- [Stuck VMs](#stuck-vms)
- [Mounting ZVOLS](#mounting-zvols)
- [UPS Monitoring](#ups-monitoring)
- [ZFS Size Data](#zfs-size-data)
## Bios settings
@@ -491,3 +493,35 @@ rsync --progress -av --delete -e ssh \
kube:/opt/local-path-provisioner/ssd/pvc-4fca5cad-7640-45ea-946d-7a604a3ac875_minecraft_nimcraft/ \
--dry-run
```
## UPS Monitoring
First, you'll need to create a user with access to the UPS in System -> Services -> UPS.
Under the Extra Users section, add a user like so:
```conf
[admin]
password = mypass
actions = set
actions = fsd
instcmds = all
```
Then you can run commands with upscmd
```bash
export UPS_USER=admin
export UPS_PASS=mypass
# Quick battery test
upscmd -u $UPS_USER$ -p $UPS_PASS ups test.battery.start.quick
```
## ZFS Size Data
```bash
# jq -r is required otherwise the data will be invalid
zfs list -j enc0/vms -p -o available,used | \
jq -r --arg TIMESTAMP `date +%s` '"driveripper.vms.data.used " + .datasets[].properties.used.value + " " + $TIMESTAMP' | \
nc -N -4 yellow.reeselink.com 2003
```

View File

@@ -0,0 +1,10 @@
# grafana.container
[Unit]
Description=Grafana
[Container]
ContainerName=grafana
Image=grafana/grafana-enterprise
Network=systemd-graphite
PublishPort=3000:3000
Volume=grafana-storage:/var/lib/grafana

View File

@@ -0,0 +1,28 @@
# Grafana
## Install
<https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/>
Generate the quadlet:
```bash
podman run ghcr.io/containers/podlet --description Grafana \
podman run \
-p 3000:3000 \
--name=grafana \
--volume grafana-storage:/var/lib/grafana \
--network=systemd-graphite \
grafana/grafana-enterprise > podman/incubating/grafana/grafana.container
```
Copy the graphite.container and graphite.network file to the server you want to run it on
```bash
export PODMAN_SERVER=
scp podman/incubating/grafana/grafana.container $PODMAN_SERVER:/etc/containers/systemd/
ssh $PODMAN_SERVER systemctl daemon-reload
ssh $PODMAN_SERVER systemctl enable --now grafana.service
```

View File

@@ -0,0 +1,16 @@
# graphite.container
[Unit]
Description=Graphite
[Container]
ContainerName=graphite
Image=ghcr.io/deniszh/graphite-statsd
Network=systemd-graphite
PublishPort=127.0.0.1:8080:80
PublishPort=2003-2004:2003-2004
PublishPort=2023-2024:2023-2024
PublishPort=8125:8125/udp
PublishPort=8126:8126
[Service]
Restart=always

View File

@@ -0,0 +1,36 @@
# Graphite
## Install
<https://graphite.readthedocs.io/en/latest/install.html#docker>
```bash
# Generate the network
podman run ghcr.io/containers/podlet --description Graphite \
podman network create --ipv6 graphite > podman/incubating/graphite/graphite.network
# Generate the systemd container service
podman run ghcr.io/containers/podlet --description Graphite \
podman run \
--name graphite \
--restart=always \
--network=systemd-graphite \
-p 8080:80 \
-p 2003-2004:2003-2004 \
-p 2023-2024:2023-2024 \
-p 8125:8125/udp \
-p 8126:8126 \
ghcr.io/deniszh/graphite-statsd > podman/incubating/graphite/graphite.container
```
Copy the graphite.container and graphite.network file to the server you want to run it on
```bash
export PODMAN_SERVER=
scp podman/incubating/graphite/graphite.network $PODMAN_SERVER:/etc/containers/systemd/
scp podman/incubating/graphite/graphite.container $PODMAN_SERVER:/etc/containers/systemd/
ssh $PODMAN_SERVER systemctl daemon-reload
ssh $PODMAN_SERVER systemctl enable --now graphite.network
ssh $PODMAN_SERVER systemctl enable --now graphite.service
```

View File

@@ -0,0 +1,6 @@
# graphite.network
[Unit]
Description=Graphite
[Network]
IPv6=true