Repository: barrucadu/nixfiles Branch: master Commit: 866707b7db91 Files: 95 Total size: 1.1 MB Directory structure: gitextract_v3gowx2a/ ├── .forgejo/ │ ├── scripts/ │ │ └── deploy-documentation.sh │ └── workflows/ │ └── deploy-documentation.yml ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── ci.yaml │ └── github-pages.yml ├── .gitignore ├── .sops.yaml ├── README.markdown ├── docs/ │ ├── .gitignore │ ├── book.toml │ └── src/ │ ├── SUMMARY.md │ └── runbooks/ │ ├── alerts/ │ │ ├── diskspacelow.md │ │ └── zpoolstatusdegraded.md │ ├── move-a-configuration-to-a-new-machine.md │ ├── set-up-a-new-host.md │ ├── upgrade-to-a-new-version-of-elasticsearch.md │ └── upgrade-to-a-new-version-of-postgres.md ├── flake.nix ├── hosts/ │ ├── carcosa/ │ │ ├── caddy/ │ │ │ ├── lainon-life/ │ │ │ │ ├── 404.html │ │ │ │ └── duvet.ogg │ │ │ └── www-lookwhattheshoggothdraggedin-com.caddyfile │ │ ├── configuration.nix │ │ ├── hardware.nix │ │ └── secrets.yaml │ ├── nyarlathotep/ │ │ ├── configuration.nix │ │ ├── dashboards/ │ │ │ ├── finance.json │ │ │ └── smart-home.json │ │ ├── hardware.nix │ │ ├── jobs/ │ │ │ ├── flac-and-tag-album.sh │ │ │ ├── hledger-export-to-victoriametrics.py │ │ │ ├── hledger-fetch-fx-rates.py │ │ │ ├── restic-prepare--fetch-youtube.py │ │ │ ├── restic-prepare--hardlink-torrent-files.py │ │ │ ├── rss-to-mastodon.py │ │ │ └── tag-podcasts.sh │ │ └── secrets.yaml │ └── yuggoth/ │ ├── configuration.nix │ ├── hardware.nix │ └── secrets.yaml ├── scripts/ │ ├── backups.sh │ ├── documentation.sh │ ├── fmt.sh │ ├── lint.sh │ └── secrets.sh ├── shared/ │ ├── acme/ │ │ ├── default.nix │ │ └── options.nix │ ├── bookdb/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ ├── options.nix │ │ ├── remote-sync-receive.nix │ │ ├── remote-sync-send.nix │ │ └── uuids.yaml │ ├── bookmarks/ │ │ ├── default.nix │ │ ├── options.nix │ │ ├── remote-sync-receive.nix │ │ └── remote-sync-send.nix │ ├── dashboards/ │ │ └── node-stats-detailed.json │ ├── default.nix │ ├── erase-your-darlings/ │ │ ├── default.nix │ │ └── options.nix │ ├── finder/ │ │ ├── default.nix │ │ └── options.nix │ ├── forgejo/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ └── options.nix │ ├── foundryvtt/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ └── options.nix │ ├── host-templates/ │ │ ├── default.nix │ │ └── website-mirror/ │ │ ├── default.nix │ │ ├── options.nix │ │ └── resources/ │ │ ├── memo-barrucadu-co-uk.caddyfile │ │ └── www-barrucadu-co-uk.caddyfile │ ├── minecraft/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ └── options.nix │ ├── oci-containers/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ └── options.nix │ ├── options.nix │ ├── pleroma/ │ │ ├── default.nix │ │ ├── erase-your-darlings.nix │ │ └── options.nix │ ├── resolved/ │ │ ├── dashboard.json │ │ ├── default.nix │ │ └── options.nix │ ├── restic-backups/ │ │ ├── default.nix │ │ └── options.nix │ └── torrents/ │ ├── default.nix │ ├── erase-your-darlings.nix │ ├── options.nix │ └── transmission_3/ │ ├── default.nix │ ├── transmission-3.00-miniupnpc-2.2.8.patch │ └── transmission-3.00-openssl-3.patch └── tools/ └── provision-machine.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .forgejo/scripts/deploy-documentation.sh ================================================ #!/usr/bin/env bash echo "$SSH_PRIVATE_KEY" > .ssh_private_key cleanup() { rm .ssh_private_key } trap cleanup EXIT chmod 600 .ssh_private_key set -x rsync -Pavz --delete -e "ssh -i .ssh_private_key -o StrictHostKeyChecking=no" \ _site/ "concourse-deploy-robot@${TARGET}:/persist/srv/http/barrucadu.dev/docs/nixfiles/" ================================================ FILE: .forgejo/workflows/deploy-documentation.yml ================================================ on: push: branches: ["master"] jobs: deploy_documentation: runs-on: nix steps: - name: Install tools run: | nix-env -iA nixpkgs.nodejs_24 nixpkgs.rsync - uses: https://code.forgejo.org/actions/checkout@v4 - name: Build run: | nix --extra-experimental-features "nix-command flakes" run .\#documentation - name: Deploy carcosa run: bash -e .forgejo/scripts/deploy-documentation.sh env: SSH_PRIVATE_KEY: ${{ secrets.CARCOSA_SSH_PRIVATE_KEY }} TARGET: carcosa.barrucadu.co.uk - name: Deploy yuggoth run: bash -e .forgejo/scripts/deploy-documentation.sh env: SSH_PRIVATE_KEY: ${{ secrets.YUGGOTH_SSH_PRIVATE_KEY }} TARGET: yuggoth.barrucadu.co.uk ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: github-actions directory: / schedule: interval: daily ================================================ FILE: .github/workflows/ci.yaml ================================================ name: Run tests on: pull_request jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: cachix/install-nix-action@v31 with: nix_path: nixpkgs=channel:nixos-unstable - name: Lint run: | set -ex nix flake check nix run .#fmt nix run .#lint git diff --exit-code test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: cachix/install-nix-action@v31 with: nix_path: nixpkgs=channel:nixos-unstable - name: Check documentation site builds run: nix run .#documentation ================================================ FILE: .github/workflows/github-pages.yml ================================================ on: push: branches: ["master"] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: "pages" cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Setup Pages uses: actions/configure-pages@v6 - name: Create placeholder site run: | mkdir _site cat < _site/index.html Redirecting to https://nixfiles.docs.barrucadu.dev/

This website has moved to "https://nixfiles.docs.barrucadu.dev/

EOF - name: Upload artifact uses: actions/upload-pages-artifact@v5 # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5 ================================================ FILE: .gitignore ================================================ /_site ================================================ FILE: .sops.yaml ================================================ keys: - &barrucadu 'age1sdnp5uxhdtujc78penv2gntnenzcfju7est4hslz6eqgfk26u9nskkk634' creation_rules: - path_regex: hosts/carcosa/secrets(/[^/]+)?\.yaml$ key_groups: - age: - *barrucadu - 'age1ty4vs59695vuavnvgdftguyq2aau29nv75y4tqrr6ag8z26vfc5sc5rc4n' - path_regex: hosts/nyarlathotep/secrets(/[^/]+)?\.yaml$ key_groups: - age: - *barrucadu - 'age1700sgwfejx38fh66k6sajxe507w9x6ptcxfh4dmyffflml75w4fqmteyfy' - path_regex: hosts/yuggoth/secrets(/[^/]+)?\.yaml$ key_groups: - age: - *barrucadu - 'age1xj0vderjss6wvyuu5uw5gag6lhxzfh6qwfrewgpff5ttpfa03azsxc8600' ================================================ FILE: README.markdown ================================================ nixfiles ======== My [NixOS][] configuration and assorted other crap, powered by [flakes][]. Clone to `/etc/nixos`. CI checks ensure that code is formatted and passes linting. Run those locally with: ```bash nix flake check nix run .#fmt nix run .#lint ``` See [the documentation](https://nixfiles.docs.barrucadu.dev). [NixOS]: https://nixos.org [flakes]: https://wiki.nixos.org/wiki/Flakes Overview -------- This is an opinionated config making assumptions which work for me but might not for you: - These are primarily single-user hosts, with me being that user. While security and availability are important, convenience takes priority. - Observability is good but there's no central graphing or alerting stack, every host has to run their own. - Databases should not be shared, each service has its own containerised instance. This means a single host may run several instances of the same database software, but that's an acceptable overhead. - Persistent docker volumes should be backed by bind-mounts to the filesystem. - For ZFS systems, [wiping `/` on boot][] is good actually. Everything in `shared/default.nix` is **enabled on every host by default**. Notable decisions are: - Every user gets a `~/tmp` directory with files cleaned out after 7 days. - Automatic upgrades (including reboots if needed), automatic deletions of generations older than 30 days, and automatic garbage collection are all enabled. - Locale, timezone, and keyboard layout all set to UK / GB values (yes, even on servers). - Firewall and fail2ban are enabled, but pings are explicitly allowed. - SSH accepts pubkey auth only: no passwords. - Syncthing is enabled. For monitoring and alerting specifically: - Prometheus, Grafana, and Alertmanager are all enabled by default (Alertmanager needs AWS credentials provided to actually send alerts). - The Node Exporter is enabled, along with a dashboard. - cAdvisor is enabled, along with a dashboard. If using ZFS there are a few more things configured: - All pools are scrubbed monthly. - The auto-trim and auto-snapshot jobs are enabled (for pools which have those configured). - There's a Prometheus alert for pools in a state other than "online". Everything else in `shared/` is available to every host, but disabled by default. [wiping `/` on boot]: https://grahamc.com/blog/erase-your-darlings Tools ----- ### Backups Backups are managed by `shared/restic-backups` and uploaded to [Backblaze B2][] with [restic][]. List all the snapshots with: ```bash nix run .#backups # all snapshots nix run .#backups -- snapshots --host # for a specific host nix run .#backups -- snapshots --tag # for a specific tag ``` Restore a snapshot to `` with: ```bash nix run .#backups restore [] ``` If unspecified, the snapshot is restored to `/tmp/restic-restore-`. [Backblaze B2]: https://www.backblaze.com/ [restic]: https://restic.net/ ### Secrets Secrets are managed with [sops-nix][]. Create / edit secrets with: ```bash nix run .#secrets # secrets.yaml for current host nix run .#secrets # secrets.yaml for nix run .#secrets # .yaml for ``` [sops-nix]: https://github.com/Mic92/sops-nix ================================================ FILE: docs/.gitignore ================================================ book # generated by the build script src/README.md src/hosts.md src/host-templates.md src/modules.md src/options.md src/packages.md ================================================ FILE: docs/book.toml ================================================ [book] title = "nixfiles" authors = ["Michael Walker (barrucadu)"] description = "My NixOS configuration and assorted other crap, powered by flakes." language = "en" [build] create-missing = false [output.html] git-repository-url = "https://github.com/barrucadu/nixfiles" cname = "nixfiles.docs.barrucadu.dev" ================================================ FILE: docs/src/SUMMARY.md ================================================ # Summary [README](./README.md) # Reference - [Hosts](./hosts.md) - [Host Templates](./host-templates.md) - [Modules](./modules.md) - [Options](./options.md) # Alert Runbooks - [DiskSpaceLow](./runbooks/alerts/diskspacelow.md) - [ZPoolStatusDegraded](./runbooks/alerts/zpoolstatusdegraded.md) # "How to" Runbooks - [Set up a new host](./runbooks/set-up-a-new-host.md) - [Move a configuration to a new machine](./runbooks/move-a-configuration-to-a-new-machine.md) - [Upgrade to a new version of elasticsearch](./runbooks/upgrade-to-a-new-version-of-elasticsearch.md) - [Upgrade to a new version of postgres](./runbooks/upgrade-to-a-new-version-of-postgres.md) ================================================ FILE: docs/src/runbooks/alerts/diskspacelow.md ================================================ DiskSpaceLow ============ This alert fires when a partition has under 10% free space remaining. The alert will say which partitions are affected, `df -h` also has the information: ``` $ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 1.6G 0 1.6G 0% /dev tmpfs 16G 112K 16G 1% /dev/shm tmpfs 7.8G 9.8M 7.8G 1% /run tmpfs 16G 1.1M 16G 1% /run/wrappers local/volatile/root 1.7T 1.8G 1.7T 1% / local/persistent/nix 1.7T 5.1G 1.7T 1% /nix local/persistent/persist 1.7T 2.0G 1.7T 1% /persist local/persistent/var-log 1.7T 540M 1.7T 1% /var/log efivarfs 128K 40K 84K 33% /sys/firmware/efi/efivars local/persistent/home 1.7T 32G 1.7T 2% /home /dev/nvme0n1p2 487M 56M 431M 12% /boot data/nas 33T 22T 11T 68% /mnt/nas tmpfs 3.2G 12K 3.2G 1% /run/user/1000 ``` Note all ZFS datasets in the same pool (`local/*` and `data/*` in the example above) share the underlying storage. Debugging steps: - See the `node_filesystem_avail_bytes` metric for how quickly disk space is being consumed - Use `ncdu -x` to work out where the space is going - Buy more storage if need be ================================================ FILE: docs/src/runbooks/alerts/zpoolstatusdegraded.md ================================================ ZPoolStatusDegraded =================== This alert fires when an HDD fails. The `zpool status -x` command will say which drive has failed; what, specifically, the problem is; and link to a runbook: ``` $ zpool status -x pool: data state: DEGRADED status: One or more devices could not be used because the label is missing or invalid. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Replace the device using 'zpool replace'. see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J scan: scrub in progress since Thu Feb 1 00:00:01 2024 19.3T / 20.6T scanned at 308M/s, 17.8T / 20.6T issued at 284M/s 0B repaired, 86.49% done, 02:51:42 to go config: NAME STATE READ WRITE CKSUM data DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 11478606759844821041 UNAVAIL 0 0 0 was /dev/disk/by-id/ata-ST10000VN0004-1ZD101_ZA206882-part2 ata-ST10000VN0004-1ZD101_ZA27G6C6-part2 ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 ata-ST10000VN0004-1ZD101_ZA22461Y ONLINE 0 0 0 ata-ST10000VN0004-1ZD101_ZA27BW6R ONLINE 0 0 0 mirror-2 ONLINE 0 0 0 ata-ST10000VN0008-2PJ103_ZLW0398A ONLINE 0 0 0 ata-ST10000VN0008-2PJ103_ZLW032KE ONLINE 0 0 0 errors: No known data errors ``` Follow the provided runbook. In most cases the solution will be to: 1. Buy a new HDD (of at least the same size as the failed one) 1. Physically replace the failed HDD with the new one 1. Run `zpool replace ` 1. Wait for the new device to resilver ================================================ FILE: docs/src/runbooks/move-a-configuration-to-a-new-machine.md ================================================ Move a configuration to a new machine ===================================== Follow the [set up a new host](./set-up-a-new-host.md) instructions up to **step 5** (cloning the nixfiles repo to `/etc/nixos`). Then: 1. Merge the generated machine configuration into the nixfiles configuration 1. Copy the sops master key to `.config/sops/age/keys.txt` 1. **If using secrets:** Re-encrypt the secrets 1. **If there is a backup:** Restore the latest backup 1. Remove the sops master key 1. **If wiping / on boot:** Copy any files which need to be preserved to the appropriate place in `/persist` 1. **Optional:** Update DNS records 1. **Optional:** Generate SSH key 1. Build the new system configuration with `sudo nixos-rebuild switch --flake '.#'` 1. Reboot 1. Commit, push, & merge 1. **Optional:** Configure Syncthing If using secrets: Re-encrypt the secrets ---------------------------------------- After first boot, generate an age public key from the host SSH key: ```bash nix-shell -p ssh-to-age --run 'ssh-keyscan localhost | ssh-to-age' ``` Replace the old key in `.sops.yaml` with the new key: ```yaml creation_rules: ... - path_regex: hosts//secrets(/[^/]+)?\.yaml$ key_groups: - age: - *barrucadu - '' # delete - '' # insert ``` Update the host's encryption key: ```bash nix shell "nixpkgs#sops" -c sops updatekeys hosts//secrets.yaml ``` If there is a backup: Restore the latest backup ----------------------------------------------- Download the latest backup to `/tmp/backup-restore`: ```bash nix run .#backups restore ``` Then move files to restore to the appropriate locations. Optional: Update DNS records ---------------------------- If there are any DNS records referring to the old machine which are now incorrect (e.g. due to an IP address change), make the needed changes to [the ops repo][] and apply the change via [Concourse][]. [the ops repo]: https://github.com/barrucadu/ops [Concourse]: https://cd.barrucadu.dev/ Optional: Generate SSH key -------------------------- Generate an ed25519 SSH key: ```bash ssh-keygen -t ed25519 ``` **If the host should be able to interact with GitHub:** add the public key to the GitHub user configuration *as an SSH key*. **If the host should be able to push commits to GitHub:** add the public key to the GitHub user configuration *as a signing key*, and also add it to [the allowed_signers file](https://github.com/barrucadu/dotfiles/blob/master/dot_config/git/allowed_signers.tmpl). **If the host should be able to connect to other machines:** add the public key to `shared/default.nix`. Remove the old SSH key for this host from anywhere it's used. Optional: Configure Syncthing ----------------------------- Use the Syncthing Web UI (`localhost:8384`) to get the machine's ID. Replace the old machine's ID and folder sharing permissions with the new machine, for any other machines which synchronised files with it. ================================================ FILE: docs/src/runbooks/set-up-a-new-host.md ================================================ Set up a new host ================= > [!NOTE] > See also [the NixOS installation instructions](https://nixos.org/manual/nixos/stable/index.html#ch-installation). Install NixOS ------------- Boot into the ISO and install NixOS with `tools/provision-machine.sh`: ```bash sudo -i nix-env -f '' -iA git curl https://raw.githubusercontent.com/barrucadu/nixfiles/master/tools/provision-machine.sh > provision-machine.sh bash provision-machine.sh gpt /dev/sda ``` Then: 1. Rename `/mnt/persist/etc/nixos/hosts/new` after the new hostname 2. Add the host to `/mnt/persist/etc/nixos/flake.nix` 3. Add the new files to git 4. Run `nixos-install --flake /mnt/persist/etc/nixos#hostname` 5. Reboot First boot ---------- Generate an age public key from the host SSH key: ```bash nix-shell -p ssh-to-age --run 'ssh-keyscan localhost | ssh-to-age' ``` Add a new section with this key to `/persist/etc/nixos/.sops.yaml`: ```yaml creation_rules: ... - path_regex: hosts//secrets(/[^/]+)?\.yaml$ key_groups: - age: - *barrucadu - '' ``` Add a `users/barrucadu` secret with the hashed user password: ```bash nix run .#secrets ``` Copy the host SSH keys to `/etc/persist`: ```bash sudo mkdir /persist/etc/ssh sudo cp /etc/ssh/ssh_host_rsa_key /persist/etc/ssh/ssh_host_rsa_key sudo cp /etc/ssh/ssh_host_ed25519_key /persist/etc/ssh/ssh_host_ed25519_key ``` Enable `nixfiles.eraseYourDarlings`: ```nix nixfiles.eraseYourDarlings.enable = true; nixfiles.eraseYourDarlings.barrucaduPasswordFile = config.sops.secrets."users/barrucadu".path; sops.secrets."users/barrucadu".neededForUsers = true; ``` Make the `/persist` volume available in early boot: ```nix fileSystems."/persist" = { device = "local/persistent/persist"; fsType = "zfs"; neededForBoot = true; }; ``` Then: 1. Rebuild the system: `sudo nixos-rebuild boot --flake /persist/etc/nixos` 2. Reboot Optional: Add DNS records ------------------------- Add `A` / `AAAA` records to [the ops repo][] and apply the change via [Concourse][]. [the ops repo]: https://github.com/barrucadu/ops [Concourse]: https://cd.barrucadu.dev/ Optional: Configure alerting ---------------------------- All hosts have [Alertmanager][] installed and enabled. To actually publish alerts, create a secret for the environment file with credentials for the `host-notifications` SNS topic: ```text AWS_ACCESS_KEY="..." AWS_SECRET_ACCESS_KEY="..." ``` Then configure the environment file: ```nix services.prometheus.alertmanager.environmentFile = config.sops.secrets."services/alertmanager/env".path; sops.secrets."services/alertmanager/env" = { }; ``` [Alertmanager]: https://prometheus.io/docs/alerting/latest/alertmanager/ Optional: Configure backups --------------------------- All hosts which run any sort of service with data I care about should take automatic backups. Firstly, add the backup credentials to the secrets: ```bash nix run .#secrets ``` Then enable backups in the host configuration: ```nix nixfiles.restic-backups.enable = true; nixfiles.restic-backups.environmentFile = config.sops.secrets."nixfiles/restic-backups/env".path; sops.secrets."nixfiles/restic-backups/env" = { }; ``` Most services define their own backup scripts. For any other needs, write a custom backup job: ```nix nixfiles.restic-backups.backups. = { ... }; ``` Optional: Generate SSH key -------------------------- Generate an ed25519 SSH key: ```bash ssh-keygen -t ed25519 ``` **If the host should be able to interact with GitHub:** add the public key to the GitHub user configuration *as an SSH key*. **If the host should be able to push commits to GitHub:** add the public key to the GitHub user configuration *as a signing key*, and also add it to [the allowed_signers file](https://github.com/barrucadu/dotfiles/blob/master/dot_config/git/allowed_signers.tmpl). **If the host should be able to connect to other machines:** add the public key to `shared/default.nix`. Optional: Configure Syncthing ----------------------------- Use the Syncthing Web UI (`localhost:8384`) to get the machine's ID. Add this ID to any other machines which it should synchronise files with, through their web UIs. Then configure any shared folders. ================================================ FILE: docs/src/runbooks/upgrade-to-a-new-version-of-elasticsearch.md ================================================ Upgrade to a new version of elasticsearch ==================================== Change the default elasticsearch version for a module ----------------------------------------------------- 1. Individually upgrade all hosts to the new version, following the processes below. 2. Change the default value of the `elasticsearchTag` option for the module. 3. Remove the per-host `elasticsearchTag` options. Upgrade to a new minor version ------------------------------ This is generally safe. Just change the `elasticsearchTag` and rebuild the NixOS configuration. Upgrade to a new major version ------------------------------ In brief: take a backup, upgrade to the latest minor release of the current major version, fix any application warnings, and then upgrade to the initial release of the new major version. Shell variables: - `$VOLUME_DIR` - the directory on the host that the container's `/usr/share/elasticsearch/data` is bind-mounted to 1. Upgrade to the latest minor release of the current major version. 1. Change the `elasticsearchTag` option in the host's NixOS configuration to the latest minor release of the current major version. 2. Rebuild the NixOS configuration and check that the database and all of its dependent services come back up: ```bash sudo nixos-rebuild switch ``` 2. Exercise the application, performing both reads and writes: check the elasticsearch log for deprecation warnings, and fix any issues in the application. 3. Stop the database. 4. Take a backup: ```bash sudo cp -a "$VOLUME_DIR" "${VOLUME_DIR}.bak" ``` 5. Change the `elasticsearchTag` option in the host's NixOS configuration to the initial release of the new major version. 6. Rebuild the NixOS configuration and check that the database and all of its dependent services come back up: ```bash sudo nixos-rebuild switch ``` ### Rollback The old database files are still present at `${VOLUME_DIR}.bak`, so: 1. Stop all the relevant services, including the database container. 2. Restore the backup: ```bash sudo mv "$VOLUME_DIR" "${VOLUME_DIR}.aborted" sudo mv "${VOLUME_DIR}.bak" "$VOLUME_DIR" ``` 3. If the `elasticsearchTag` has been updated in the NixOS configuration: 1. Revert it to its previous version. 2. Rebuild the NixOS configuration. 4. Restart all the relevant services. ================================================ FILE: docs/src/runbooks/upgrade-to-a-new-version-of-postgres.md ================================================ Upgrade to a new version of postgres ==================================== Change the default postgres version for a module ------------------------------------------------ 1. Individually upgrade all hosts to the new version, following the processes below. 2. Change the default value of the `postgresTag` option for the module. 3. Remove the per-host `postgresTag` options. Upgrade to a new minor version ------------------------------ This is generally safe. Just change the `postgresTag` and rebuild the NixOS configuration. Upgrade to a new major version ------------------------------ In brief: take a backup, shut down the database, bring up the new one, and restore the backup. This does have some downtime, but is relatively risk free. Shell variables: - `$CONTAINER` - the database container name - `$POSTGRES_DB` - the database name - `$POSTGRES_USER` - the database user - `$POSTGRES_PASSWORD` - the database password - `$VOLUME_DIR` - the directory on the host that the container's `/var/lib/postgresql/data` is bind-mounted to - `$TAG` - the new container tag to use Replace `podman` with `docker` in the following commands if you're using that. 1. Stop all services which write to the database. 2. Dump the database: ```bash sudo podman exec -i "$CONTAINER" pg_dump -U "$POSTGRES_USER" --no-owner -Fc "$POSTGRES_DB" > "${CONTAINER}.dump" ``` 3. Stop the database container: ```bash sudo systemctl stop "podman-$CONTAINER" ``` 4. Back up the database volume: ```bash sudo mv "$VOLUME_DIR" "${VOLUME_DIR}.bak" ``` 5. Create the new volume: ```bash sudo mkdir "$VOLUME_DIR" ``` 6. Bring up a new database container with the dump bind-mounted into it: ```bash sudo podman run --rm --name="$CONTAINER" -v "$(pwd):/backup" -v "${VOLUME_DIR}:/var/lib/postgresql/data" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" --shm-size=1g "postgres:${TAG}" ``` 7. In another shell, restore the dump: ```bash sudo podman exec "$CONTAINER" pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc -j4 --clean "/backup/${CONTAINER}.dump" ``` 8. Ctrl-c the database container after the dump has restored successfully. 9. Change the `postgresTag` option in the host's NixOS configuration. 10. Rebuild the NixOS configuration and check that the database and all of its dependent services come back up: ```bash sudo nixos-rebuild switch ``` ### Rollback The old database files are still present at `${VOLUME_DIR}.bak`, so: 1. Stop all the relevant services, including the database container. 2. Restore the backup: ```bash sudo mv "$VOLUME_DIR" "${VOLUME_DIR}.aborted" sudo mv "${VOLUME_DIR}.bak" "$VOLUME_DIR" ``` 3. If the `postgresTag` has been updated in the NixOS configuration: 1. Revert it to its previous version. 2. Rebuild the NixOS configuration. 4. Restart all the relevant services. ================================================ FILE: flake.nix ================================================ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11-small"; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; # my packages bookdb = { url = "github:barrucadu/bookdb"; inputs.nixpkgs.follows = "nixpkgs"; inputs.gitignore.follows = "gitignore"; inputs.rust-overlay.follows = "rust-overlay"; }; bookmarks = { url = "github:barrucadu/bookmarks"; inputs.nixpkgs.follows = "nixpkgs"; inputs.gitignore.follows = "gitignore"; inputs.rust-overlay.follows = "rust-overlay"; }; prometheus-awair-exporter = { url = "github:barrucadu/prometheus-awair-exporter"; inputs.nixpkgs.follows = "nixpkgs"; inputs.gitignore.follows = "gitignore"; }; resolved = { url = "github:barrucadu/resolved"; inputs.nixpkgs.follows = "nixpkgs"; inputs.gitignore.follows = "gitignore"; inputs.rust-overlay.follows = "rust-overlay"; }; # dependencies gitignore = { url = "github:hercules-ci/gitignore.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, sops-nix, ... }@flakeInputs: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; in { formatter.${system} = pkgs.nixpkgs-fmt; nixosConfigurations = let mkNixosConfiguration = name: extraModules: nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit flakeInputs; }; modules = [ { networking.hostName = name; nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ]; sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml; } ./shared (./hosts + "/${name}" + /configuration.nix) (./hosts + "/${name}" + /hardware.nix) sops-nix.nixosModules.sops ] ++ extraModules; }; in { carcosa = mkNixosConfiguration "carcosa" [ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix" ]; nyarlathotep = mkNixosConfiguration "nyarlathotep" [ "${nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ]; yuggoth = mkNixosConfiguration "yuggoth" [ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix" ]; }; packages.${system} = { bookdb = flakeInputs.bookdb.packages.${system}.default; bookmarks = flakeInputs.bookmarks.packages.${system}.default; prometheus-awair-exporter = flakeInputs.prometheus-awair-exporter.packages.${system}.default; resolved = flakeInputs.resolved.packages.${system}.default; }; apps.${system} = let mkApp = name: script: { type = "app"; program = toString (pkgs.writeShellScript "${name}.sh" script); }; in { backups = mkApp "backups" '' PATH=${with pkgs; lib.makeBinPath [ restic sops nettools ]} ${pkgs.lib.fileContents ./scripts/backups.sh} ''; fmt = mkApp "fmt" '' PATH=${with pkgs; lib.makeBinPath [ nix git python3Packages.black ]} ${pkgs.lib.fileContents ./scripts/fmt.sh} ''; lint = mkApp "lint" '' # TODO: add nix-linter back when the package is no longer broken PATH=${with pkgs; lib.makeBinPath [ findutils shellcheck git gnugrep python3Packages.flake8 ]} ${pkgs.lib.fileContents ./scripts/lint.sh} ''; secrets = mkApp "secrets" '' PATH=${with pkgs; lib.makeBinPath [ sops nettools vim ]} export EDITOR=vim ${pkgs.lib.fileContents ./scripts/secrets.sh} ''; documentation = let eval = pkgs.lib.evalModules { modules = [ { config._module.args = { inherit pkgs; }; } ./shared/options.nix # modules ./shared/acme/options.nix ./shared/bookdb/options.nix ./shared/bookmarks/options.nix ./shared/erase-your-darlings/options.nix ./shared/finder/options.nix ./shared/forgejo/options.nix ./shared/foundryvtt/options.nix ./shared/minecraft/options.nix ./shared/oci-containers/options.nix ./shared/pleroma/options.nix ./shared/resolved/options.nix ./shared/restic-backups/options.nix ./shared/torrents/options.nix # host templates ./shared/host-templates/website-mirror/options.nix ]; }; optionsDoc = pkgs.nixosOptionsDoc { options = eval.options; }; in mkApp "documentation" '' PATH=${with pkgs; lib.makeBinPath [ coreutils gnused mdbook python3 ]} export NIXOS_OPTIONS_JSON="${optionsDoc.optionsJSON}/share/doc/nixos/options.json" ${pkgs.lib.fileContents ./scripts/documentation.sh} ''; }; }; } ================================================ FILE: hosts/carcosa/caddy/lainon-life/404.html ================================================ LAINON.LIFE IS DEAD

LAINON.LIFE IS DEAD

Never trust a hard drive

================================================ FILE: hosts/carcosa/caddy/www-lookwhattheshoggothdraggedin-com.caddyfile ================================================ # Removed error /files/privacy/analytics.png 410 error /glossary.html 410 error /privacy.html 410 # Redirected redir /arden-vul-6-months-in-censored/session-screenshot.png /post/arden-vul-6-months-in-censored/session-screenshot.png permanent redir /arden-vul-6-months-in/house-rules.pdf /post/arden-vul-6-months-in/house-rules.pdf permanent redir /arden-vul-6-months-in/miro-full.jpg /post/arden-vul-6-months-in/miro-full.jpg permanent redir /arden-vul-6-months-in/miro-level3.jpg /post/arden-vul-6-months-in/miro-level3.jpg permanent redir /arden-vul-6-months-in/session-screenshot.png /post/arden-vul-6-months-in/session-screenshot.png permanent redir /files/dice-rolls-in-call-of-cthulhu/all.png /post/dice-rolls-in-call-of-cthulhu/all.png permanent redir /files/dice-rolls-in-call-of-cthulhu/all.thumb.png /post/dice-rolls-in-call-of-cthulhu/all.thumb.png permanent redir /files/dice-rolls-in-call-of-cthulhu/basic.png /post/dice-rolls-in-call-of-cthulhu/basic.png permanent redir /files/dice-rolls-in-call-of-cthulhu/bonus.png /post/dice-rolls-in-call-of-cthulhu/bonus.png permanent redir /files/dice-rolls-in-call-of-cthulhu/difficulties.png /post/dice-rolls-in-call-of-cthulhu/difficulties.png permanent redir /files/dice-rolls-in-call-of-cthulhu/opposed-bonus.png /post/dice-rolls-in-call-of-cthulhu/opposed-bonus.png permanent redir /files/dice-rolls-in-call-of-cthulhu/opposed-penalty.png /post/dice-rolls-in-call-of-cthulhu/opposed-penalty.png permanent redir /files/dice-rolls-in-call-of-cthulhu/opposed.png /post/dice-rolls-in-call-of-cthulhu/opposed.png permanent redir /files/dice-rolls-in-call-of-cthulhu/penalty.png /post/dice-rolls-in-call-of-cthulhu/penalty.png permanent redir /files/dice-rolls-in-call-of-cthulhu/pushed.png /post/dice-rolls-in-call-of-cthulhu/pushed.png permanent redir /files/dice-rolls-in-traveller/basic.png /post/dice-rolls-in-traveller/basic.png permanent redir /files/dice-rolls-in-traveller/boon-bane.png /post/dice-rolls-in-traveller/boon-bane.png permanent redir /files/dice-rolls-in-traveller/difficulties.png /post/dice-rolls-in-traveller/difficulties.png permanent redir /files/dice-rolls-in-traveller/normalised-difficulties-trimmed.png /post/dice-rolls-in-traveller/normalised-difficulties-trimmed.png permanent redir /files/dice-rolls-in-traveller/normalised-difficulties.png /post/dice-rolls-in-traveller/normalised-difficulties.png permanent redir /files/dice-rolls-in-traveller/opposed-heat-chain-dm.png /post/dice-rolls-in-traveller/opposed-heat-chain-dm.png permanent redir /files/dice-rolls-in-traveller/opposed-heat.png /post/dice-rolls-in-traveller/opposed-heat.png permanent redir /files/dice-rolls-in-traveller/task-chain-dms.png /post/dice-rolls-in-traveller/task-chain-dms.png permanent redir /files/dice-rolls-in-traveller/task-chain-heat-unbound.png /post/dice-rolls-in-traveller/task-chain-heat-unbound.png permanent redir /files/dice-rolls-in-traveller/task-chain-heat.png /post/dice-rolls-in-traveller/task-chain-heat.png permanent redir /files/dice-rolls-in-traveller/try-again.png /post/dice-rolls-in-traveller/try-again.png permanent redir /files/first-impressions-troika/beef-steaks.jpg /post/first-impressions-troika/beef-steaks.jpg permanent redir /files/first-impressions-troika/book-interior.jpg /post/first-impressions-troika/book-interior.jpg permanent redir /files/first-impressions-troika/damage-table.jpg /post/first-impressions-troika/damage-table.jpg permanent redir /files/how-to-learn-a-new-system/pulp-cthulhu.pdf /post/how-to-learn-a-new-system/pulp-cthulhu.pdf permanent redir /files/how-to-learn-a-new-system/traveller.pdf /post/how-to-learn-a-new-system/traveller.pdf permanent redir /files/knock-issue-1/art.jpg /post/knock-issue-1/art.jpg permanent redir /files/knock-issue-1/leaving-kansas.jpg /post/knock-issue-1/leaving-kansas.jpg permanent redir /files/knock-issue-1/spine.jpg /post/knock-issue-1/spine.jpg permanent redir /files/troika-the-manse-of-mazirian/manse.png /post/troika-the-manse-of-mazirian/manse.png permanent redir /ironsworn/flowchart.png /post/ironsworn/flowchart.png permanent redir /ironsworn/move.png /post/ironsworn/move.png permanent redir /ironsworn/progress.png /post/ironsworn/progress.png permanent redir /ironsworn/sabine-4.1.png /post/ironsworn/sabine-4.1.png permanent redir /ironsworn/sabine-4.2.png /post/ironsworn/sabine-4.2.png permanent redir /ironsworn/sabine-4.3.png /post/ironsworn/sabine-4.3.png permanent redir /ironsworn/sabine-4.4.png /post/ironsworn/sabine-4.4.png permanent redir /ironsworn/sabine-4.5.png /post/ironsworn/sabine-4.5.png permanent redir /ironsworn/sabine.png /post/ironsworn/sabine.png permanent redir /izirions-enchiridion/book.jpg /post/izirions-enchiridion/book.jpg permanent redir /izirions-enchiridion/boots-of-cartography.jpg /post/izirions-enchiridion/boots-of-cartography.jpg permanent redir /izirions-enchiridion/danger-level.jpg /post/izirions-enchiridion/danger-level.jpg permanent redir /izirions-enchiridion/dice-rolls.jpg /post/izirions-enchiridion/dice-rolls.jpg permanent redir /traveller-cheatsheets/basics-no-houserules.pdf /post/traveller-cheatsheets/basics-no-houserules.pdf permanent redir /traveller-cheatsheets/basics.pdf /post/traveller-cheatsheets/basics.pdf permanent redir /traveller-cheatsheets/piracy.pdf /post/traveller-cheatsheets/piracy.pdf permanent redir /traveller-cheatsheets/spacecraft.pdf /post/traveller-cheatsheets/spacecraft.pdf permanent redir /traveller-cheatsheets/uwp.pdf /post/traveller-cheatsheets/uwp.pdf permanent ================================================ FILE: hosts/carcosa/configuration.nix ================================================ # This is a VPS (hosted by Hetzner Cloud). # # It serves [barrucadu.co.uk][] and other services on it. Websites are served # with Caddy, with certs from Let's Encrypt. # # It's set up in "erase your darlings" style, so most of the filesystem is wiped # on boot and restored from the configuration, to ensure there's no accidentally # unmanaged configuration or state hanging around. However, it doesn't reboot # automatically, because I also use this server for a persistent IRC connection. # # **Alerting:** enabled (standard only) # # **Backups:** enabled (standard + extras) # # **Public hostname:** `carcosa.barrucadu.co.uk` # # **Role:** server # # [barrucadu.co.uk]: https://www.barrucadu.co.uk/ { config, lib, pkgs, ... }: with lib; let httpdir = "${toString config.nixfiles.eraseYourDarlings.persistDir}/srv/http"; in { ############################################################################### ## General ############################################################################### networking.hostId = "f62895cc"; boot.supportedFilesystems = { zfs = true; }; # Bootloader boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; # Networking networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.interfaces.enp1s0 = { ipv6.addresses = [{ address = "2a01:4f8:c0c:bfc1::"; prefixLength = 64; }]; }; networking.defaultGateway6 = { address = "fe80::1"; interface = "enp1s0"; }; nixfiles.firewall.ipBlocklistFile = config.sops.secrets."nixfiles/firewall/ip_blocklist".path; sops.secrets."nixfiles/firewall/ip_blocklist" = { }; # No automatic reboots (for irssi) system.autoUpgrade.allowReboot = mkForce false; # Wipe / on boot nixfiles.eraseYourDarlings.enable = true; nixfiles.eraseYourDarlings.machineId = "64b1b10f3bef4616a7faf5edf1ef3ca5"; nixfiles.eraseYourDarlings.barrucaduPasswordFile = config.sops.secrets."users/barrucadu".path; sops.secrets."users/barrucadu".neededForUsers = true; # Monitoring services.prometheus.alertmanager.environmentFile = config.sops.secrets."services/alertmanager/env".path; sops.secrets."services/alertmanager/env" = { }; ############################################################################### ## Backups ############################################################################### nixfiles.restic-backups.enable = true; nixfiles.restic-backups.environmentFile = config.sops.secrets."nixfiles/restic-backups/env".path; nixfiles.restic-backups.checkRepositoryAt = "Wed, 12:00"; nixfiles.restic-backups.backups.github = { # TODO: this will break when I have >100 github repos # TODO: use a backup-specific SSH key? prepareCommand = '' ${pkgs.coreutils}/bin/mkdir repositories cd repositories ${pkgs.curl}/bin/curl -u "barrucadu:''${GITHUB_TOKEN}" 'https://api.github.com/user/repos?type=owner&per_page=100' 2>/dev/null | \ ${pkgs.jq}/bin/jq -r '.[].ssh_url' | \ while read url; do env GIT_SSH_COMMAND="${pkgs.openssh}/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /home/barrucadu/.ssh/id_ed25519" \ ${pkgs.git}/bin/git clone --bare "$url" done ''; paths = [ "repositories" ]; }; nixfiles.restic-backups.backups.syncthing = { paths = [ "/home/barrucadu/s" ]; }; sops.secrets."nixfiles/restic-backups/env" = { }; ############################################################################### ## Website Mirror ############################################################################### nixfiles.hostTemplates.websiteMirror = { enable = true; acmeEnvironmentFile = config.sops.secrets."services/acme/env".path; }; sops.secrets."services/acme/env" = { }; ############################################################################### ## Services ############################################################################### # WWW - there are more websites, see website-mirror services.caddy.enable = true; services.caddy.extraConfig = '' (common_config) { encode gzip header Permissions-Policy "interest-cohort=()" header Referrer-Policy "strict-origin-when-cross-origin" header Strict-Transport-Security "max-age=31536000; includeSubDomains" header X-Content-Type-Options "nosniff" header X-Frame-Options "SAMEORIGIN" header -Server } ''; services.caddy.virtualHosts."foundry.barrucadu.co.uk".extraConfig = '' import common_config reverse_proxy http://localhost:${toString config.nixfiles.foundryvtt.port} ''; services.caddy.virtualHosts."misc.barrucadu.co.uk".extraConfig = '' import common_config basicauth /_site/* { import ${config.sops.secrets."services/caddy/fragments/misc_site".path} } @subdirectory path_regexp ^/(7day|14day|28day|forever)/[a-z0-9] root * ${httpdir}/barrucadu.co.uk/misc file_server @subdirectory browse file_server ''; sops.secrets."services/caddy/fragments/misc_site".owner = config.users.users.caddy.name; services.caddy.virtualHosts."carcosa.barrucadu.co.uk".extraConfig = '' import common_config redir https://www.barrucadu.co.uk ''; services.caddy.virtualHosts."grafana.carcosa.barrucadu.co.uk".extraConfig = '' import common_config reverse_proxy http://localhost:${toString config.services.grafana.settings.server.http_port} ''; services.caddy.virtualHosts."prometheus.carcosa.barrucadu.co.uk".extraConfig = '' import common_config reverse_proxy http://localhost:${toString config.services.prometheus.port} ''; services.caddy.virtualHosts."git.barrucadu.dev".extraConfig = '' import common_config reverse_proxy http://127.0.0.1:${toString config.nixfiles.forgejo.port} ''; services.caddy.virtualHosts."registry.barrucadu.dev".extraConfig = '' import common_config basicauth /v2/* { import ${config.sops.secrets."services/caddy/fragments/registry".path} } header /v2/* Docker-Distribution-Api-Version "registry/2.0" reverse_proxy /v2/* http://127.0.0.1:${toString config.services.dockerRegistry.port} ''; sops.secrets."services/caddy/fragments/registry".owner = config.users.users.caddy.name; services.caddy.virtualHosts."lainon.life".extraConfig = '' import common_config root * ${./caddy/lainon-life} file_server handle_errors { @404 { expression {http.error.status_code} == 404 } rewrite @404 /404.html file_server } ''; services.caddy.virtualHosts."social.lainon.life".extraConfig = '' import common_config reverse_proxy http://127.0.0.1:${toString config.nixfiles.pleroma.port} ''; services.caddy.virtualHosts."www.lainon.life".extraConfig = '' import common_config redir https://lainon.life{uri} ''; services.caddy.virtualHosts."lookwhattheshoggothdraggedin.com".extraConfig = '' import common_config redir https://www.lookwhattheshoggothdraggedin.com{uri} ''; services.caddy.virtualHosts."www.lookwhattheshoggothdraggedin.com".extraConfig = '' import common_config header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data:" header /files/* Cache-Control "public, immutable, max-age=604800" header /fonts/* Cache-Control "public, immutable, max-age=31536000" header /logo.png Cache-Control "public, immutable, max-age=604800" header /*.css Cache-Control "public, immutable, max-age=31536000" header /twitter-cards/* Cache-Control "public, immutable, max-age=604800" root * ${httpdir}/lookwhattheshoggothdraggedin.com/www file_server handle_errors { @404 { expression {http.error.status_code} == 404 } @410 { expression {http.error.status_code} == 410 } rewrite @404 /404.html rewrite @410 /404.html file_server } ${fileContents ./caddy/www-lookwhattheshoggothdraggedin-com.caddyfile} ''; services.caddy.virtualHosts."uzbl.org".extraConfig = '' import common_config redir https://www.uzbl.org{uri} ''; services.caddy.virtualHosts."www.uzbl.org".extraConfig = '' import common_config rewrite /archives.php /index.php rewrite /faq.php /index.php rewrite /readme.php /index.php rewrite /keybindings.php /index.php rewrite /get.php /index.php rewrite /community.php /index.php rewrite /contribute.php /index.php rewrite /commits.php /index.php rewrite /news.php /index.php rewrite /doesitwork/ /index.php rewrite /fosdem2010/ /index.php redir /doesitwork /doesitwork/ redir /fosdem2020 /fosdem2020/ root * ${httpdir}/uzbl.org/www php_fastcgi unix//run/phpfpm/caddy.sock php_fastcgi /atom.xml unix//run/phpfpm/caddy.sock { split .xml } file_server ''; services.phpfpm.pools.caddy = { user = "caddy"; group = "caddy"; settings = { "listen" = "/run/phpfpm/caddy.sock"; "listen.owner" = "caddy"; "listen.group" = "caddy"; "pm" = "dynamic"; "pm.max_children" = "5"; "pm.start_servers" = "2"; "pm.min_spare_servers" = "1"; "pm.max_spare_servers" = "3"; "security.limit_extensions" = ".php .xml"; }; }; systemd.tmpfiles.rules = [ "d ${httpdir}/barrucadu.co.uk/misc/_site 0755 barrucadu users 1d" "d ${httpdir}/barrucadu.co.uk/misc/7day 0755 barrucadu users 7d" "d ${httpdir}/barrucadu.co.uk/misc/14day 0755 barrucadu users 14d" "d ${httpdir}/barrucadu.co.uk/misc/28day 0755 barrucadu users 28d" ]; # Docker registry services.dockerRegistry.enable = true; # Forgejo nixfiles.forgejo.enable = true; nixfiles.forgejo.domain = "git.barrucadu.dev"; nixfiles.forgejo.adminUserPasswordPath = config.sops.secrets."nixfiles/forgejo/admin_password".path; nixfiles.forgejo.runnerTokenPath = config.sops.secrets."nixfiles/forgejo/runner_token".path; sops.secrets."nixfiles/forgejo/admin_password" = { owner = "forgejo"; }; sops.secrets."nixfiles/forgejo/runner_token" = { }; # minecraft nixfiles.minecraft.enable = true; nixfiles.minecraft.servers.tea = { autoStart = false; port = 25565; jar = "fabric-server-launch.jar"; }; # Foundry VTT nixfiles.foundryvtt.enable = true; # social.lainon.life nixfiles.pleroma.enable = true; nixfiles.pleroma.domain = "social.lainon.life"; nixfiles.pleroma.faviconPath = ./pleroma-favicon.png; nixfiles.pleroma.secretsFile = config.sops.secrets."nixfiles/pleroma/exc".path; nixfiles.pleroma.allowRegistration = true; sops.secrets."nixfiles/pleroma/exc".owner = config.users.users.pleroma.name; ############################################################################### ## Remote Builds ############################################################################### users.users.nix-remote-builder = { uid = 983; home = "/var/lib/nix-remote-builder"; createHome = true; isSystemUser = true; shell = pkgs.bashInteractive; group = "nogroup"; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFzMpx7QNSAb5tCbkzMRIG62PvBZysflwwCKchFDHtY nix@yuggoth" ]; }; nix.settings.trusted-users = [ config.users.users.nix-remote-builder.name ]; ############################################################################### ## Miscellaneous ############################################################################### # Metrics services.grafana.settings = { server.root_url = "https://grafana.carcosa.barrucadu.co.uk"; security.admin_password = "$__file{${config.sops.secrets."services/grafana/admin_password".path}}"; security.secret_key = "$__file{${config.sops.secrets."services/grafana/secret_key".path}}"; }; sops.secrets."services/grafana/admin_password".owner = config.users.users.grafana.name; sops.secrets."services/grafana/secret_key".owner = config.users.users.grafana.name; services.prometheus.webExternalUrl = "https://prometheus.carcosa.barrucadu.co.uk"; # Extra packages users.users.barrucadu.packages = with pkgs; [ irssi perl ]; } ================================================ FILE: hosts/carcosa/hardware.nix ================================================ { ... }: { boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "local/volatile/root"; fsType = "zfs"; }; fileSystems."/home" = { device = "local/persistent/home"; fsType = "zfs"; }; fileSystems."/nix" = { device = "local/persistent/nix"; fsType = "zfs"; }; fileSystems."/persist" = { device = "local/persistent/persist"; fsType = "zfs"; neededForBoot = true; }; fileSystems."/var/log" = { device = "local/persistent/var-log"; fsType = "zfs"; }; fileSystems."/var/lib/containers" = { device = "/dev/disk/by-uuid/bbc94c9d-9e32-435b-9fe7-1290acb96a40"; fsType = "ext4"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/C83B-AA71"; fsType = "vfat"; }; swapDevices = [ ]; } ================================================ FILE: hosts/carcosa/secrets.yaml ================================================ users: barrucadu: ENC[AES256_GCM,data:5mAoxmMEn4zOhwDHS4cal7b0fPZb7SshS3QmfrBgLKQMJfExiRdnWvwnqTvLY/ObRTYqeWrcik+GVyeFF4gkMm8FxcR7U5ExIXBbtg5uDQgcvQYNlWEfJWEjVYrfKCoIxCAhUDf+2oNr,iv:YEpqdGz/DNdjxNmIrVgahEoH7BNYnqBEHV6L7UrV2aI=,tag:4teSWBW+SJ06KCoTMwjN6g==,type:str] nixfiles: forgejo: admin_password: ENC[AES256_GCM,data:4hgVpxFod0m+sizMAxWApHMCJLCra867Y9MHtBXW3+Z4,iv:dUcyD2xP4L38ldiHYMTCEuE7AUXJcVEgxszdhFC1prU=,tag:3ZNooGvOU2P4r0LbgYybTg==,type:str] runner_token: ENC[AES256_GCM,data:PL4c2RFaVGITrfBNO/rtf5rtCdFRyd7P2xf9eR/fRq4bzyDXpS0jE7r4jDQxZ6Q=,iv:qf6muCqZLWfyJCLcyevBFMSueyPDhYnVWYO5y5tOPZE=,tag:Fuo5PXS4SRqAm3oVoto74Q==,type:str] firewall: ip_blocklist: ENC[AES256_GCM,data:WgDvhHX/CTbbBRVJVr5v4nLQP5sxI8A5KomrSoXble7eUlAZeXqnhw4UT/EugIKaudZzVWovHe30G1U9W86X1/dgAj1S8hD0mA0TH6Qul3RfmQdqnZIdJXfDBLH1mF4OXaox6A==,iv:PVKlgOErmZGAC2tf5mW7d3S7vvMRclrpr+aDd/xJ1WI=,tag:EeXzbX9BELSCeBcxifbHPQ==,type:str] pleroma: exc: ENC[AES256_GCM,data:ZyA/hBlQs8S56oy7J1f9u36nYBFwWH4Ehq5VbjYDAxcThgP5x09qqt0G8URuLSbBZYuWOOrCjSF1gkt9oLKBPYw2bKxf0yg69GL8xkBtZuJU9NNLXcVswG8HZFWG6Rwa6F65GIHQWdZLwkA8ef5RcYD77FFV3YG4qCIxyH5efyVd0xTO7ukuapGC23mRPd1auUNHlTt0/mac8a+wjBmG175j2MFnzDj7e4Z2ynqgSVrkM/DKm4/xiED5J1vNpPQAkNWouzELo70x7XsLk8/WIVXtsLI24OEo+BE+9/pf9T+RObftUDMnSejhLFadKTqa7QHh6RJgV1lkJL+ZvDm5XY962BzJrMw/3N+h30qD+QCmkuyLqIbTAP7nFeJ7iumU1Bgv6ojLPtrxLX4TE/lP9Mv9JG1/w+4oMAeSv5t/uFw4pI4P07c5cGRwE9VHIT57roJ6beKRD/3p7FJxeEFOu5/O9EoxHTCjXWXMrdEM6bYfMMQZYBM7p8Ve0bE=,iv:4njRxb8LiKdW5YgQEP2Esvh8/yKHpiCxTiL/n6b+c5M=,tag:lPqLddPhY0r0rnuxtwvwIg==,type:str] restic-backups: env: ENC[AES256_GCM,data:Uls7HrNxFyoMZf3u4zNSk/F3XIYE1mQotcCvnNggvbOqA9RVK9FQpIfqJms8WtKZl6ol15rHW+au73QldJ9TE2Km7EJmCSa87AmRQ1Azt0lrJtn+v9l9rFqnu82WSD2awv8geB82OPQ0/w2x9W4qHPXw3teYx9p9Kiz/C1NVw0Z9TlsChKHsVpR6FVdyB8FY8zZG0Z1iuzDHMr6q9QsI8pMn5DkCruYhcg8R6GR73naWQb0nHxx3oFfNR3KtPHQn8diJZsv0+Hh2IWbHyPRlJOs+WYJtVc7LbqjB1jPrTozqteijclVSHAoB1RTQ7gVe9TiYdQIhOJswo89xH4l7U/D9wYH7tGRlrrKz8F8iUQR02G7gADftmwI9kekhCjGDgSudYrRJ//UCJKTn6bSsEpW0Eg9knozFCUOhc5RREmX7JyKA,iv:BqaFmxO+HRZzQchypReabxer0XwHW9KSsA1lfhWmdIM=,tag:3rJjQm+kLRMscygvkLHTcw==,type:str] services: acme: env: ENC[AES256_GCM,data:+kgHlD5tlcZbNiqeLnF0Ow82UqmgiGmSAoBZ3o6zqdKTfDIVSTS/0ChYopbngi1/HW5Imx6uikfXnLUx7YMgXkcxOdEWzopVMGBf3NWIlBqmBhvxVhpoYI8E+rIN+f4Sf5OKNq1NUluZ5XKzg7qWRW66dWEaKzjgD81v8RUp94C0dKY=,iv:nZAQBmXO7VRe/RW5Vn8ha0B3kx/6aEBUTSUacuyFS1o=,tag:csCiEGlGc0jPy/AHPm8z9g==,type:str] alertmanager: env: ENC[AES256_GCM,data:0XJmdUlSzYnfKrovd/MpjXpSmazltAc8mgalp8U1nv30ek7OIZJS2ehih26UiwMf9pa/yx4lfoWQlU4Zx4eF7kep/rcr74sznFGRAYxvfVs1DTaWOuvSUqs1ZQOk8xTv5MAxBgP/,iv:F5aHKGSAJO762dXdwhWSCMhanLE/Z/Kbt2rqy+BFSLk=,tag:+/cZRlSzpGjgNQmr8f7dlQ==,type:str] caddy: fragments: misc_site: ENC[AES256_GCM,data:y8VPYPzlrdFdODmbtZ8o7aMKm+hZLpc0kkuXatth29RfsN1XO1sfgIj4bPmDpUUf5yQQLsKK4F/cULnhMU0TOhOMKHzTduh59b6pxmJgbufETX1Hghnq+zLx,iv:QgbGVm3Vj1PtU6/W31xDUoxtPSgS8ot8IBqOxfeaJQk=,tag:kLfPVxrLdxtXwfIHC2y8Rg==,type:str] registry: ENC[AES256_GCM,data:TMXUTbMzpP8QHW4aAyW2auGQYFhV3cHjfne0AnQ+CFI41A/3SuelQumQR17HOr9Z/Hs5LQQ9QssqQlhwOEMCIuTu2x81AUuEdineJc1T/xq1nhCrWA8olVI=,iv:dov05Z5jkB44lEQI0DPieDjT9thfHJE1vTiIYZbA79M=,tag:fIBo46vac8Ciu/dO1Bl18A==,type:str] grafana: admin_password: ENC[AES256_GCM,data:nGzl+HjDKz/ushife6YLCXtzTpIlHrbqPFWxsV3QxhG5FwXj5+vPNo8Pyg==,iv:j+ZS5PXFqV7t/mGK5lRQv0pG7+sh2BHy3N7MQ0YgWTY=,tag:F9r2iiMxG4xnFIz0vnP88w==,type:str] secret_key: ENC[AES256_GCM,data:KeWJ9AVXCYjFgaFWbV7rqGRKOLT+lqzLP/p3Dajnemk=,iv:rfcm8PordRN0bCQmIQ7flZ/ShaCG1X30wUtHDjLD79Q=,tag:C+Ze2RmQ9yfR5/6K6oMqlA==,type:str] sops: age: - recipient: age1sdnp5uxhdtujc78penv2gntnenzcfju7est4hslz6eqgfk26u9nskkk634 enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3M1Fvdlo4RjdKcCtQZ20v ODA3aklyaHNQdWtiQVRZejFJL3A1QjFvY0cwCnhuVlUvRzdZQzhaQlFsVDg1MWhN akhMT0RQV20wbkhCOTk1eVR3TThhYUkKLS0tIE5ncVZ4ZXh3Y3hWWHdwTHpPQVd5 cTJ6cWF3WUxKdG95R1I2QmNxUlMxblEKZWY5u1NCQfLW4NipX9f5txgZnopWIykD kFfbaTn0cv9lKSJJKcY3t5WPASc1/Hd52ANzpa4qUBMoirLAmrfkOw== -----END AGE ENCRYPTED FILE----- - recipient: age1ty4vs59695vuavnvgdftguyq2aau29nv75y4tqrr6ag8z26vfc5sc5rc4n enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6OS9iYVJkdXlvR29UU20y ZFpqK0Rmd1g5bE8zOEtsTHlNOFRjS3p1TFVJClBBREw0V0xNd2ZwVENheUVXR1FR a1ovNlZFQys2a1pNOWRaR0xrZzFpazQKLS0tIHF1cUlkQ0JOeHM1ekZ5NWV3V2NE dTQwclBRU3JmQ2hBOFVlaVIxZHN4cVEKvVR1bSH4yo2Td8YGNI2hmflT0M3hcYu8 qyYoWd5MFP9VBYKxrF8W2naQSY6Ax4IiVuNbKDDLFooTC93V+oxNDA== -----END AGE ENCRYPTED FILE----- lastmodified: "2026-05-06T20:08:42Z" mac: ENC[AES256_GCM,data:XGh1OnFfCcIJI8omyFwj/oQEPxFKlDuQBwQCBJBOK5LBxt6hVmYrg6va4qvMwORpkwSc9aPnPLWP3j+xGK7jM52UL025ZJavQWQIYL+9PH+Bi1MHwW+XjXna0gkStG9ZGe0zng7sFl9A4BvAg0pDwo45t6DxlS0+S4YE6lW+zLA=,iv:Jpd/a+jXG5mljq6CU7auWeJ78Q9NMc7L3TNpYQYPSkk=,tag:wWoLzAFKavZw1d4BkVk3Hg==,type:str] unencrypted_suffix: _unencrypted version: 3.12.1 ================================================ FILE: hosts/nyarlathotep/configuration.nix ================================================ # This is my home server. # # It runs writable instances of the bookdb and bookmarks services, which have # any updates copied across to carcosa hourly; it acts as a NAS; and it runs a # few utility services. # # Like carcosa, this host is set up in "erase your darlings" style but, unlike # carcosa, it automatically reboots to install updates: so that takes effect # significantly more frequently. # # **Alerting:** enabled (standard only) # # **Backups:** enabled (standard + extras) # # **Public hostname:** n/a # # **Role:** server { config, pkgs, lib, ... }: # Bring names from 'lib' into scope. with lib; let sharesPublic = [ "anime" "misc" "music" "movies" "tv" "torrents" ]; sharesPrivate = [ "private" ]; prometheusAwairExporterPort = 9517; httpdir = "${toString config.nixfiles.eraseYourDarlings.persistDir}/srv/http"; in { ############################################################################### ## General ############################################################################### networking.hostId = "4a592971"; # ZFS needs one of these boot.supportedFilesystems = { zfs = true; }; # Bootloader boot.loader.systemd-boot.enable = true; # Enable memtest boot.loader.systemd-boot.memtest86.enable = true; # Firewall networking.firewall.allowedTCPPorts = [ 80 8888 32400 # Plex ]; # Wipe / on boot nixfiles.eraseYourDarlings.enable = true; nixfiles.eraseYourDarlings.machineId = "0f7ae3bda2a9428ab77a0adddc4c8cff"; nixfiles.eraseYourDarlings.barrucaduPasswordFile = config.sops.secrets."users/barrucadu".path; sops.secrets."users/barrucadu".neededForUsers = true; # Set up a bridge network so that VMs can connect to the LAN # # `enp8s0` is the physical ethernet interface, but I am slaving that to the # `br0` bridge - so it's the bridge's MAC address that gets presented to the # physical network. # # To avoid having to reconfigure static IP assignments in my router if I # switch between bridged and non-bridged networking, set up the MAC addresses # such that: # # - `br0` has the MAC address of the physical ethernet card # - `enp8s0` has a new random MAC address (https://serverfault.com/a/631119) # # So if I delete this block, the MAC address the router sees is unchanged, and # so the static IP assignment is unaffected. networking.useDHCP = false; networking.interfaces.br0 = { useDHCP = true; macAddress = "a0:36:bc:bb:65:8d"; }; networking.interfaces.enp8s0 = { macAddress = "92:0b:e6:21:86:99"; useDHCP = true; }; networking.bridges.br0.interfaces = [ "enp8s0" ]; virtualisation.libvirtd.enable = true; virtualisation.libvirtd.allowedBridges = [ "br0" ]; ############################################################################### ## Backups ############################################################################### nixfiles.restic-backups.enable = true; nixfiles.restic-backups.environmentFile = config.sops.secrets."nixfiles/restic-backups/env".path; nixfiles.restic-backups.backups.torrents = { prepareCommand = '' ${pkgs.python3}/bin/python3 ${./jobs/restic-prepare--hardlink-torrent-files.py} > hardlink-torrent-files.sh ''; paths = [ "hardlink-torrent-files.sh" "/mnt/nas/torrents/watch" ]; }; nixfiles.restic-backups.backups.youtube = { prepareCommand = '' ${pkgs.python3}/bin/python3 ${./jobs/restic-prepare--fetch-youtube.py} > fetch-youtube.sh ''; paths = [ "fetch-youtube.sh" ]; }; sops.secrets."nixfiles/restic-backups/env" = { }; ############################################################################### ## DNS ############################################################################### nixfiles.resolved.enable = true; nixfiles.resolved.address = "10.0.0.3:53"; nixfiles.resolved.cacheSize = 1000000; nixfiles.resolved.hostsDirs = [ "/etc/dns/hosts" ]; nixfiles.resolved.zonesDirs = [ "/etc/dns/zones" ]; environment.etc."dns/hosts/stevenblack".source = let commit = "14b698abcd97446bae349292aacc9ecb4feb2db5"; in builtins.fetchurl { url = "https://raw.githubusercontent.com/StevenBlack/hosts/${commit}/hosts"; sha256 = "1hwyn1w1c7brzigp7fqpsgh107pzvsrahilq6n90jw7yzvi704gl"; }; environment.etc."dns/zones/10.in-addr.arpa".text = '' $ORIGIN 10.in-addr.arpa. @ IN SOA . . 3 3600 3600 3600 3600 1.0.0 IN PTR router.lan. 3.0.0 IN PTR nyarlathotep.lan. 117.20.0 IN PTR living-room.awair.lan. 130.20.0 IN PTR guest-bedroom.awair.lan. 187.20.0 IN PTR bedroom.awair.lan. 194.20.0 IN PTR office.awair.lan. ''; environment.etc."dns/zones/lan".text = '' $ORIGIN lan. @ 300 IN SOA @ @ 6 300 300 300 300 router 300 IN A 10.0.0.1 nyarlathotep 300 IN A 10.0.0.3 *.nyarlathotep 300 IN CNAME nyarlathotep help 300 IN CNAME nyarlathotep *.help 300 IN CNAME help nas 300 IN CNAME nyarlathotep bedroom.awair 300 IN A 10.0.20.187 guest-bedroom.awair 300 IN A 10.0.20.130 living-room.awair 300 IN A 10.0.20.117 office.awair 300 IN A 10.0.20.194 ''; ############################################################################### ## Network storage ############################################################################### # Samba services.samba.enable = true; services.samba.openFirewall = true; services.samba.settings = let mkPublic = n: nameValuePair n { path = "/mnt/nas/${n}"; writable = "yes"; }; mkPrivate = n: nameValuePair n { path = "/mnt/nas/${n}"; writable = "yes"; "valid users" = ["barrucadu"]; }; in listToAttrs (map mkPublic sharesPublic ++ map mkPrivate sharesPrivate); # Guest user for Samba users.users.notbarrucadu = { uid = 1001; description = "Guest user"; isNormalUser = true; group = "users"; hashedPasswordFile = config.sops.secrets."users/notbarrucadu".path; shell = "/run/current-system/sw/bin/nologin"; }; sops.secrets."users/notbarrucadu".neededForUsers = true; ############################################################################### ## Reverse proxy ############################################################################### services.caddy.enable = true; services.caddy.extraConfig = '' (vlan_matchers) { @vlan1 remote_ip 10.0.0.0/24 @not_vlan1 not remote_ip 10.0.0.0/24 @vlan10 remote_ip 10.0.10.0/24 @not_vlan10 not remote_ip 10.0.10.0/24 @vlan20 remote_ip 10.0.20.0/24 @not_vlan20 not remote_ip 10.0.20.0/24 } (restrict_vlan) { import vlan_matchers redir @vlan20 http://help.lan 307 } ''; services.caddy.virtualHosts."nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip file_server { root ${httpdir}/nyarlathotep.lan } ''; services.caddy.virtualHosts."alertmanager.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.services.prometheus.alertmanager.port} ''; services.caddy.virtualHosts."bookdb.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.nixfiles.bookdb.port} ''; services.caddy.virtualHosts."bookmarks.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.nixfiles.bookmarks.port} ''; services.caddy.virtualHosts."flood.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.nixfiles.torrents.rpcPort} ''; services.caddy.virtualHosts."finder.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.nixfiles.finder.port} ''; services.caddy.virtualHosts."grafana.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.services.grafana.settings.server.http_port} ''; services.caddy.virtualHosts."rpg-tools.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip file_server { root ${httpdir}/rpg-tools.nyarlathotep.lan } ''; # don't restrict vlan as the port is open unrestricted anyway services.caddy.virtualHosts."plex.nyarlathotep.lan:80".extraConfig = '' encode gzip reverse_proxy http://localhost:32400 ''; services.caddy.virtualHosts."prometheus.nyarlathotep.lan:80".extraConfig = '' import restrict_vlan encode gzip reverse_proxy http://localhost:${toString config.services.prometheus.port} ''; services.caddy.virtualHosts."help.lan:80".extraConfig = '' import vlan_matchers redir @vlan1 http://vlan1.help.lan 302 redir @vlan10 http://vlan10.help.lan 302 redir @vlan20 http://vlan20.help.lan 302 ''; services.caddy.virtualHosts."vlan1.help.lan:80".extraConfig = '' import vlan_matchers encode gzip redir @not_vlan1 http://help.lan 302 file_server { root ${httpdir}/vlan1.help.lan } ''; services.caddy.virtualHosts."vlan10.help.lan:80".extraConfig = '' import vlan_matchers encode gzip redir @not_vlan10 http://help.lan 302 file_server { root ${httpdir}/vlan10.help.lan } ''; services.caddy.virtualHosts."vlan20.help.lan:80".extraConfig = '' import vlan_matchers encode gzip redir @not_vlan20 http://help.lan 302 file_server { root ${httpdir}/vlan20.help.lan } ''; services.caddy.virtualHosts."*:80".extraConfig = '' respond * 421 ''; ############################################################################### ## bookdb - https://github.com/barrucadu/bookdb ############################################################################### nixfiles.bookdb.enable = true; ############################################################################### ## bookmarks - https://github.com/barrucadu/bookmarks ############################################################################### nixfiles.bookmarks.enable = true; ############################################################################### ## finder ############################################################################### nixfiles.finder.enable = true; nixfiles.finder.image = "localhost:${toString config.services.dockerRegistry.port}/finder:latest"; nixfiles.finder.mangaDir = "/mnt/nas/private"; ############################################################################### ## torrents ############################################################################### nixfiles.torrents.enable = true; nixfiles.torrents.downloadDir = "/mnt/nas/torrents/files"; nixfiles.torrents.watchDir = "/mnt/nas/torrents/watch"; nixfiles.torrents.user = "barrucadu"; nixfiles.torrents.group = "users"; ############################################################################### ## Network Media ############################################################################### services.plex.enable = true; services.plex.dataDir = "/persist/var/lib/plex"; ############################################################################### # Monitoring & Dashboards ############################################################################### services.prometheus.alertmanager.environmentFile = config.sops.secrets."services/alertmanager/env".path; sops.secrets."services/alertmanager/env" = { }; services.grafana = { settings.server.root_url = "http://grafana.nyarlathotep.lan"; provision = { datasources.settings.datasources = [ { name = "victoriametrics"; url = "http://${config.services.victoriametrics.listenAddress}"; type = "prometheus"; } ]; dashboards.settings.providers = let dashboard = folder: name: path: { inherit name folder; options.path = path; }; in [ (dashboard "My Dashboards" "finance.json" ./dashboards/finance.json) (dashboard "My Dashboards" "smart-home.json" ./dashboards/smart-home.json) ]; }; }; services.prometheus.webExternalUrl = "http://prometheus.nyarlathotep.lan"; services.prometheus.scrapeConfigs = [ { job_name = "awair"; static_configs = [{ targets = [ "localhost:${toString prometheusAwairExporterPort}" ]; }]; } ]; systemd.services.prometheus-awair-exporter = { description = "barrucadu/prometheus-awair-exporter metrics exporter"; wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; serviceConfig = { ExecStart = concatStringsSep " " [ "${pkgs.nixfiles.prometheus-awair-exporter}/bin/prometheus-awair-exporter" "--address 127.0.0.1:${toString prometheusAwairExporterPort}" "--sensor bedroom:10.0.20.187" "--sensor guest-bedroom:10.0.20.130" "--sensor living-room:10.0.20.117" "--sensor office:10.0.20.194" ]; DynamicUser = "true"; Restart = "on-failure"; }; }; ############################################################################### ## Docker registry (currently just used on this machine) ############################################################################### services.dockerRegistry.enable = true; virtualisation.containers.registries.insecure = [ "localhost:${toString config.services.dockerRegistry.port}" ]; ############################################################################### # Automatic music tagging ############################################################################### systemd.services.tag-podcasts = { enable = true; description = "Automatically tag new podcast files"; wantedBy = [ "multi-user.target" ]; path = with pkgs; [ ffmpeg inotify-tools id3v2 ]; unitConfig.RequiresMountsFor = "/mnt/nas"; serviceConfig = { WorkingDirectory = "/mnt/nas/music/Podcasts/"; ExecStart = pkgs.writeShellScript "tag-podcasts.sh" (fileContents ./jobs/tag-podcasts.sh); User = "barrucadu"; Group = "users"; Restart = "always"; }; }; systemd.paths.flac-and-tag-album = { enable = true; description = "Automatically flac and tag new albums"; wantedBy = [ "multi-user.target" ]; unitConfig.RequiresMountsFor = "/mnt/nas"; pathConfig.PathExistsGlob = "/mnt/nas/music/to_convert/in/*"; }; systemd.services.flac-and-tag-album = { path = with pkgs; [ flac ]; serviceConfig = { WorkingDirectory = "/mnt/nas/music/to_convert/in/"; ExecStart = pkgs.writeShellScript "flac-and-tag-album.sh" (fileContents ./jobs/flac-and-tag-album.sh); User = "barrucadu"; Group = "users"; }; }; ############################################################################### # Finance dashboard & FX rate fetching ############################################################################### systemd.services.hledger-fetch-fx-rates = { description = "Download GBP exchange rates for commodities"; startAt = "*-*-* 21:00:00"; path = with pkgs; [ hledger ]; serviceConfig = { ExecStart = let python = pkgs.python3.withPackages (ps: [ ps.requests ]); in "${python}/bin/python3 ${pkgs.writeText "hledger-fetch-fx-rates.py" (fileContents ./jobs/hledger-fetch-fx-rates.py)}"; User = "barrucadu"; Group = "users"; }; environment = { PRICE_FILE = "/home/barrucadu/s/ledger/prices"; }; }; systemd.services.hledger-export-to-victoriametrics = { description = "Export personal finance data to VictoriaMetrics"; startAt = "daily"; path = with pkgs; [ hledger ]; serviceConfig = { ExecStart = let python = pkgs.python3.withPackages (ps: [ ps.requests ]); in "${python}/bin/python3 ${pkgs.writeText "hledger-export-to-victoriametrics.py" (fileContents ./jobs/hledger-export-to-victoriametrics.py)}"; User = "barrucadu"; Group = "users"; }; environment = { LEDGER_FILE = "/home/barrucadu/s/ledger/combined.journal"; VICTORIAMETRICS_URI = "http://${config.services.victoriametrics.listenAddress}"; }; }; # also reload data after boot systemd.timers.hledger-export-to-victoriametrics.timerConfig.OnBootSec = "5m"; services.victoriametrics = { enable = true; listenAddress = "127.0.0.1:8428"; retentionPeriod = "10y"; }; ############################################################################### # Remote Sync ############################################################################### nixfiles.bookdb.remoteSync.send.enable = true; nixfiles.bookdb.remoteSync.send.sshKeyFile = config.sops.secrets."users/bookdb_remote_sync/ssh_private_key".path; nixfiles.bookdb.remoteSync.send.targets = [ "carcosa.barrucadu.co.uk" "yuggoth.barrucadu.co.uk" ]; sops.secrets."users/bookdb_remote_sync/ssh_private_key" = { owner = config.users.users.bookdb-remote-sync-send.name; key = "users/remote_sync/ssh_private_key"; }; nixfiles.bookmarks.remoteSync.send.enable = true; nixfiles.bookmarks.remoteSync.send.sshKeyFile = config.sops.secrets."users/bookmarks_remote_sync/ssh_private_key".path; nixfiles.bookmarks.remoteSync.send.targets = [ "carcosa.barrucadu.co.uk" "yuggoth.barrucadu.co.uk" ]; sops.secrets."users/bookmarks_remote_sync/ssh_private_key" = { owner = config.users.users.bookmarks-remote-sync-send.name; key = "users/remote_sync/ssh_private_key"; }; ############################################################################### # RSS-to-Mastodon ############################################################################### users.users.rss-to-mastodon = { uid = 991; home = "/persist/var/lib/rss-to-mastodon"; createHome = true; isSystemUser = true; group = "nogroup"; }; systemd.services.rss-to-mastodon-kjp-hacksrus = { description = "Publish King James Programming to hacksrus.xyz"; startAt = "hourly"; serviceConfig = { ExecStart = let python = pkgs.python3.withPackages (ps: [ ps.beautifulsoup4 ps.docopt ps.feedparser ps.requests ]); in concatStringsSep " " [ "${python}/bin/python3" (pkgs.writeText "rss-to-mastodon.py" (fileContents ./jobs/rss-to-mastodon.py)) "--use-summary" "-d https://hacksrus.xyz/" "-f https://kingjamesprogramming.tumblr.com/rss" "-l /persist/var/lib/rss-to-mastodon/kjp-hacksrus.txt" ]; User = "rss-to-mastodon"; EnvironmentFile = config.sops.secrets."users/rss_to_mastodon/kjp_hacksrus_env".path; }; }; sops.secrets."users/rss_to_mastodon/kjp_hacksrus_env" = { }; } ================================================ FILE: hosts/nyarlathotep/dashboards/finance.json ================================================ { "annotations": { "list": [ { "$$hashKey": "object:321", "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 4, "links": [], "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 0, "y": 0 }, "id": 101, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Net Worth", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 4, "y": 0 }, "id": 61, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n)\r\n+ on(target_currency)\r\n(\r\n sum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"liabilities:mortgage\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n)", "hide": false, "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Net Worth (ex. property)", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "decimals": 1, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 0.33 }, { "color": "green", "value": 0.5 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 8, "y": 0 }, "id": 62, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "mean" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "value", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "# saved income\r\n(\r\n sum(hledger_monthly_decrease{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_monthly_increase{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n # ignore pension contributions (assumes pensions only go up - include 'decrease' as well to handle January roll-over)\r\n - on(target_currency)\r\n (\r\n sum(hledger_monthly_increase{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency) -\r\n sum(hledger_monthly_decrease{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n )\r\n)\r\n\r\n/ on(target_currency)\r\n\r\n# net income\r\n(\r\n sum(hledger_monthly_decrease{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_monthly_increase{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n # as above\r\n - on(target_currency)\r\n (\r\n sum(hledger_monthly_increase{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency) -\r\n sum(hledger_monthly_decrease{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n )\r\n)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Savings Rate", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 60 }, { "color": "green", "value": 90 } ] }, "unit": "d" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 0 }, "id": 63, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "# total available cash and emergency fund\r\n(\r\n sum(hledger_balance{account=\"assets:cash\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on (target_currency)\r\n sum(hledger_balance{account=\"assets:investments:nsi:premium_bonds:emergency\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n)\r\n\r\n/ on (target_currency)\r\n\r\n# average daily expense\r\n(\r\n (\r\n sum(hledger_balance{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n ) / $agg_window\r\n)", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Short Runway", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 60 }, { "color": "green", "value": 90 } ] }, "unit": "d" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 16, "y": 0 }, "id": 85, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n)\r\n/ on (target_currency)\r\n\r\n# average daily expense\r\n(\r\n (\r\n sum(hledger_balance{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n ) / $agg_window\r\n)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Long Runway", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "#EAB839", "value": 0.5 }, { "color": "green", "value": 0.75 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 20, "y": 0 }, "id": 72, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "# all assets (sans pension)\r\n(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n)\r\n\r\n/ on(target_currency)\r\n\r\n# FIRE number\r\n(\r\n (\r\n sum(hledger_balance{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n ) / $agg_window * 365 * $fire_annual_factor\r\n)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "FIRE Progress", "transparent": true, "type": "stat" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 3 }, "id": 109, "panels": [], "title": "Overview", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "#299c46", "value": 0 }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "#d44a3a", "value": 25 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 4 }, "id": 21, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_transactions_total) without(status)", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Total Transactions", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "fieldMinMax": false, "mappings": [], "max": 500000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Cash" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Funds" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Premium Bonds" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Receivable" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Target: AAW" }, "properties": [ { "id": "color", "value": { "fixedColor": "rgb(117, 12, 24)", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Target: FIRE" }, "properties": [ { "id": "color", "value": { "fixedColor": "light-red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Target: PAW" }, "properties": [ { "id": "color", "value": { "fixedColor": "dark-red", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/Target.*/" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.stacking", "value": { "group": false, "mode": "none" } }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "Property" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] }, { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "Receivable", "Premium Bonds", "Funds", "Cash", "Target: AAW", "Target: PAW", "Target: FIRE" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": true, "viz": true } } ] } ] }, "gridPos": { "h": 8, "w": 13, "x": 4, "y": 4 }, "id": 68, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Property", "range": true, "refId": "AssetsProperty" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:receivable\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "null" ], "type": "fill" } ], "hide": false, "interval": "", "legendFormat": "Receivable", "orderByTime": "ASC", "policy": "default", "refId": "AssetsReceivable", "resultFormat": "time_series", "select": [ [ { "params": [ "value" ], "type": "field" }, { "params": [], "type": "mean" } ] ], "tags": [] }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:investments:nsi:premium_bonds\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Premium Bonds", "refId": "AssetsPremiumBonds" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:investments\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"assets:investments:nsi:premium_bonds\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Funds", "refId": "AssetsFunds" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:cash\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Cash", "refId": "AssetsCash" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n # average daily income\r\n (\r\n sum(hledger_balance{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"income\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"income:gift\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"income:gift\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n ) / $agg_window * -1\r\n\r\n # age/10 years worth\r\n * 365 * ignoring(unit) quantified_self_age{unit=\"years\"} / 10\r\n) / 2\r\n\r\n# ignore gifted income\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"income:gift\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n\r\n# add (subtract) liabilities, other than student loan & mortgage\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:loan:slc\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:mortgage\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)", "hide": false, "interval": "", "legendFormat": "Target: AAW", "range": true, "refId": "TargetAAW" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n # average daily income\r\n (\r\n sum(hledger_balance{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"income\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"income:gift\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"income:gift\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n ) / $agg_window * -1\r\n\r\n # age/10 years worth\r\n * 365 * ignoring(unit) quantified_self_age{unit=\"years\"} / 10\r\n) * 2\r\n\r\n# ignore gifted income\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"income:gift\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n\r\n# add (subtract) liabilities, other than student loan & mortgage\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:loan:slc\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:mortgage\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)", "hide": false, "interval": "", "legendFormat": "Target: PAW", "range": true, "refId": "TargetPAW" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "# average daily expense\r\n(\r\n sum(hledger_balance{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) / $agg_window\r\n\r\n# $fire_annual_factor years worth\r\n* 365 * $fire_annual_factor", "hide": false, "interval": "", "legendFormat": "Target: FIRE", "refId": "TargetFIRE" } ], "title": "Assets (Stacked)", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "decimals": 2, "mappings": [], "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Cash" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Funds" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Premium Bonds" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Receivable" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Property" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] }, { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "Cash", "Funds", "Premium Bonds", "Receivable" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": true, "viz": true } } ] } ] }, "gridPos": { "h": 8, "w": 3, "x": 17, "y": 4 }, "id": 69, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true, "values": [ "value" ] }, "pieType": "donut", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "sort": "desc", "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:cash\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "Cash", "refId": "Cash" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:investments\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n- on(target_currency)\r\nsum(hledger_balance{account=\"assets:investments:nsi:premium_bonds\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Funds", "refId": "Funds" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:investments:nsi:premium_bonds\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Premium Bonds", "refId": "PremiumBonds" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:receivable\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Receivable", "refId": "Receivable" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Property", "range": true, "refId": "Property" } ], "title": "Current Allocation", "transparent": true, "type": "piechart" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 20, "y": 4 }, "id": 87, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) * 0.04", "interval": "", "legendFormat": "4.0%", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) * 0.035", "hide": false, "interval": "", "legendFormat": "3.5%", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) * 0.03", "hide": false, "interval": "", "legendFormat": "3.0%", "range": true, "refId": "C" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "(\r\n sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"assets:property\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) * 0.025", "hide": false, "interval": "", "legendFormat": "2.5%", "range": true, "refId": "D" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "(\r\n sum(hledger_balance{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n - on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n + on(target_currency)\r\n sum(hledger_balance{account=\"expenses:gross\"} offset ${agg_window}d * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by (target_currency)\r\n) / $agg_window * 365", "hide": false, "legendFormat": "Target", "range": true, "refId": "E" } ], "title": "Safe Withdrawal Rate", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "#299c46", "value": 0 }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "#d44a3a", "value": 25 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 0, "y": 6 }, "id": 17, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_transactions_total{status=\"cleared\"}", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Cleared", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "#299c46", "value": 0 }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "#d44a3a", "value": 25 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 2, "y": 6 }, "id": 18, "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_transactions_total{status=\"pending\"}", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Uncleared", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "#299c46", "value": 0 }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "#d44a3a", "value": 25 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 0, "y": 9 }, "id": 19, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_transactions_total{status=\"bookkeeping\"}", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Bookkeeping", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "#299c46", "value": 0 }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "#d44a3a", "value": 25 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 2, "y": 9 }, "id": 20, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_transactions_total{status=\"bookkeeping\"}\r\n/ ignoring(status)\r\nsum(hledger_transactions_total) without(status)", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Bookkeeping", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Delta" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "Total Assets" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total Liabilities" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 12 }, "id": 23, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Total Assets", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Total Liabilities", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Delta", "refId": "C" } ], "title": "Net Worth", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Expenses" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Savings Rate" }, "properties": [ { "id": "unit", "value": "percentunit" }, { "id": "custom.drawStyle", "value": "line" }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.lineInterpolation", "value": "stepAfter" }, { "id": "custom.axisSoftMin", "value": -1 }, { "id": "custom.axisSoftMax", "value": 1 }, { "id": "custom.lineWidth", "value": 2 } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 12 }, "id": 58, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(hledger_monthly_decrease{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n- on(target_currency)\r\nsum(hledger_monthly_increase{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n\r\n# ignore pension contributions (assumes pensions only go up - include 'decrease' as well to handle January roll-over)\r\n- on(target_currency)\r\n(\r\n sum(hledger_monthly_increase{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency) -\r\n sum(hledger_monthly_decrease{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n)", "hide": false, "interval": "", "legendFormat": "Income (net)", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(hledger_monthly_increase{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n- on(target_currency)\r\nsum(hledger_monthly_increase{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Expenses", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "# saved income\r\n(\r\n sum(hledger_monthly_decrease{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_monthly_increase{account=\"expenses\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n # ignore pension contributions (assumes pensions only go up - include 'decrease' as well to handle January roll-over)\r\n - on(target_currency)\r\n (\r\n sum(hledger_monthly_increase{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency) -\r\n sum(hledger_monthly_decrease{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n )\r\n)\r\n\r\n/ on(target_currency)\r\n\r\n# net income\r\n(\r\n sum(hledger_monthly_decrease{account=\"income\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n - on(target_currency)\r\n sum(hledger_monthly_increase{account=\"expenses:gross\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n # as above\r\n - on(target_currency)\r\n (\r\n sum(hledger_monthly_increase{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency) -\r\n sum(hledger_monthly_decrease{account=\"assets:pension\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n )\r\n)", "hide": false, "interval": "", "legendFormat": "Savings Rate", "range": true, "refId": "D" } ], "title": "Cash Flow", "transparent": true, "type": "timeseries" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 20 }, "id": 106, "panels": [], "title": "Liabilities", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Delta" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.gradientMode", "value": "opacity" } ] }, { "matcher": { "id": "byName", "options": "Liability" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Put Aside" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 21 }, "id": 24, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:cash:nationwide:flexdirect:pending:amex\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "Put Aside", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"liabilities:creditcard:amex\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Liability", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:cash:nationwide:flexdirect:pending:amex\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:creditcard:amex\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Delta", "refId": "C" } ], "title": "Credit Card", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Delta" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.gradientMode", "value": "opacity" } ] }, { "matcher": { "id": "byName", "options": "Liability" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Put Aside" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 21 }, "id": 107, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:dad\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "Put Aside", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(hledger_balance{account=\"liabilities:owed:dad\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Liability", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:dad\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)\r\n+ on(target_currency)\r\nsum(hledger_balance{account=\"liabilities:owed:dad\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Delta", "range": true, "refId": "C" } ], "title": "Dad", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Delta" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.gradientMode", "value": "opacity" } ] }, { "matcher": { "id": "byName", "options": "Liability" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Put Aside" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 21 }, "id": 108, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"liabilities:mortgage:.*\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "hide": false, "interval": "", "legendFormat": "Liability", "range": true, "refId": "B" } ], "title": "Mortgage", "transparent": true, "type": "timeseries" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 29 }, "id": 89, "panels": [], "title": "Budget", "type": "row" }, { "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 30 }, "id": 90, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "", "mode": "markdown" }, "pluginVersion": "12.3.1", "title": "MONTHLY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£170", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 750, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 375 }, { "color": "green", "value": 563 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 31 }, "id": 34, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:house:counciltax\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Council Tax", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£25", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 50 }, { "color": "green", "value": 75 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 31 }, "id": 76, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "sum(hledger_balance{account=\"assets:investments:fidelity:management\"} * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "refId": "A" } ], "title": "Fidelity Fees", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£100", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 250 }, { "color": "green", "value": 375 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 8, "y": 31 }, "id": 32, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:household\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Household", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£75", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 250 }, { "color": "green", "value": 375 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 12, "y": 31 }, "id": 100, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:huel\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Huel", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£20", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 50 }, { "color": "green", "value": 75 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 16, "y": 31 }, "id": 37, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:patreon\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Patreon", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£20", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 50 }, { "color": "green", "value": 75 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 20, "y": 31 }, "id": 33, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:phone\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Phone", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£500", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 2500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 1250 }, { "color": "green", "value": 1875 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 33 }, "id": 35, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:travel\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Travel", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£20", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 50 }, { "color": "green", "value": 75 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 33 }, "id": 110, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:twitch\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Twitch", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£200", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 500 }, { "color": "green", "value": 750 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 8, "y": 33 }, "id": 36, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:house:utilities\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Utilities", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£75", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 250 }, { "color": "green", "value": 375 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 12, "y": 33 }, "id": 40, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:web\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Web", "transparent": true, "type": "bargauge" }, { "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 35 }, "id": 88, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "", "mode": "markdown" }, "pluginVersion": "12.3.1", "title": "ANNUALLY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£100 (due November)", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 50 }, { "color": "green", "value": 75 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 36 }, "id": 92, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:british_museum\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "British Museum", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~£500 (due April)", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 250 }, { "color": "green", "value": 375 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 36 }, "id": 102, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:house:insurance\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Home Insurance", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~50 USD (due April)", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 50, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 25 }, { "color": "green", "value": 37.5 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 8, "y": 36 }, "id": 93, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:obsidian\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Obsidian", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "~50 EUR (due July)", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 50, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 25 }, { "color": "green", "value": 37.5 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 12, "y": 36 }, "id": 38, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:protonmail\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Protonmail", "transparent": true, "type": "bargauge" }, { "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 38 }, "id": 91, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "", "mode": "markdown" }, "pluginVersion": "12.3.1", "title": "SINKING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 300, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 150 }, { "color": "green", "value": 225 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 39 }, "id": 98, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:clothes\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Clothes", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 5000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 2500 }, { "color": "green", "value": 3750 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 39 }, "id": 97, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:investments:nsi:premium_bonds:emergency\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Emergency", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 250, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 125 }, { "color": "green", "value": 187.5 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 8, "y": 39 }, "id": 78, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:gift\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Gift", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Excluding money allocated towards specific goals.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 250, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 125 }, { "color": "green", "value": 187.5 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 12, "y": 39 }, "id": 105, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:goals\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Goals", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 2000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 1000 }, { "color": "green", "value": 1500 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 16, "y": 39 }, "id": 31, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:health\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Health", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 5000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 2500 }, { "color": "green", "value": 3750 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 20, "y": 39 }, "id": 95, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:holiday\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Holiday", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 5000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 2500 }, { "color": "green", "value": 3750 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 0, "y": 41 }, "id": 103, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:house:maintenance\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Home Maintenance", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 8000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 4000 }, { "color": "green", "value": 6000 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 4, "y": 41 }, "id": 96, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:invest\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Invest", "transparent": true, "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 250 }, { "color": "green", "value": 375 } ] }, "unit": "currencyGBP" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 8, "y": 41 }, "id": 99, "options": { "displayMode": "lcd", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "sum(sum(hledger_balance{account=~\"assets:.*:saved:repairs\"}) by (currency) * on(currency) hledger_fx_rate{target_currency=\"$currency\"}) by(target_currency)", "interval": "", "legendFormat": "", "range": true, "refId": "A" } ], "title": "Repairs", "transparent": true, "type": "bargauge" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 43 }, "id": 49, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 44 }, "id": 81, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_fx_rate{currency=\"EUR\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "refId": "A" } ], "title": "EUR", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 44 }, "id": 111, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "hledger_fx_rate{currency=\"GBP\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "range": true, "refId": "A" } ], "title": "GBP", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 44 }, "id": 83, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_fx_rate{currency=\"JPY\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "refId": "A" } ], "title": "JPY", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 52 }, "id": 112, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": true, "expr": "hledger_fx_rate{currency=\"SEK\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "range": true, "refId": "A" } ], "title": "SEK", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 52 }, "id": 82, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_fx_rate{currency=\"USD\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "refId": "A" } ], "title": "USD", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Vanguard LifeStrategy 100% (Acc)", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 15, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "currencyGBP" }, "overrides": [ { "matcher": { "id": "byName", "options": "Value" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 52 }, "id": 86, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "exemplar": true, "expr": "hledger_fx_rate{currency=\"VANEA\",target_currency=\"$currency\"}", "interval": "", "legendFormat": "Value of 1 {{currency}} in {{target_currency}}", "refId": "A" } ], "title": "VANEA", "transparent": true, "type": "timeseries" } ], "title": "Market Prices", "type": "row" } ], "preload": false, "refresh": "", "schemaVersion": 42, "tags": [], "templating": { "list": [ { "hide": 2, "name": "fire_annual_factor", "query": "25", "skipUrlSync": true, "type": "constant" }, { "current": { "text": "victoriametrics", "value": "PABDA7AB1AD2A1489" }, "includeAll": false, "name": "datasource", "options": [], "query": "prometheus", "refresh": 1, "regex": "", "type": "datasource" }, { "current": { "text": "GBP", "value": "GBP" }, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "definition": "label_values(hledger_fx_rate,currency)", "includeAll": false, "name": "currency", "options": [], "query": { "query": "label_values(hledger_fx_rate,currency)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "sort": 1, "type": "query" }, { "current": { "text": "365", "value": "365" }, "label": "aggregation window (days)", "name": "agg_window", "options": [ { "selected": true, "text": "365", "value": "365" } ], "query": "365", "type": "textbox" } ] }, "time": { "from": "now-1y", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Personal Finances", "uid": "H-xV7PFMz", "version": 1 } ================================================ FILE: hosts/nyarlathotep/dashboards/smart-home.json ================================================ { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 5, "links": [], "panels": [ { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 42, "panels": [], "title": "Air Quality", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "yellow", "value": 60 }, { "color": "green", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 5, "w": 24, "x": 0, "y": 1 }, "id": 49, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value_and_name", "wideLayout": true }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "editorMode": "code", "expr": "awair_score", "interval": "", "legendFormat": "{{sensor}}", "range": true, "refId": "A" } ], "title": "Overall Quality", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "transparent", "value": 0 }, { "color": "orange", "value": 27 }, { "color": "red", "value": 41 } ] }, "unit": "celsius" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 0, "y": 6 }, "id": 50, "links": [ { "targetBlank": true, "title": "Wikipedia", "url": "https://en.wikipedia.org/wiki/Heat_index" } ], "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "expr": "-8.78469475556\r\n+ 1.61139411 * awair_temp\r\n+ 2.33854883889 * awair_humid\r\n+ -0.14611605 * awair_temp * awair_humid\r\n+ -0.012308094 * awair_temp * awair_temp\r\n+ -0.0164248277778 * awair_humid * awair_humid\r\n+ 0.002211732 * awair_temp * awair_temp * awair_humid\r\n+ 0.00072546 * awair_temp * awair_humid * awair_humid\r\n+ -0.000003582 * awair_temp * awair_temp * awair_humid * awair_humid", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Heat Index", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "orange", "value": 11 }, { "color": "transparent", "value": 18 }, { "color": "orange", "value": 25 }, { "color": "red", "value": 32 } ] }, "unit": "celsius" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 8, "y": 6 }, "id": 44, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "expr": "awair_temp", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Temperature", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "orange", "value": 20 }, { "color": "transparent", "value": 40 }, { "color": "orange", "value": 50 }, { "color": "red", "value": 65 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 16, "y": 6 }, "id": 46, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "expr": "awair_humid", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Relative Humidity", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "transparent", "value": 0 }, { "color": "orange", "value": 600 }, { "color": "red", "value": 1500 } ] }, "unit": "ppm" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 0, "y": 18 }, "id": 45, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "expr": "awair_co2", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Carbon Dioxide", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "transparent", "value": 0 }, { "color": "orange", "value": 333 }, { "color": "red", "value": 3333 } ] }, "unit": "conppb" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 8, "y": 18 }, "id": 47, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "expr": "awair_voc", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Volatile Organic Compounds", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line+area" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "transparent", "value": 0 }, { "color": "orange", "value": 15 }, { "color": "red", "value": 55 } ] }, "unit": "conμgm3" }, "overrides": [] }, "gridPos": { "h": 12, "w": 8, "x": 16, "y": 18 }, "id": 48, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "12.3.1", "targets": [ { "expr": "awair_pm25", "interval": "", "legendFormat": "{{sensor}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Particulate Matter", "transparent": true, "type": "timeseries" } ], "preload": false, "refresh": "30s", "schemaVersion": 42, "tags": [], "templating": { "list": [] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Smart Home", "uid": "Zo9UQLKAp", "version": 1 } ================================================ FILE: hosts/nyarlathotep/hardware.nix ================================================ { ... }: { boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "local/volatile/root"; fsType = "zfs"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/E145-2264"; fsType = "vfat"; }; fileSystems."/home" = { device = "local/persistent/home"; fsType = "zfs"; }; fileSystems."/mnt/nas" = { device = "data/nas"; fsType = "zfs"; }; fileSystems."/nix" = { device = "local/persistent/nix"; fsType = "zfs"; }; fileSystems."/persist" = { device = "local/persistent/persist"; fsType = "zfs"; neededForBoot = true; }; fileSystems."/var/log" = { device = "local/persistent/var-log"; fsType = "zfs"; }; swapDevices = [ ]; } ================================================ FILE: hosts/nyarlathotep/jobs/flac-and-tag-album.sh ================================================ #!/usr/bin/env bash set -e for artist in *; do if [[ -d $artist ]]; then pushd "$artist" for album in *; do if [[ -d $album ]]; then echo "===== $artist - $album" >&2 pushd "$album" if [[ ! -e "$artist - $album.log" ]]; then echo "(missing log file)" >&2 fi if [[ ! -e "cover.jpg" ]] && [[ ! -e "cover.png" ]] && [[ ! -e "cover.gif" ]]; then echo "(missing cover file)" >&2 fi flac -- *.wav rm -- *.wav for flacfile in *.flac; do n="$(echo "$flacfile" | sed 's:\..*::')" track="$(echo "$flacfile" | sed 's:^[0-9]*\. \(.*\)\.flac:\1:')" metaflac --set-tag="tracknumber=$n" "$flacfile" metaflac --set-tag="title=$track" "$flacfile" metaflac --set-tag="artist=$artist" "$flacfile" metaflac --set-tag="album=$album" "$flacfile" done popd echo mv "$album" "../../out/$artist - $album" fi done popd rmdir "$artist" fi done ================================================ FILE: hosts/nyarlathotep/jobs/hledger-export-to-victoriametrics.py ================================================ #!/usr/bin/env python3 import calendar import csv import datetime import io import os import subprocess import sys from decimal import Decimal DRY_RUN = "--dry-run" in sys.argv if not DRY_RUN: import requests VICTORIAMETRICS_URI = os.environ["VICTORIAMETRICS_URI"] YEAR_OFFSET = int(os.getenv("YEAR_OFFSET", "0")) DOB = datetime.datetime(1991 - YEAR_OFFSET, 9, 9) def hledger_command(args): """Run a hledger command, throw an error if it fails, and return the stdout. """ real_args = ["hledger"] real_args.extend(args) proc = subprocess.run(real_args, check=True, capture_output=True) return proc.stdout.decode("utf-8") def offset_date(date, years): """Subtract `365*years` days from `YYYY-MM-DD` and return a string. This is useful for forecasting as VictoriaMetrics only allows data up to 2 days in the future, so instead a forecast can be shunted back so it fits into the past. """ date = datetime.datetime.strptime(date, "%Y-%m-%d") delta = datetime.timedelta(days=365 * years) return (date - delta).strftime("%Y-%m-%d") def offset_price_date(line, years): """Apply a year offset to the date.""" p, date, cur, val = line.split() date = offset_date(date, years) return f"{p} {date} {cur} {val}" def offset_posting_date(posting, years): """Apply a year offset to the date.""" posting["date"] = offset_date(posting["date"], years) return posting def date_to_timestamp(date): """Turn `YYYY-MM-DD` into a UNIX timestamp at millisecond resolution, at midnight UTC. """ parsed = datetime.datetime.strptime(date, "%Y-%m-%d") return calendar.timegm(parsed.timetuple()) * 1000 def running_totals(deltas_by_timestamp): """Turn `timestamp => key => delta` to `timestamp => key => total` by summing deltas in order. """ current = {} out = {} for timestamp in sorted(deltas_by_timestamp.keys()): for k, delta in deltas_by_timestamp[timestamp].items(): current[k] = current.get(k, 0) + delta out[timestamp] = {k: v for k, v in current.items()} return out def pivot(samples_by_timestamp): """Turn `timestamp => key => value` to `key => [timestamp, value]`""" pivoted = {} for timestamp, kvs in samples_by_timestamp.items(): for k, v in kvs.items(): samples = pivoted.get(k, []) samples.append([timestamp, v]) pivoted[k] = samples return pivoted def convert_samples(samples): """Turn `[timestamp, float or int or decimal]` to `[timestamp, float or int]`""" return [ [timestamp, value if isinstance(value, int) else float(value)] for timestamp, value in samples ] def preprocess_group_credits_debits(postings): """Group postings by date and work out the total debit / credit for each account. This is then used to simplify other metrics. Accounts are projected forwards and backwards in time. Postings are applied to an account and all of its superaccounts. """ key = lambda account, currency: (("account", account), ("currency", currency)) all_keys = set() # credits_debits_by_date :: date => key => {credit, debit} credits_debits_by_date = {} for posting in postings: currency = posting["commodity"] credit = Decimal(posting["credit"] or "0") debit = Decimal(posting["debit"] or "0") if currency == "£": currency = "GBP" credits_debits = credits_debits_by_date.get(posting["date"], {}) account = None for segment in posting["account"].split(":"): if account is None: account = segment else: account = f"{account}:{segment}" k = key(account, currency) all_keys.add(k) old = credits_debits.get(k, {"credit": 0, "debit": 0}) credits_debits[k] = { "credit": old["credit"] + credit, "debit": old["debit"] + debit, } credits_debits_by_date[posting["date"]] = credits_debits # Project accounts through all time for timestamp in credits_debits_by_date.keys(): credits_debits = credits_debits_by_date[timestamp] for k in all_keys: credits_debits[k] = credits_debits.get(k, {"credit": 0, "debit": 0}) credits_debits_by_date[timestamp] = credits_debits return credits_debits_by_date def metric_hledger_fx_rate(gbp_fx_rates, credits_debits): """`hledger_fx_rate{currency="xxx", target_currency="xxx"}` - Every currency has an exchange rate of 1 with itself. - Every currency has an exchange rate from GBP to itself at 1/rate. - Every pair of currencies have exchange rates converting both ways (via GBP). Exchange rates are projected forwards if there are credits / debits in a gap. """ key = lambda currency, target_currency: ( ("currency", currency), ("target_currency", target_currency), ) all_timestamps = {date_to_timestamp(date): True for date in credits_debits.keys()} # gbp_fx_rates_by_timestamp :: timestamp => currency => gbp_exchange_rate gbp_fx_rates_by_timestamp = {} for price in gbp_fx_rates: _, date, from_currency, gbp_exchange_rate = price.split() timestamp = date_to_timestamp(date) all_timestamps[timestamp] = True gbp_exchange_rate = Decimal(gbp_exchange_rate[1:].replace(",", "")) new_rates = gbp_fx_rates_by_timestamp.get(timestamp, {}) new_rates[from_currency] = gbp_exchange_rate gbp_fx_rates_by_timestamp[timestamp] = new_rates # fx_rates_by_timestamp :: timestamp => key => exchange_rate fx_rates_by_timestamp = {} gbp_fx_rates = {} for timestamp in sorted(all_timestamps.keys()): gbp_fx_rates = gbp_fx_rates_by_timestamp.get(timestamp, gbp_fx_rates) fx_rates = {key("GBP", "GBP"): 1} for currency, fx in gbp_fx_rates.items(): fx_rates[key(currency, currency)] = 1 fx_rates[key(currency, "GBP")] = fx fx_rates[key("GBP", currency)] = 1 / fx for currency, from_fx in gbp_fx_rates.items(): for target_currency, to_fx in gbp_fx_rates.items(): fx_rates[key(currency, target_currency)] = from_fx / to_fx fx_rates_by_timestamp[timestamp] = fx_rates return pivot(fx_rates_by_timestamp) def metric_hledger_balance(credits_debits): """`hledger_balance{account="xxx", currency="xxx"}` Accounts are propagated forward in time: if an account is seen at time T, then its balance will also be reported at time T+1, T+2, etc. """ # deltas_by_timestamp :: timestamp => key => delta deltas_by_timestamp = {} for date, kcds in credits_debits.items(): timestamp = date_to_timestamp(date) deltas_by_timestamp[timestamp] = { key: cd["debit"] - cd["credit"] for key, cd in kcds.items() } return pivot(running_totals(deltas_by_timestamp)) def metric_hledger_monthly_credits_debits(credits_debits, field): """`hledger_monthly_xxx{account="xxx", currency="xxx"}` Like `hledger_balance` but only sums the credits or debits (these are two separate metrics). These are also grouped by calendar month, with all the transactions taking effect at midnight (UTC) on the 1st. This drops the last calendar month, so only complete months are present. """ # deltas_by_timestamp :: timestamp => key => delta deltas_by_timestamp = {} for date, kcds in credits_debits.items(): parsed = datetime.datetime.strptime(date, "%Y-%m-%d") timestamp = calendar.timegm(parsed.replace(day=1).timetuple()) * 1000 deltas = deltas_by_timestamp.get(timestamp, {}) for key, cd in kcds.items(): deltas[key] = deltas.get(key, 0) + cd[field] deltas_by_timestamp[timestamp] = deltas del deltas_by_timestamp[max(deltas_by_timestamp.keys())] return pivot(deltas_by_timestamp) def metric_hledger_age_of_money(credits_debits): """`hledger_age_of_money{account="xxx", currency="xxx"}` Gives the age (in days) of the oldest unit of money in that account. Age is calculated by taking the net change of every day, if it's positive putting it in a new bucket, and if it's negative taking it from the oldest bucket. The age is then the age of the oldest nonempty bucket. """ # deltas_by_timestamp :: timestamp => key => delta deltas_by_timestamp = {} for date, kcds in credits_debits.items(): timestamp = date_to_timestamp(date) deltas_by_timestamp[timestamp] = { key: cd["debit"] - cd["credit"] for key, cd in kcds.items() } # ages_by_timestamp :: timestamp => key => days ages_by_timestamp = {} buckets_by_key = {} ages = {} for timestamp in sorted(deltas_by_timestamp.keys()): for key, delta in deltas_by_timestamp[timestamp].items(): ages[key] = ages.get(key, 0) buckets = buckets_by_key.get(key, []) if delta > 0: if len(buckets) == 0: buckets = [(timestamp, delta)] else: _, latest_value = buckets[-1] buckets.append((timestamp, latest_value + delta)) elif delta < 0: buckets = [ (timestamp, value + delta) for timestamp, value in buckets if value > -delta ] buckets_by_key[key] = buckets for key in list(ages.keys()): buckets = buckets_by_key[key] if len(buckets) == 0: ages[key] = 0 else: first_timestamp, _ = buckets[0] ages[key] = int((timestamp - first_timestamp) / 86400000) ages_by_timestamp[timestamp] = {k: v for k, v in ages.items()} return pivot(ages_by_timestamp) def metric_hledger_transactions_total(postings): """`hledger_transactions_total{status="(pending|bookkeeping|cleared)"}`""" TRANSACTION_STATUS_NAMES = {"": "pending", "!": "bookkeeping", "*": "cleared"} key = lambda status: (("status", TRANSACTION_STATUS_NAMES[status]),) # txnids_by_timestamp :: timestamp => key => set(txn_id) txnids_by_timestamp = {} for posting in postings: timestamp = date_to_timestamp(posting["date"]) status = posting["status"] txnids_by_status = txnids_by_timestamp.get(timestamp, {}) txnids = txnids_by_status.get(key(status), set()) txnids.add(posting["txnidx"]) txnids_by_status[key(status)] = txnids txnids_by_timestamp[timestamp] = txnids_by_status # counts_by_timestamp :: timestamp => key => int counts_by_timestamp = { ts: {k: len(ids) for k, ids in vs.items()} for ts, vs in txnids_by_timestamp.items() } return pivot(running_totals(counts_by_timestamp)) def metric_quantified_self_age(credits_debits): """`quantified_self_age{unit="{days|years}"}`""" # ages_by_timestamp :: timestamp => key => int ages_by_timestamp = {} for datestr in sorted(credits_debits.keys()): date = datetime.datetime.strptime(datestr, "%Y-%m-%d") timestamp = calendar.timegm(date.timetuple()) * 1000 days = (date - DOB).days years = date.year - DOB.year if (date.month, date.day) < (DOB.month, DOB.day): years -= 1 ages_by_timestamp[timestamp] = { (("unit", "days"),): days, (("unit", "years"),): years, } return pivot(ages_by_timestamp) raw_prices = [ offset_price_date(line, YEAR_OFFSET) for line in hledger_command(["prices"]).splitlines() ] raw_postings = [ offset_posting_date(row, YEAR_OFFSET) for row in csv.DictReader(io.StringIO(hledger_command(["print", "-O", "csv"]))) ] credits_debits = preprocess_group_credits_debits(raw_postings) metrics = { "hledger_fx_rate": metric_hledger_fx_rate(raw_prices, credits_debits), "hledger_balance": metric_hledger_balance(credits_debits), "hledger_monthly_increase": metric_hledger_monthly_credits_debits( credits_debits, "debit" ), "hledger_monthly_decrease": metric_hledger_monthly_credits_debits( credits_debits, "credit" ), "hledger_age_of_money": metric_hledger_age_of_money(credits_debits), "hledger_transactions_total": metric_hledger_transactions_total(raw_postings), "quantified_self_age": metric_quantified_self_age(credits_debits), } for name, values in metrics.items(): if not DRY_RUN: requests.post( f"{VICTORIAMETRICS_URI}/api/v1/admin/tsdb/delete_series?match[]={name}" ).raise_for_status() for labels_tuples, samples in values.items(): print(f"Uploading {name} {labels_tuples} ({len(samples)} samples)") labels = dict(labels_tuples) labels["__name__"] = name samples = convert_samples(samples) json = { "metric": labels, "values": [v for _, v in samples], "timestamps": [t for t, _ in samples], } if DRY_RUN: print(json) else: requests.post( f"{VICTORIAMETRICS_URI}/api/v1/import", json=json ).raise_for_status() if not DRY_RUN: requests.get( f"{VICTORIAMETRICS_URI}/internal/resetRollupResultCache" ).raise_for_status() ================================================ FILE: hosts/nyarlathotep/jobs/hledger-fetch-fx-rates.py ================================================ #!/usr/bin/env python3 from html.parser import HTMLParser import os import requests import sys import time DRY_RUN = "--dry-run" in sys.argv def get_financial_times(url): class PriceFinder(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.found = None self.isnext = False def handle_data(self, data): if self.found is not None: return if data == "Price (GBP)": self.isnext = True elif self.isnext: self.found = data self.isnext = False r = requests.get(url) r.raise_for_status() finder = PriceFinder() finder.feed(r.text) if finder.found is None: raise Exception("could not find price") else: return finder.found def get_financial_times_currency(symbol): return get_financial_times( f"https://markets.ft.com/data/currencies/tearsheet/summary?s={symbol}GBP" ) def get_financial_times_fund(isin): return get_financial_times( f"https://markets.ft.com/data/funds/tearsheet/summary?s={isin}:GBP" ) DATE = time.strftime("%Y-%m-%d") COMMODITIES = [ ("CAD", get_financial_times_currency), ("EUR", get_financial_times_currency), ("JPY", get_financial_times_currency), ("SEK", get_financial_times_currency), ("USD", get_financial_times_currency), ("VANEA", "GB00B41XG308", get_financial_times_fund), ] with sys.stdout if DRY_RUN else open(os.environ["PRICE_FILE"], "a") as f: print("", file=f) for commodity in COMMODITIES: symbol = commodity[0] try: rate = commodity[-1](commodity[-2]) print(f"P {DATE} {symbol} £{rate}", file=f) except Exception as e: print(f"; '{symbol}': {e}", file=f) ================================================ FILE: hosts/nyarlathotep/jobs/restic-prepare--fetch-youtube.py ================================================ #!/usr/bin/env python3 """Youtube "backup" script - generates a script to download videos.""" import os import shlex SOURCE_DIR = "/mnt/nas/misc/youtube" VIDEO_URL = "https://www.youtube.com/watch?v=" print("#!/bin/sh") print("") for dirpath, dirnames, filenames in os.walk(SOURCE_DIR, topdown=True): for dirname in dirnames: print(f"mkdir {shlex.quote(os.path.join(dirpath, dirname))}") for filename in filenames: # filenames are of the form "title [id].ext" name_pattern = filename.split("[")[-2] + "[%(id)s].%(ext)s" url = VIDEO_URL + filename.split("[")[-1].split("]")[0] print( f"yt-dlp -P {shlex.quote(dirpath)} -o {shlex.quote(name_pattern)} {shlex.quote(url)}", ) ================================================ FILE: hosts/nyarlathotep/jobs/restic-prepare--hardlink-torrent-files.py ================================================ #!/usr/bin/env python3 """Torrent "backup" script - generates a script to create the directory hierarchy and hardlink files. """ import os import shlex import sys # Directories to link MEDIA_DIRS = ["/mnt/nas/anime", "/mnt/nas/movies", "/mnt/nas/tv"] # Where torrent files are downloaded to TORRENT_FILES_DIR = "/mnt/nas/torrents/files" # Where .torrent files are stored TORRENT_WATCH_DIR = "/mnt/nas/torrents/watch" # Only list unlinked files, don't generate a linking script CHECK_ONLY = "--check" in sys.argv def print_cmd(cmd): """Print a command, if not in checking mode.""" if not CHECK_ONLY: print(cmd) def file_ref(fpath): """Return a unique reference to the file, consistent across hardlinks.""" info = os.stat(fpath) return (info.st_dev, info.st_ino) def find_inodes(base): """Return the set of inodes under the given base directory.""" inodes = dict() for root, _, files in os.walk(base): for fname in files: fpath = os.path.join(root, fname) inodes[file_ref(fpath)] = fpath return inodes def traverse(base, inodes): """Print out `mkdir` and `ln` commands to rebuild the directory / file hierarchy under `base`, linking files to `inodes`. """ for root, _, files in os.walk(base): print_cmd(f"mkdir {shlex.quote(root)}") for fname in files: fpath = os.path.join(root, fname) ref = file_ref(fpath) if ref in inodes: source_file = inodes[ref] print_cmd(f"ln {shlex.quote(source_file)} {shlex.quote(fpath)}") elif os.path.splitext(fpath)[-1] == ".torrent": source_file = os.path.join(TORRENT_WATCH_DIR, fname) print_cmd(f"cp {shlex.quote(source_file)} {shlex.quote(fpath)}") else: print(f"Unknown path {fpath}", file=sys.stderr) inodes = find_inodes(TORRENT_FILES_DIR) for media_dir in MEDIA_DIRS: traverse(media_dir, inodes) ================================================ FILE: hosts/nyarlathotep/jobs/rss-to-mastodon.py ================================================ #!/usr/bin/env python3 """RSS-to-Mastodon (or Pleroma) Requires the API_KEY environment variable to be set. Usage: rss-to-mastodon [--dry-run] [--use-summary] -d -f -l [-e ] [-v ] Options: --dry-run just print what would be published --use-summary use the (de-HTMLised) sumamry field, rather than the title -d api domain -f rss feed URL -l file to log feed item IDs to (to prevent double-posting) -e maximum number of entries to post [default: 1] -v visibility of entries [default: public] """ import bs4 import docopt import feedparser import html.parser import http.client import os import pathlib import requests import sys import time args = docopt.docopt(__doc__) dry_run = args["--dry-run"] use_summary = args["--use-summary"] api_domain = args["-d"] feed_url = args["-f"] history_file = pathlib.Path(args["-l"]) entries = int(args["-e"]) visibility = args["-v"] if not dry_run: api_token = os.getenv("API_KEY") if api_token is None: print("missing API key", file=sys.stderr) sys.exit(1) attempts = 0 feed = None while attempts < 5: # tumblr seems to often just drop connections with the default feedparser # user agent, so let's pretend to be curl try: feed = feedparser.parse(feed_url, agent="curl/7.54.1") break except http.client.RemoteDisconnected: print(f"failed to download feed - attempt {attempts}", file=sys.stderr) attempts += 1 time.sleep(2) if feed is None: print("could not download feed", file=sys.stderr) sys.exit(1) # will crash if the file doesn't exist - but that's probably a good failsafe to # prevent the same post being spammed if the log file gets accidentally deleted history = history_file.read_text().split() items = [entry for entry in feed["items"][:entries] if entry["id"] not in history] # if there are multiple items, post the older ones first for item in reversed(items): title = html.parser.unescape(item["title"]) if use_summary: title = bs4.BeautifulSoup(item["summary"], "html.parser").get_text().strip() print(item["id"]) print(title) print() if dry_run: continue requests.post( f"{api_domain}/api/v1/statuses", headers={ "Authorization": f"Bearer {api_token}", "Idempotency-Key": item["id"], }, json={ "status": title, "visibility": visibility, }, ).raise_for_status() # yes, this is inefficient - but the file will have a few hundred entries in # it at most history.append(item["id"]) history_file.write_text("\n".join(history)) ================================================ FILE: hosts/nyarlathotep/jobs/tag-podcasts.sh ================================================ #!/usr/bin/env bash set -e sleep 60 for m4afile in */in/*.m4a; do if [[ ! -f "$m4afile" ]]; then break fi bitrate=$(ffprobe -v quiet -of flat=s=_ -show_entries format=bit_rate "${m4afile}" | sed 's/[^0-9]*//g') destination="$(echo "$m4afile" | sed 's:m4a$:mp3:')" echo "m4a: ${m4afile} -> ${destination}" >&2 ffmpeg -y -i "$m4afile" -codec:a libmp3lame -b:a "$bitrate" -q:a 2 "$destination" rm "$m4afile" done for mp3file in */in/*.mp3; do if [[ ! -f "$mp3file" ]]; then break fi dir="$(echo "$mp3file" | sed 's:/in/.*::')" f="$(basename "$mp3file")" artist="$(echo "$dir" | sed 's: - .*::')" album="$(echo "$dir" | sed 's:.* - ::')" if [[ -z "$album" ]]; then album="$artist" fi n="$(echo "$f" | sed 's:\..*::')" track="$(echo "$f" | sed 's:^[0-9]*\. \(.*\)\.mp3:\1:')" destination="$(echo "$mp3file" | sed 's:/in/:/:')" echo "===== $mp3file" >&2 echo "$artist" >&2 echo "$album" >&2 echo "$n" >&2 echo "$track" >&2 echo "$destination" >&2 echo >&2 id3v2 -D "$mp3file" id3v2 -2 --song "$track" "$mp3file" id3v2 -2 --track "$n" "$mp3file" id3v2 -2 --artist "$artist" "$mp3file" id3v2 -2 --album "$album" "$mp3file" mv "$mp3file" "$destination" done # this can't be done as a systemd path unit because it doesn't seem to # support multiple *s in a pattern inotifywait --recursive --timeout 3600 --include '/mnt/nas/music/Podcasts/.*/in/.*\.mp3' "$(pwd)" &>/dev/null # this script is run in a loop by systemd. ================================================ FILE: hosts/nyarlathotep/secrets.yaml ================================================ users: barrucadu: ENC[AES256_GCM,data:H6q5mf0vurd5FRCPftLGXvGzDep5iYlSw4gJMVCWhB8+35A8wYyE8i5qW+pNEE+TtxrXpYa9MzjWpAUdsmoyHi1Ncficb8USvIWAeLgQljAG0mrV9Yj1TjmDH81UsXKqzpJw2duXymnQ,iv:ls1DMfK4Y0RZgEDPRhQC/jJPUOKRLRljV/yuIfAqnB4=,tag:x2FzpOuDDndWF7WMJqb4eQ==,type:str] notbarrucadu: ENC[AES256_GCM,data:Q7++CIUemGmLY2mCYQoF4ImyK9HNqbd0NTNY0PohQfQhuXZE6vvxRUypXppKUxpaLct4mvc+f9+uAY5MJB8a2D3YH51tqbEDQaJqxWn1Qw90Wxubvr/EdpzgKJW9BAZLIGxCTOM=,iv:QmoC1J+1FNiLzGrBJiWa83VuRZJx5CKflZTmhHFt6ZM=,tag:qGMfbc13j65/yDlzAvy3QQ==,type:str] rss_to_mastodon: kjp_hacksrus_env: ENC[AES256_GCM,data:+H7js3WDrDuuQQjuAs3mG87xHyhWXUOoH47OlhUhM96h6pyVP5pV34+gwDvO4cgCWmbeDg==,iv:ptGUl/MdXgxrrem0kMKeQcpUsHgPbBamaJehDjVwVAo=,tag:z4MXvOFHU1e/LTkjcBec0A==,type:str] remote_sync: ssh_private_key: ENC[AES256_GCM,data:lOfo8ALZTCq7GVEZ+2KCDch+mOkOrSm5oqJKUNP+JVqfxA3r2GV8071ESFme8oTmsLIl/u5W9UxK6GMobM5M4ynZUTr1H3/yLRMNrbymTqIrKeGejaIy4hZRbF4Pv4NgtRTbnBfP7HHHnhykARuROmmtLQVITrAi4j9BJ7smyzOd8rdeyOsHBioOd784DLUGXQaGAmEvBRGuZ/pq3hEV0kQof5I94V82A7zWjZpD4yO76e+LYCA0Eu2FxM88P5jkiTPWLxFciY0z++2QvPguuYeXeAFkDc7yR2hiWFWT+rtfZSGsBL+Czse9PZbatugHn59ZPEzvUlv+FTnx5Vc1o9fQYGWCJGerZY2Sg6AtPglEdrmeTtEeELGVmnK/i5etlRaOER4fGSIIoIQ/xAor/GK0laoMQtU/MDLcuvw8BtD91/yTwFYbrghe8BEbnO36OUFQFh4OIWo8pHnkfbPZtJF+fRjXiO5yEdZpx29pMrqkhWqvEeujGurLZvTcQLX2iJ0utmQ3zv2/d8c+mzNHPNxUvHAEkp3kUjyktq0aylyjTdw=,iv:rxxAph3k6JEFJaq1LbWfIj6ah1E9r6locEBDghf/7gE=,tag:oEp4/ILyn5YfEDgC7eMhiw==,type:str] nixfiles: restic-backups: env: ENC[AES256_GCM,data:K+JPrEyTiwClQ7z7p8IIv3CQZ2I2FMWKM7fZp2bGdahrezv5WihM1layoMXaZKK3sX4Mh1egaRUaDIW89+tvQFEN8zvekBOd7m2upmxVjsayCOLdV1wPSD/YZBPt15pZnNI8iIciaQWGSVZHvFn+V3H49PvXzQV4r0N1NQYiBPinCBVpcw6P9309CAPMVFmA0tCwPNUHp1JOJcDolhdmCIgPfTpDCeoZ8/1Ln9J+T4W5kZ6vrMXtRmTvD6ItAnRNsUx+07mAvTP2kosVAIgT1h8nC5Nt3rv3dCdOVaK6ILahSwCY0fnDq9mQU0ALADF8jGbi0xIfidQDdZp/7OaAbjhUiwTBkSoFu5KAfUk=,iv:MS5LRsfpKg5alaxpBuXiI0JWA5zFfLsMUPFoYLtzqoo=,tag:EItXOV+GgqbXRyYFmkuweg==,type:str] services: alertmanager: env: ENC[AES256_GCM,data:O3XHFKP9NRSfRuLOg0cF+g2knAYyAMoc1s+fJ3/eikOxGyqPlKehlJhjh+lfW5Em7VUjwLVZLjsR0Hq+zvx9oHFGiBX8wxWhYMajMjzE9yfyAghmiIX5LL1T9Wgz+TBS4IJw0uEU,iv:/LyaBKRMHcAn8wQTwj6ZQBR17pnNdIanHi4CWLSfENs=,tag:FVjC/MEci9B4hWA5Ev3+Yw==,type:str] sops: kms: [] gcp_kms: [] azure_kv: [] hc_vault: [] age: - recipient: age1sdnp5uxhdtujc78penv2gntnenzcfju7est4hslz6eqgfk26u9nskkk634 enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzbWpwbzYvQnJaR3B4L0Zk WlJna2xXTzZ3TXAyVktXRTNGV2EvR3V6S25nCi9ITmROQ3owcGlIZlNDVTZDU3h6 Y0xHK2hzY3ZQYlBrenRVU1Y4Z1U5R0EKLS0tIFRKOXlXUDhzZXBHclMySjYwN0tT SFkyTXBscUZjYVhEVENWZkU5d283KzQKXd6VX+ZetGZuKIBZd88zk6IRLLeydXbD +jF2ojL15sO2EIB4c576Y9xdRgC6GFNHXbUM2j5ghoII05bvr0C31g== -----END AGE ENCRYPTED FILE----- - recipient: age1700sgwfejx38fh66k6sajxe507w9x6ptcxfh4dmyffflml75w4fqmteyfy enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDMlY0RlJRMjR2U0M2R3R0 Nnh2ZzhRamUxdjEyZEFmQ1g4akNLbG1JUWdFClZ4ZlJzKzJub1VtOUN3eE5SaWhI NjRoVEx0VkxWd2ZiNnNWSlhEaXVyNUUKLS0tIGtKakJUOSs4c3R2WVRLcWZkdklk UFVZQkpPSUY1YWZlRlFCbDNBcHhzVmcKzBqO5fMoaNerJw3ovWXCPLQM0cDfte03 ZiXMnrIUfIf2AntjjnZKc84jsnubTyD2fQLGNVkAetmQ3PTb3OKXqQ== -----END AGE ENCRYPTED FILE----- lastmodified: "2024-09-02T19:42:11Z" mac: ENC[AES256_GCM,data:Fvlv7VdlVJotJtwoRUTbif2Hu/ly9P7sHB3S39Q5h4JJuX19jO32VySS5dg0NKzm9VbjaD42E+5wGty128JQNs4vcS+znlgP1H5ZJdLd0tKTYtGjIdV8CoJAWRdLqcyJwNrGbnEaPkyk5jaIf7m2zTHOIhBrH0nT80QEaqpL0aQ=,iv:Ly3hnnpActejElcp1ubHa9wuMrrFEgHzof07Om9pr5g=,tag:EZm3A4pGldvT+spk45LWxA==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.8.1 ================================================ FILE: hosts/yuggoth/configuration.nix ================================================ # This is a VPS (hosted by Hetzner Cloud). # # It serves a redundant deployment of a few of my websites. # # **Alerting:** disabled # # **Backups:** disabled # # **Public hostname:** `yuggoth.barrucadu.co.uk` # # **Role:** server { config, lib, pkgs, ... }: with lib; { ############################################################################### ## General ############################################################################### networking.hostId = "62f520b4"; boot.supportedFilesystems = { zfs = true; }; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; networking.interfaces.enp1s0 = { ipv6.addresses = [{ address = "2a01:4ff:f0:3a38::"; prefixLength = 64; }]; }; networking.defaultGateway6 = { address = "fe80::1"; interface = "enp1s0"; }; nixfiles.eraseYourDarlings.enable = true; nixfiles.eraseYourDarlings.machineId = "ee9cfe217f0f4d45bab5e897e782ca91"; nixfiles.eraseYourDarlings.barrucaduPasswordFile = config.sops.secrets."users/barrucadu".path; sops.secrets."users/barrucadu".neededForUsers = true; ############################################################################### ## Website Mirror ############################################################################### nixfiles.hostTemplates.websiteMirror = { enable = true; acmeEnvironmentFile = config.sops.secrets."services/acme/env".path; }; sops.secrets."services/acme/env" = { }; ############################################################################### ## Remote Builds ############################################################################### nix.distributedBuilds = true; nix.buildMachines = [{ hostName = "carcosa.barrucadu.co.uk"; system = "x86_64-linux"; sshUser = "nix-remote-builder"; sshKey = config.sops.secrets."nix/build_machines/carcosa/ssh_key".path; publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUlTa0x0bk11bUs3N1RYUHBSa0VCeGI1NEtZVHZMZzhHUmFOeGl6c2NoMSsgcm9vdEBjYXJjb3NhCg=="; protocol = "ssh-ng"; maxJobs = 8; }]; sops.secrets."nix/build_machines/carcosa/ssh_key" = { }; } ================================================ FILE: hosts/yuggoth/hardware.nix ================================================ { ... }: { boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "local/volatile/root"; fsType = "zfs"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/A5EB-2AC0"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; fileSystems."/home" = { device = "local/persistent/home"; fsType = "zfs"; }; fileSystems."/nix" = { device = "local/persistent/nix"; fsType = "zfs"; }; fileSystems."/persist" = { device = "local/persistent/persist"; fsType = "zfs"; neededForBoot = true; }; fileSystems."/var/log" = { device = "local/persistent/var-log"; fsType = "zfs"; }; swapDevices = [ ]; } ================================================ FILE: hosts/yuggoth/secrets.yaml ================================================ nix: build_machines: carcosa: ssh_key: ENC[AES256_GCM,data:iHdR8yErpDSh9GHQ1nS1u6jkxDxDoQnjpElKlE51W4zP/0Aswvok9cgIhMEvr6fEhQlHYJm+naLmLg+r96EPgTHOOiR+Hz722EDor/BhQoAUn+ebWm6HshoL2xZNjg60gFR6Ac7m7s9kgA+LIxKcPW6U53EVBo9yeVRvHxBUrMfzyjmbB0kP3tiomwNgcsVjrg4SDss3AoYlfsq5TkYr4m6XRXYuM5tQxpFelSSGKDCYMKhS0UKP5diQz2GVvlbYkF7wOMHTnb4hn67p5AbesNiPHatIvUmm6upi+BIQYxcB4T0r9NzFmvqKkFiiFXZJ/IWuMiVP0uklccfkWarHa07S0JZlBMwGPgn7Nt2NesNWYsNqdiDit7Wbv/zCkOUo+BP3EWAZTLne4VjLfDzPXVFz2+z/ukPIpK0QYk9bwfR1VJAa6ahhRwJ6elNApaZhoFRbh4FCWjGQbpnHWt658q3d4GPe+gWapJuG4RtYGYPSxmpq3BXw+FsVyF2CJD6IAPpP4+xpVLoXRkpQyojOO8P4uZK0g5UYL/ap,iv:pUzTPINBp+AdZTy8Dk4t6+wODlJZZ1V/AJD51oVNIi4=,tag:hmtRHuX0H29lGTzwfqsz1g==,type:str] users: barrucadu: ENC[AES256_GCM,data:AydpgRw6tSPNsj0YJgNKDIwcCF2bo+vwJhrRJhbeJAY39yJHlP9xTarGGNBAczrKBwKKMN2EAA27hRyX+tDc/ne9mtOx4P5JS86mN9wkLKpaHbIamJNGfatDlu3uBvStNIKSC/CrnsFZ,iv:fW5+OJ2O8R9VB6YmKUP3jmKOHDEtZ4fBsVUmqbrkPjw=,tag:N04QCMG9/WV10Sd1lgGzhA==,type:str] services: acme: env: ENC[AES256_GCM,data:1noClb0Z/zpobJtHpiGrc7yw3mLW3eUXijD29U5s6e+zVwAneTRp0Ijm3QqvRqfczzglYnAArBPXn7Xodt5ZXEwTWv1X49g65yevv7c+8S2Ka5D5gJfGqlJ6hzjuTOGdViLN+FRt4+5GWo62jvP6sGSlb6fj0COs+1GCHboOdbM5VGM=,iv:5yy5NcaKF3w9NS7DhuzzxJxjWsVxMIy9M9OQPv1KlDY=,tag:Ja4LlAJZXpiv0VkBilVffg==,type:str] sops: kms: [] gcp_kms: [] azure_kv: [] hc_vault: [] age: - recipient: age1sdnp5uxhdtujc78penv2gntnenzcfju7est4hslz6eqgfk26u9nskkk634 enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsaTNzNVdaYnY5cVdVSjZs bkF6LzhIQnVQWFI5STV4VjdKMVF5ZDdyMXpVCms5bXI2c3U3aDdsRUovdUJFQitF cnZyNEE4cDlBWGYrUEgweGYzdnhIcHMKLS0tIHFlWUZTeGxySERJYlR3a1B0NnA5 a0cwbGFQb2xqdXRxS214ckw4cjNwL2cKsxnsN8q1zPMBWO60Ndr0ozsaPzeGlPhm pilwuo1I/xXqEfHBumwC089C5FT+XVmuychY3iox/zYvycdg3wGYIg== -----END AGE ENCRYPTED FILE----- - recipient: age1xj0vderjss6wvyuu5uw5gag6lhxzfh6qwfrewgpff5ttpfa03azsxc8600 enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjQ3dpYUdPdGk5OFNRc3U4 a05tNFFPVTRqaEFxQjJtSTV4TlB1Nm1USkVRCk9PdHNXczEzbGw0RGxsRTZ6YUVp MmFSaGw5eGp0cFRPTjNTWWR6Y2wxd0UKLS0tIGJ4SjFaZU90eGNHNFl0VjB4Z3Fu NVBIU1I2MDRqVGt3eGRzbjdDb0d5Yk0KGPo6sIu5pp6s1r/IhyNjfNgDwxl3SWM3 TMmIsx3iHsy+xgxUuGQXCsUkCy4YBzEjRVVtycCRfd5IAXryGhHEuQ== -----END AGE ENCRYPTED FILE----- lastmodified: "2025-05-29T00:55:40Z" mac: ENC[AES256_GCM,data:6hQ80aWt4ll4ZW6sY7WDo7s6bUmhHDKr9gchYYb+BIn37hiMyyad4nKeKZkAUeSPi5KvXLv+dF/fwjsgS4to1BHfwrPkFIOp4f9m02736EOQ8zvW0vSnF/fV5ql1eOId3as6SttO03It2Gd2r6clpWbexykRygbRvziXyICAXtk=,iv:pxj6Tb4tkpMO/p1GlPE+/v03Dk3xzUThCFmjenvZBtc=,tag:c75AJK1z9dteVczhMTYYhg==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.9.4 ================================================ FILE: scripts/backups.sh ================================================ set -Ee export RESTIC_REPOSITORY="b2:barrucadu-backups-a19c48:nixfiles/restic" COMMAND=$1 TARGET=$(hostname) if [[ -z "$COMMAND" ]]; then COMMAND=snapshots else shift fi if [[ ! -f "hosts/${TARGET}/secrets.yaml" ]]; then echo "unknown host '${TARGET}'" exit 1 fi sops_env=$(sops -d --extract '["nixfiles"]["restic-backups"]["env"]' "hosts/${TARGET}/secrets.yaml") # shellcheck disable=SC2163 # shellcheck disable=SC2086 export $sops_env case "$COMMAND" in check | snapshots) restic "$COMMAND" "$@" ;; restore) SNAPSHOT=$1 shift if [[ -z "$SNAPSHOT" ]]; then echo "usage: 'restore []'" exit 1 fi RESTORE_DIR=$1 if [[ -z "$RESTORE_DIR" ]]; then RESTORE_DIR="/tmp/restic-restore-${SNAPSHOT}" else shift fi restic restore "$SNAPSHOT" --target "$RESTORE_DIR" "$@" ;; *) echo "unknown command '$COMMAND'" exit 1 ;; esac ================================================ FILE: scripts/documentation.sh ================================================ set -e sed 's#See \[the documentation\].*##' < README.markdown > docs/src/README.md python3 - <<'EOF' > docs/src/hosts.md import os print("# Hosts") print("") hosts = sorted([name for name in os.listdir("hosts")]) for host in hosts: source_file = f"hosts/{host}/configuration.nix" if not os.path.isfile(source_file): continue print(f"## {host}") has_doc = False with open(source_file, "r") as f: for line in f: if line.startswith("#"): has_doc = True print(line[1:].strip()) else: break if not has_doc: print("This host has no description.") print(f"\n**Declared in:** [{source_file}](https://github.com/barrucadu/nixfiles/blob/master/{source_file})") print("") EOF python3 - <<'EOF' > docs/src/host-templates.md import os print("# Host Templates") print("") templates = sorted([name for name in os.listdir("shared/host-templates") if name not in [".", ".."]]) for template in templates: source_file = f"shared/host-templates/{template}/default.nix" if not os.path.isfile(source_file): continue print(f"## {template}") has_doc = False with open(source_file, "r") as f: for line in f: if line.startswith("#"): has_doc = True print(line[1:].strip()) else: break if not has_doc: print("This template has no description.") print(f"\n**Declared in:** [{source_file}](https://github.com/barrucadu/nixfiles/blob/master/{source_file})") print("") EOF python3 - <<'EOF' > docs/src/modules.md import json import os print("# Modules") print("") with open(os.getenv("NIXOS_OPTIONS_JSON"), "r") as f: options = json.load(f) del options["_module.args"] modules = {} for key, defn in options.items(): module_name = defn["declarations"][0].split("/shared/")[1].replace("/options.nix", "") if module_name.startswith("host-templates/"): continue if module_name == "options.nix": # this is the top-level `shared` file module_name = "" modules.setdefault(module_name, []).append(key) for module in sorted(modules.keys()): module_name = "<shared>" if module == "" else module source_file = f"shared/{module}/default.nix".replace("//", "/") print(f"## {module_name}") has_doc = False with open(source_file, "r") as f: for line in f: if line.startswith("#"): has_doc = True print(line[1:].strip()) else: break if not has_doc: print("This module has no description.") print("\n**Options:**\n") for option in modules[module]: anchor = "".join(c for c in option if c.isalpha() or c in "-_").lower() print(f"- [`{option}`](./options.md#{anchor})") print(f"\n**Declared in:** [{source_file}](https://github.com/barrucadu/nixfiles/blob/master/{source_file})") print("") EOF python3 - <<'EOF' > docs/src/options.md import json import os print("# Options") print("") with open(os.getenv("NIXOS_OPTIONS_JSON"), "r") as f: options = json.load(f) del options["_module.args"] for option in sorted(options.keys()): defn = options[option] option_name = option.replace("*", "\\*").replace("<", "<").replace(">", ">") source_file = "shared/" + defn["declarations"][0].split("/shared/")[1] print(f"## {option_name}") if isinstance(defn["description"], str): print(f"\n{defn['description']}") else: print(f"\n{defn['description']['text']}") print(f"\n**Type:** `{defn['type']}`") if "default" in defn: print(f"\n**Default:** `{defn['default']['text']}`") if "example" in defn: print(f"\n**Example:** `{defn['example']['text']}`") print(f"\n**Declared in:** [{source_file}](https://github.com/barrucadu/nixfiles/blob/master/{source_file})") print("") EOF mdbook build docs mv docs/book _site ================================================ FILE: scripts/fmt.sh ================================================ nix fmt black . ================================================ FILE: scripts/lint.sh ================================================ set -ex # TODO: add this back when the package is no longer broken # nix-linter -r . # SC2001: use pattern expansion over sed find . -name '*.sh' -print0 | xargs -0 -n1 shellcheck -s bash -e SC2001 # E501: line length (if black is happy, I'm happy) # E731: assign lambda to a variable find . -name '*.py' -print0 | xargs -0 -n1 flake8 --ignore=E501,E731 find . -name options.nix -print0 | while IFS= read -r -d '' filename; do if ! grep -q "$filename" flake.nix; then exit 1 fi done if git grep 'options.nixfiles' | grep -vE 'options.nix'; then exit 1 fi if git grep 'OnCalendar' | grep -vE 'scripts/lint.sh'; then exit 1 fi if git grep 'users.extraUsers' | grep -vE 'scripts/lint.sh'; then exit 1 fi if git grep 'virtualisation.oci-containers' | grep -vE 'scripts/lint.sh|shared/oci-containers/'; then exit 1 fi ================================================ FILE: scripts/secrets.sh ================================================ if [[ -z "$1" ]]; then SECRETS_FILE="hosts/$(hostname)/secrets.yaml" elif [[ -z "$2" ]]; then SECRETS_FILE="hosts/${1}/secrets.yaml" else SECRETS_FILE="hosts/${1}/secrets/${2}.yaml" fi sops "$SECRETS_FILE" ================================================ FILE: shared/acme/default.nix ================================================ # Manage ACME (LetsEncrypt) certificates via Route53 DNS challenge. # # **Erase your darlings:** stores certificates in `persistDir`. { config, lib, pkgs, ... }: with lib; let baseDir = if config.nixfiles.eraseYourDarlings.enable then toString config.nixfiles.eraseYourDarlings.persistDir else ""; certDir = "${baseDir}/var/lib/acme"; copyCertsFor = domain: '' mkdir -p ${certDir} || true rm -r ${certDir}/${domain} || true cp -a /var/lib/acme/${domain} ${certDir}/${domain} ''; mkCert = domain: cfg: nameValuePair domain { inherit domain; inherit (cfg) extraDomainNames; group = config.services.caddy.group; postRun = if config.nixfiles.eraseYourDarlings.enable then copyCertsFor domain else ""; }; cfg = config.nixfiles.acme; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { security.acme = { acceptTerms = true; defaults = { email = "mike@barrucadu.co.uk"; dnsProvider = "route53"; dnsPropagationCheck = true; environmentFile = cfg.environmentFile; reloadServices = [ "caddy" ]; }; certs = mapAttrs' mkCert cfg.domains; }; users.users.acme.uid = 986; users.groups.acme.gid = 989; }; } ================================================ FILE: shared/acme/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.acme = { enable = mkOption { type = types.bool; default = false; description = '' Enable the ACME DNS-01 service. ''; }; environmentFile = mkOption { type = types.path; description = '' Environment file with AWS Route53 credentials for the ACME DNS-01 challenge. ''; }; domains = mkOption { type = types.attrsOf (types.submodule { options = { extraDomainNames = mkOption { type = types.listOf types.str; default = [ ]; description = '' Extra domain names under this certificate. ''; }; }; }); description = '' Attrset of domain / certificate definitions. ''; }; }; } ================================================ FILE: shared/bookdb/default.nix ================================================ # [bookdb][] is a webapp to keep track of all my books, with a public instance # on [bookdb.barrucadu.co.uk][]. # # bookdb uses a containerised elasticsearch database, it also stores uploaded # book cover images. # # **Backups:** the elasticsearch database and uploaded files. # # **Erase your darlings:** overrides the `dataDir`. # # [bookdb]: https://github.com/barrucadu/bookdb # [bookdb.barrucadu.co.uk]: https://bookdb.barrucadu.co.uk/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookdb; backend = config.nixfiles.oci-containers.backend; in { imports = [ ./erase-your-darlings.nix ./options.nix ./remote-sync-receive.nix ./remote-sync-send.nix ]; config = mkIf cfg.enable { systemd.services.bookdb = { description = "barrucadu/bookdb webapp"; wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" "${backend}-bookdb-db.service" ]; wants = [ "network-online.target" ]; requires = [ "${backend}-bookdb-db.service" ]; path = [ pkgs.imagemagick ]; serviceConfig = { ExecStart = "${pkgs.nixfiles.bookdb}/bin/bookdb ${optionalString (!cfg.readOnly) "--allow-writes"} ${./uuids.yaml}"; Restart = "always"; User = config.users.users.bookdb.name; }; environment = { BOOKDB_ADDRESS = "127.0.0.1:${toString cfg.port}"; BOOKDB_UPLOADS_DIR = "${cfg.dataDir}/covers"; ES_HOST = "http://127.0.0.1:${toString cfg.elasticsearchPort}"; RUST_LOG = cfg.logLevel; RUST_LOG_FORMAT = cfg.logFormat; }; }; nixfiles.oci-containers.pods.bookdb.containers.db = { image = "mirror.gcr.io/elasticsearch:${cfg.elasticsearchTag}"; environment = { "http.host" = "0.0.0.0"; "discovery.type" = "single-node"; "xpack.security.enabled" = "false"; "ES_JAVA_OPTS" = "-Xms256M -Xmx256M"; }; ports = [{ host = cfg.elasticsearchPort; inner = 9200; }]; volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }]; }; users.users.bookdb = { uid = 998; description = "bookdb service user"; home = cfg.dataDir; createHome = true; isSystemUser = true; group = "nogroup"; }; nixfiles.restic-backups.backups.bookdb = { prepareCommand = '' env ES_HOST=${config.systemd.services.bookdb.environment.ES_HOST} ${pkgs.nixfiles.bookdb}/bin/bookdb_ctl export-index > elasticsearch-dump.json ''; paths = [ cfg.dataDir "elasticsearch-dump.json" ]; }; }; } ================================================ FILE: shared/bookdb/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.bookdb; eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf (cfg.enable && eyd.enable) { nixfiles.bookdb.dataDir = "${toString eyd.persistDir}/srv/bookdb"; }; } ================================================ FILE: shared/bookdb/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.bookdb = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [bookdb](https://github.com/barrucadu/bookdb) service. ''; }; port = mkOption { type = types.int; default = 46667; description = '' Port (on 127.0.0.1) to expose bookdb on. ''; }; elasticsearchPort = mkOption { type = types.int; default = 47164; description = '' Port (on 127.0.0.1) to expose the elasticsearch container on. ''; }; elasticsearchTag = mkOption { type = types.str; default = "9.0.1"; description = '' Tag to use of the `elasticsearch` container image. ''; }; readOnly = mkOption { type = types.bool; default = false; description = '' Launch the service in "read-only" mode. Enable this if exposing it to a public network. ''; }; dataDir = mkOption { type = types.str; default = "/srv/bookdb"; description = '' Directory to store uploaded files to. If the `erase-your-darlings` module is enabled, this is overridden to be on the persistent volume. ''; }; logLevel = mkOption { type = types.str; default = "info"; description = '' Verbosity of the log messages. ''; }; logFormat = mkOption { type = types.str; default = "json,no-time"; description = '' Format of the log messages. ''; }; remoteSync = { receive = { enable = mkOption { type = types.bool; default = false; description = '' Enable receiving push-based remote sync from other hosts. ''; }; authorizedKeys = mkOption { type = types.listOf types.str; default = [ ]; description = '' SSH public keys to allow pushes from. ''; }; }; send = { enable = mkOption { type = types.bool; default = false; description = '' Enable periodically pushing local state to other hosts. ''; }; sshKeyFile = mkOption { type = types.str; description = '' Path to SSH private key. ''; }; targets = mkOption { type = types.listOf types.str; default = [ ]; description = '' Hosts to push to. ''; }; }; }; }; } ================================================ FILE: shared/bookdb/remote-sync-receive.nix ================================================ # See remote-sync-send.nix { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookdb.remoteSync.receive; in { config = mkIf cfg.enable { users.users.bookdb-remote-sync-receive = { uid = 985; home = "/var/lib/bookdb-remote-sync-receive"; createHome = true; isSystemUser = true; openssh.authorizedKeys.keys = cfg.authorizedKeys; shell = pkgs.bashInteractive; group = "nogroup"; packages = let receive-covers = '' if [[ ! -d ~/bookdb-covers ]]; then echo "bookdb-covers does not exist" exit 1 fi /run/wrappers/bin/sudo ${pkgs.rsync}/bin/rsync -a --delete ~/bookdb-covers/ ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR} || exit 1 /run/wrappers/bin/sudo ${pkgs.coreutils}/bin/chown -R ${config.users.users.bookdb.name}.nogroup ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR} || exit 1 ''; receive-elasticsearch = '' env ES_HOST=${config.systemd.services.bookdb.environment.ES_HOST} \ ${pkgs.nixfiles.bookdb}/bin/bookdb_ctl import-index --drop-existing ''; in [ (pkgs.writeShellScriptBin "receive-covers" receive-covers) (pkgs.writeShellScriptBin "receive-elasticsearch" receive-elasticsearch) ]; }; security.sudo.extraRules = [ { users = [ config.users.users.bookdb-remote-sync-receive.name ]; commands = [ { command = "${pkgs.rsync}/bin/rsync -a --delete ${config.users.users.bookdb-remote-sync-receive.home}/bookdb-covers/ ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR}"; options = [ "NOPASSWD" ]; } { command = "${pkgs.coreutils}/bin/chown -R ${config.users.users.bookdb.name}.nogroup ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR}"; options = [ "NOPASSWD" ]; } ]; } ]; }; } ================================================ FILE: shared/bookdb/remote-sync-send.nix ================================================ # See remote-sync-receive.nix { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookdb.remoteSync.send; toService = target: { name = "bookdb-sync-${target}"; value = { description = "Upload bookdb data to ${target}"; startAt = "*:15"; path = with pkgs; [ openssh rsync ]; serviceConfig = { ExecStart = pkgs.writeShellScript "bookdb-sync" '' set -ex cd $RUNTIME_DIRECTORY /run/wrappers/bin/sudo ${pkgs.coreutils}/bin/cp --preserve=timestamps -r ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR}/ bookdb-covers trap "/run/wrappers/bin/sudo ${pkgs.coreutils}/bin/rm -rf bookdb-covers" EXIT rsync -az\ -e "ssh -i $SSH_KEY_FILE -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" \ bookdb-covers/ \ bookdb-remote-sync-receive@${target}:~/bookdb-covers/ ssh -i "$SSH_KEY_FILE" \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ bookdb-remote-sync-receive@${target} \ receive-covers env "ES_HOST=$ES_HOST" \ ${pkgs.nixfiles.bookdb}/bin/bookdb_ctl export-index | \ ssh -i "$SSH_KEY_FILE" \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ bookdb-remote-sync-receive@${target} \ receive-elasticsearch ''; User = config.users.users.bookdb-remote-sync-send.name; RuntimeDirectory = "bookdb-sync-${target}"; }; environment = { ES_HOST = config.systemd.services.bookdb.environment.ES_HOST; SSH_KEY_FILE = cfg.sshKeyFile; }; }; }; in { config = mkIf cfg.enable { users.users.bookdb-remote-sync-send = { uid = 985; isSystemUser = true; shell = pkgs.bashInteractive; group = "nogroup"; }; systemd.services = listToAttrs (map toService cfg.targets); security.sudo.extraRules = [ { users = [ config.users.users.bookdb-remote-sync-send.name ]; commands = [ { command = "${pkgs.coreutils}/bin/cp --preserve=timestamps -r ${config.systemd.services.bookdb.environment.BOOKDB_UPLOADS_DIR}/ bookdb-covers"; options = [ "NOPASSWD" ]; } { command = "${pkgs.coreutils}/bin/rm -rf bookdb-covers"; options = [ "NOPASSWD" ]; } ]; } ]; }; } ================================================ FILE: shared/bookdb/uuids.yaml ================================================ # shared between nyarlathotep & carcosa locations: - name: House slug: be60be7b-a10f-42e1-8769-d43f12cad02d - name: Packed slug: edd8cfea-820d-4b08-bbb7-b50687279ff5 - name: Missing slug: 6a233e5e-3b64-4169-ac67-cf46113afd97 categories: - name: Light Novels + Manga slug: a3bbb1c6-5ff8-4ddf-81f4-820593a2a5ff - name: Nonfiction slug: 58c63aea-72b6-4988-96a0-aca572661303 children: - name: Computer Science + Software Engineering slug: afc7135b-bf67-4284-bcc1-2bbd3386aea3 - name: Kitchen, Food, + Recipe slug: b5451ba6-a3ef-4c27-99fc-a07d8cd54161 - name: History slug: 6e7ffdc5-9571-43b3-800b-6e9fc0e0bb92 children: - name: Ancient Near East slug: e859b37c-454b-40a3-afef-f7678f487377 - name: Greece + Rome slug: 22987d70-6910-44e5-a7db-8979c0030400 - name: Modern slug: b3b648d8-e64e-446e-8553-9de38070d78f - name: Miscellaneous slug: e3553aae-c91e-4c77-a26d-d1a63d755e69 - name: Economics + Finance slug: 8a8b44cd-65c1-49ed-a126-2b05acc82539 - name: Politics + Philosophy slug: ac4706f3-54c3-4e6d-a72d-85321d9dcd72 - name: Miscellaneous slug: fb2dd601-883a-4254-a294-fcf0a0f98d2f - name: Prose Fiction + Graphic Novels slug: 590ac55d-0644-4a71-b902-587faa5b03d9 - name: Religion, Mythology, + Folklore slug: a7d83bc9-0352-4fb5-a9dc-68428562a17f - name: RPG slug: cf921942-f65a-40e3-8e98-2f565bb8d033 children: - name: ALIEN slug: e5a2fe09-f4b6-447a-9d83-8e2a89a9c605 - name: Call of Cthulhu slug: 08bc011e-1a42-4d23-961a-803d786d7e58 - name: Delta Green slug: 3aa3b315-a93a-42af-b221-c36ddfb556d0 - name: "D&D + OSR" slug: 99569e4e-d52c-4e3b-8c2b-8e69e2ff29b7 - name: The One Ring slug: 833cfe57-0092-4acb-9bb2-5211f5c89016 - name: Traveller slug: d8d4ee9d-e5d8-4d4d-8a78-65ebc23fc451 - name: Solo slug: 461dd073-f203-4401-bc09-45c01d98b20b - name: Miscellaneous slug: 70196ec9-dd61-4241-afc9-dd6be7be30a6 - name: Verse slug: 217f8eaa-b54a-466c-83f8-3f569f46732e - name: To Donate slug: 957d6a70-5dfc-46e2-8e3c-2f193878b2a5 ================================================ FILE: shared/bookmarks/default.nix ================================================ # [bookmarks][] is a webapp to keep track of all my bookmarks, with a public # instance on [bookmarks.barrucadu.co.uk][]. # # bookmarks uses a containerised elasticsearch database. # # **Backups:** the elasticsearch database. # # [bookmarks]: https://github.com/barrucadu/bookmarks # [bookmarks.barrucadu.co.uk]: https://bookmarks.barrucadu.co.uk/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookmarks; backend = config.nixfiles.oci-containers.backend; in { imports = [ ./options.nix ./remote-sync-receive.nix ./remote-sync-send.nix ]; config = mkIf cfg.enable { systemd.services.bookmarks = { description = "barrucadu/bookmarks webapp"; wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" "${backend}-bookmarks-db.service" ]; wants = [ "network-online.target" ]; requires = [ "${backend}-bookmarks-db.service" ]; serviceConfig = { ExecStart = "${pkgs.nixfiles.bookmarks}/bin/bookmarks ${optionalString (!cfg.readOnly) "--allow-writes"}"; DynamicUser = "true"; Restart = "always"; }; environment = { BOOKMARKS_ADDRESS = "127.0.0.1:${toString cfg.port}"; ES_HOST = "http://127.0.0.1:${toString cfg.elasticsearchPort}"; RUST_LOG = cfg.logLevel; RUST_LOG_FORMAT = cfg.logFormat; }; }; nixfiles.oci-containers.pods.bookmarks.containers.db = { image = "mirror.gcr.io/elasticsearch:${cfg.elasticsearchTag}"; environment = { "http.host" = "0.0.0.0"; "discovery.type" = "single-node"; "xpack.security.enabled" = "false"; "ES_JAVA_OPTS" = "-Xms512M -Xmx512M"; }; ports = [{ host = cfg.elasticsearchPort; inner = 9200; }]; volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }]; }; nixfiles.restic-backups.backups.bookmarks = { prepareCommand = '' env ES_HOST=${config.systemd.services.bookmarks.environment.ES_HOST} ${pkgs.nixfiles.bookmarks}/bin/bookmarks_ctl export-index > elasticsearch-dump.json ''; paths = [ "elasticsearch-dump.json" ]; }; }; } ================================================ FILE: shared/bookmarks/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.bookmarks = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [bookmarks](https://github.com/barrucadu/bookmarks) service. ''; }; port = mkOption { type = types.int; default = 48372; description = '' Port (on 127.0.0.1) to expose bookmarks on. ''; }; elasticsearchPort = mkOption { type = types.int; default = 43389; description = '' Port (on 127.0.0.1) to expose the elasticsearch container on. ''; }; elasticsearchTag = mkOption { type = types.str; default = "9.0.1"; description = '' Tag to use of the `elasticsearch` container image. ''; }; readOnly = mkOption { type = types.bool; default = false; description = '' Launch the service in "read-only" mode. Enable this if exposing it to a public network. ''; }; logLevel = mkOption { type = types.str; default = "info"; description = '' Verbosity of the log messages. ''; }; logFormat = mkOption { type = types.str; default = "json,no-time"; description = '' Format of the log messages. ''; }; remoteSync = { receive = { enable = mkOption { type = types.bool; default = false; description = '' Enable receiving push-based remote sync from other hosts. ''; }; authorizedKeys = mkOption { type = types.listOf types.str; default = [ ]; description = '' SSH public keys to allow pushes from. ''; }; }; send = { enable = mkOption { type = types.bool; default = false; description = '' Enable periodically pushing local state to other hosts. ''; }; sshKeyFile = mkOption { type = types.str; description = '' Path to SSH private key. ''; }; targets = mkOption { type = types.listOf types.str; default = [ ]; description = '' Hosts to push to. ''; }; }; }; }; } ================================================ FILE: shared/bookmarks/remote-sync-receive.nix ================================================ # see remote-sync-send.nix { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookmarks.remoteSync.receive; in { config = mkIf cfg.enable { users.users.bookmarks-remote-sync-receive = { uid = 984; home = "/var/lib/bookmarks-remote-sync-receive"; createHome = true; isSystemUser = true; openssh.authorizedKeys.keys = cfg.authorizedKeys; shell = pkgs.bashInteractive; group = "nogroup"; packages = let receive-elasticsearch = '' env ES_HOST=${config.systemd.services.bookmarks.environment.ES_HOST} \ ${pkgs.nixfiles.bookmarks}/bin/bookmarks_ctl import-index --drop-existing ''; in [ (pkgs.writeShellScriptBin "receive-elasticsearch" receive-elasticsearch) ]; }; }; } ================================================ FILE: shared/bookmarks/remote-sync-send.nix ================================================ # see remote-sync-receive.nix { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.bookmarks.remoteSync.send; toService = target: { name = "bookmarks-sync-${target}"; value = { description = "Upload bookmarks data to ${target}"; startAt = "*:15"; path = with pkgs; [ openssh ]; serviceConfig = { ExecStart = pkgs.writeShellScript "bookmarks-sync" '' set -ex env "ES_HOST=$ES_HOST" \ ${pkgs.nixfiles.bookmarks}/bin/bookmarks_ctl export-index | \ ssh -i "$SSH_KEY_FILE" \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ bookmarks-remote-sync-receive@${target} \ receive-elasticsearch ''; User = config.users.users.bookmarks-remote-sync-send.name; }; environment = { ES_HOST = config.systemd.services.bookmarks.environment.ES_HOST; SSH_KEY_FILE = cfg.sshKeyFile; }; }; }; in { config = mkIf cfg.enable { users.users.bookmarks-remote-sync-send = { uid = 984; isSystemUser = true; shell = pkgs.bashInteractive; group = "nogroup"; }; systemd.services = listToAttrs (map toService cfg.targets); }; } ================================================ FILE: shared/dashboards/node-stats-detailed.json ================================================ { "annotations": { "list": [ { "$$hashKey": "object:1058", "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "gnetId": 1860, "graphTooltip": 1, "links": [ { "icon": "external link", "tags": [], "targetBlank": true, "title": "GitHub", "type": "link", "url": "https://github.com/rfmoz/grafana-dashboards" }, { "icon": "external link", "tags": [], "targetBlank": true, "title": "Grafana", "type": "link", "url": "https://grafana.com/grafana/dashboards/1860" } ], "liveNow": false, "panels": [ { "collapsed": false, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 261, "panels": [], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Quick CPU / Mem / Disk", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Resource pressure via PSI", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "links": [], "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "percentage", "steps": [ { "color": "green", "value": null }, { "color": "dark-yellow", "value": 70 }, { "color": "dark-red", "value": 90 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 0, "y": 1 }, "id": 323, "options": { "displayMode": "basic", "maxVizHeight": 300, "minVizHeight": 10, "minVizWidth": 0, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "text": {}, "valueMode": "color" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "irate(node_pressure_cpu_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "instant": true, "intervalFactor": 1, "legendFormat": "CPU", "range": false, "refId": "CPU some", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "irate(node_pressure_memory_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "instant": true, "intervalFactor": 1, "legendFormat": "Mem", "range": false, "refId": "Memory some", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "irate(node_pressure_io_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "instant": true, "intervalFactor": 1, "legendFormat": "I/O", "range": false, "refId": "I/O some", "step": 240 } ], "title": "Pressure", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Busy state of all CPU cores together", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 85 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 95 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 3, "y": 1 }, "id": 20, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "100 * (1 - avg(rate(node_cpu_seconds_total{mode=\"idle\", instance=\"$node\"}[$__rate_interval])))", "hide": false, "instant": true, "intervalFactor": 1, "legendFormat": "", "range": false, "refId": "A", "step": 240 } ], "title": "CPU Busy", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "System load over all CPU cores together", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 85 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 95 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 6, "y": 1 }, "id": 155, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "scalar(node_load1{instance=\"$node\",job=\"$job\"}) * 100 / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", "format": "time_series", "hide": false, "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "Sys Load", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Non available RAM memory", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 80 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 9, "y": 1 }, "hideTimeOverride": false, "id": 16, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "((node_memory_MemTotal_bytes{instance=\"$node\", job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\", job=\"$job\"}) / node_memory_MemTotal_bytes{instance=\"$node\", job=\"$job\"}) * 100", "format": "time_series", "hide": true, "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "(1 - (node_memory_MemAvailable_bytes{instance=\"$node\", job=\"$job\"} / node_memory_MemTotal_bytes{instance=\"$node\", job=\"$job\"})) * 100", "format": "time_series", "hide": false, "instant": true, "intervalFactor": 1, "range": false, "refId": "B", "step": 240 } ], "title": "RAM Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Used Swap", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 25 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 12, "y": 1 }, "id": 21, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "((node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"})) * 100", "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "SWAP Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Used Root FS", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 80 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 15, "y": 1 }, "id": 154, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"} * 100) / node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"})", "format": "time_series", "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "Root FS Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Total number of CPU cores", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 2, "w": 2, "x": 18, "y": 1 }, "id": 14, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", "instant": true, "legendFormat": "__auto", "range": false, "refId": "A" } ], "title": "CPU Cores", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "System uptime", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 2, "w": 4, "x": 20, "y": 1 }, "hideTimeOverride": true, "id": 15, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "node_time_seconds{instance=\"$node\",job=\"$job\"} - node_boot_time_seconds{instance=\"$node\",job=\"$job\"}", "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "Uptime", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Total RootFS", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 70 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 2, "w": 2, "x": 18, "y": 3 }, "id": 23, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"}", "format": "time_series", "hide": false, "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "RootFS Total", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Total RAM", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 2, "w": 2, "x": 20, "y": 3 }, "id": 75, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "RAM Total", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Total SWAP", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 2, "w": 2, "x": 22, "y": 3 }, "id": 18, "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.12", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"}", "instant": true, "intervalFactor": 1, "range": false, "refId": "A", "step": 240 } ], "title": "SWAP Total", "type": "stat" }, { "collapsed": false, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, "id": 263, "panels": [], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Basic CPU / Mem / Net / Disk", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Basic CPU info", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "percent" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byName", "options": "Busy Iowait" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Idle" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Busy Iowait" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Idle" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Busy System" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Busy User" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Busy Other" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 6 }, "id": 77, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true, "width": 250 }, "tooltip": { "mode": "multi", "sort": "desc" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "exemplar": false, "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "hide": false, "instant": false, "intervalFactor": 1, "legendFormat": "Busy System", "range": true, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Busy User", "range": true, "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Busy Iowait", "range": true, "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=~\".*irq\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Busy IRQs", "range": true, "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode!='idle',mode!='user',mode!='system',mode!='iowait',mode!='irq',mode!='softirq'}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Busy Other", "range": true, "refId": "E", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Idle", "range": true, "refId": "F", "step": 240 } ], "title": "CPU Basic", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Basic memory usage", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "SWAP Used" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap Used" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.stacking", "value": { "group": false, "mode": "normal" } } ] }, { "matcher": { "id": "byName", "options": "RAM Cache + Buffer" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Available" }, "properties": [ { "id": "color", "value": { "fixedColor": "#DEDAF7", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.stacking", "value": { "group": false, "mode": "normal" } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 6 }, "id": 78, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "RAM Total", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - (node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "RAM Used", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "RAM Cache + Buffer", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "RAM Free", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", "format": "time_series", "intervalFactor": 1, "legendFormat": "SWAP Used", "refId": "E", "step": 240 } ], "title": "Memory Basic", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Basic network info per interface", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bps" }, "overrides": [ { "matcher": { "id": "byName", "options": "Recv_bytes_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Recv_bytes_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Recv_drop_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Recv_drop_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Recv_errs_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Recv_errs_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CCA300", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_bytes_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_bytes_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_drop_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_drop_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_errs_eth2" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Trans_errs_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CCA300", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "recv_bytes_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "recv_drop_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "recv_drop_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#967302", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "recv_errs_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "recv_errs_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_bytes_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_bytes_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_drop_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_drop_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#967302", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_errs_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "trans_errs_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 13 }, "id": 74, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", "format": "time_series", "intervalFactor": 1, "legendFormat": "recv {{device}}", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", "format": "time_series", "intervalFactor": 1, "legendFormat": "trans {{device}} ", "refId": "B", "step": 240 } ], "title": "Network Traffic Basic", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Disk space used of all filesystems mounted", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 13 }, "id": 152, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'} * 100) / node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'})", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{mountpoint}}", "refId": "A", "step": 240 } ], "title": "Disk Space Used Basic", "type": "timeseries" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 20 }, "id": 265, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "percentage", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 70, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "percent" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byName", "options": "Idle - Waiting for something to happen" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Iowait - Waiting for I/O to complete" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Irq - Servicing interrupts" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Nice - Niced processes executing in user mode" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Softirq - Servicing softirqs" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Steal - Time spent in other operating systems when running in a virtualized environment" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCE2DE", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "System - Processes executing in kernel mode" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "User - Normal processes executing in user mode" }, "properties": [ { "id": "color", "value": { "fixedColor": "#5195CE", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 21 }, "id": 3, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 250 }, "tooltip": { "mode": "multi", "sort": "desc" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "System - Processes executing in kernel mode", "range": true, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "User - Normal processes executing in user mode", "range": true, "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"nice\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Nice - Niced processes executing in user mode", "range": true, "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Iowait - Waiting for I/O to complete", "range": true, "refId": "E", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"irq\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Irq - Servicing interrupts", "range": true, "refId": "F", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"softirq\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Softirq - Servicing softirqs", "range": true, "refId": "G", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"steal\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Steal - Time spent in other operating systems when running in a virtualized environment", "range": true, "refId": "H", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Idle - Waiting for something to happen", "range": true, "refId": "J", "step": 240 } ], "title": "CPU", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap - Swap memory usage" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused - Free memory unassigned" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Hardware Corrupted - *./" }, "properties": [ { "id": "custom.stacking", "value": { "group": false, "mode": "normal" } } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 12, "y": 21 }, "id": 24, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"} - node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Apps - Memory used by user-space applications", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "PageTables - Memory used to map between virtual and physical memory addresses", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "SwapCache - Memory that keeps track of pages that have been fetched from swap but not yet been modified", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Slab - Memory used by the kernel to cache data structures for its own use (caches like inode, dentry, etc)", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Cache - Parked file data (file content) cache", "refId": "E", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Buffers - Block device (e.g. harddisk) cache", "refId": "F", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Unused - Free memory unassigned", "refId": "G", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Swap - Swap space used", "refId": "H", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_HardwareCorrupted_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working", "refId": "I", "step": 240 } ], "title": "Memory Stack", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bits out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bps" }, "overrides": [ { "matcher": { "id": "byName", "options": "receive_packets_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "receive_packets_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "transmit_packets_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "transmit_packets_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 33 }, "id": 84, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit", "refId": "B", "step": 240 } ], "title": "Network Traffic", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 12, "w": 12, "x": 12, "y": 33 }, "id": 156, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'} - node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{mountpoint}}", "refId": "A", "step": 240 } ], "title": "Disk Space Used", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "IO read (-) / write (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "iops" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Read.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 45 }, "id": 229, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", "intervalFactor": 4, "legendFormat": "{{device}} - Reads completed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", "intervalFactor": 1, "legendFormat": "{{device}} - Writes completed", "refId": "B", "step": 240 } ], "title": "Disk IOps", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes read (-) / write (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [ { "matcher": { "id": "byName", "options": "io time" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*read*./" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byType", "options": "time" }, "properties": [ { "id": "custom.axisPlacement", "value": "hidden" } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 12, "y": 45 }, "id": 42, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{device}} - Successfully read bytes", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{device}} - Successfully written bytes", "refId": "B", "step": 240 } ], "title": "I/O Usage Read / Write", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "%util", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 40, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byName", "options": "io time" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] }, { "matcher": { "id": "byType", "options": "time" }, "properties": [ { "id": "custom.axisPlacement", "value": "hidden" } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 57 }, "id": 127, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"} [$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{device}}", "refId": "A", "step": 240 } ], "title": "I/O Utilization", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "percentage", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 70, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "max": 1, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/^Guest - /" }, "properties": [ { "id": "color", "value": { "fixedColor": "#5195ce", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/^GuestNice - /" }, "properties": [ { "id": "color", "value": { "fixedColor": "#c15c17", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 12, "w": 12, "x": 12, "y": 57 }, "id": 319, "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum by(instance) (irate(node_cpu_guest_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[1m])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[1m])))", "hide": false, "legendFormat": "Guest - Time spent running a virtual CPU for a guest operating system", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "sum by(instance) (irate(node_cpu_guest_seconds_total{instance=\"$node\",job=\"$job\", mode=\"nice\"}[1m])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[1m])))", "hide": false, "legendFormat": "GuestNice - Time spent running a niced guest (virtual CPU for guest operating system)", "range": true, "refId": "B" } ], "title": "CPU spent seconds in guests (VMs)", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "CPU / Memory / Net / Disk", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 21 }, "id": 266, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 54 }, "id": 136, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Inactive_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Inactive - Memory which has been less recently used. It is more eligible to be reclaimed for other purposes", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Active_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Active - Memory that has been used more recently and usually not reclaimed unless absolutely necessary", "refId": "B", "step": 240 } ], "title": "Memory Active / Inactive", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*CommitLimit - *./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 54 }, "id": 135, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Committed_AS_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Committed_AS - Amount of memory presently allocated on the system", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_CommitLimit_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "CommitLimit - Amount of memory currently available to be allocated on the system", "refId": "B", "step": 240 } ], "title": "Memory Committed", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 64 }, "id": 191, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Inactive_file_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Inactive_file - File-backed memory on inactive LRU list", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Inactive_anon_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Inactive_anon - Anonymous and swap cache on inactive LRU list, including tmpfs (shmem)", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Active_file_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Active_file - File-backed memory on active LRU list", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Active_anon_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Active_anon - Anonymous and swap cache on active least-recently-used (LRU) list, including tmpfs", "refId": "D", "step": 240 } ], "title": "Memory Active / Inactive Detail", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 64 }, "id": 130, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Writeback_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Writeback - Memory which is actively being written back to disk", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_WritebackTmp_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "WritebackTmp - Memory used by FUSE for temporary writeback buffers", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Dirty_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Dirty - Memory which is waiting to get written back to the disk", "refId": "C", "step": 240 } ], "title": "Memory Writeback and Dirty", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 74 }, "id": 138, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Mapped_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Mapped - Used memory in mapped pages files which have been mapped, such as libraries", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Shmem_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Shmem - Used shared memory (shared between several processes, thus including RAM disks)", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_ShmemHugePages_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_ShmemPmdMapped_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "ShmemPmdMapped - Amount of shared (shmem/tmpfs) memory backed by huge pages", "refId": "D", "step": 240 } ], "title": "Memory Shared and Mapped", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 74 }, "id": 131, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_SUnreclaim_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "SUnreclaim - Part of Slab, that cannot be reclaimed on memory pressure", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "SReclaimable - Part of Slab, that might be reclaimed, such as caches", "refId": "B", "step": 240 } ], "title": "Memory Slab", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 84 }, "id": 70, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_VmallocChunk_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "VmallocChunk - Largest contiguous block of vmalloc area which is free", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_VmallocTotal_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "VmallocTotal - Total size of vmalloc memory area", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_VmallocUsed_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "VmallocUsed - Amount of vmalloc area which is used", "refId": "C", "step": 240 } ], "title": "Memory Vmalloc", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 84 }, "id": 159, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Bounce_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Bounce - Memory used for block device bounce buffers", "refId": "A", "step": 240 } ], "title": "Memory Bounce", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Inactive *./" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 94 }, "id": 129, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_AnonHugePages_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "AnonHugePages - Memory in anonymous huge pages", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_AnonPages_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "AnonPages - Memory in user pages not backed by files", "refId": "B", "step": 240 } ], "title": "Memory Anonymous", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 94 }, "id": 160, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_KernelStack_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "KernelStack - Kernel memory stack. This is not reclaimable", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Percpu_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "PerCPU - Per CPU memory allocated dynamically by loadable modules", "refId": "B", "step": 240 } ], "title": "Memory Kernel / CPU", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "pages", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 104 }, "id": 140, "links": [], "options": { "legend": { "calcs": [ "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_HugePages_Free{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "HugePages_Free - Huge pages in the pool that are not yet allocated", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_HugePages_Rsvd{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "HugePages_Rsvd - Huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_HugePages_Surp{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "HugePages_Surp - Huge pages in the pool above the value in /proc/sys/vm/nr_hugepages", "refId": "C", "step": 240 } ], "title": "Memory HugePages Counter", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 104 }, "id": 71, "links": [], "options": { "legend": { "calcs": [ "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_HugePages_Total{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "HugePages - Total size of the pool of huge pages", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Hugepagesize - Huge Page size", "refId": "B", "step": 240 } ], "title": "Memory HugePages Size", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 114 }, "id": 128, "links": [], "options": { "legend": { "calcs": [ "mean", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_DirectMap1G_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "DirectMap1G - Amount of pages mapped as this size", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_DirectMap2M_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "DirectMap2M - Amount of pages mapped as this size", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_DirectMap4k_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "DirectMap4K - Amount of pages mapped as this size", "refId": "C", "step": 240 } ], "title": "Memory DirectMap", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 114 }, "id": 137, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Unevictable_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Unevictable - Amount of unevictable memory that can't be swapped out for a variety of reasons", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_Mlocked_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "MLocked - Size of pages locked to memory using the mlock() system call", "refId": "B", "step": 240 } ], "title": "Memory Unevictable and MLocked", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 124 }, "id": 132, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_memory_NFS_Unstable_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "NFS Unstable - Memory in NFS pages sent to the server, but not yet committed to the storage", "refId": "A", "step": 240 } ], "title": "Memory NFS", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Memory Meminfo", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 22 }, "id": 267, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "pages out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*out/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 41 }, "id": 176, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pgpgin{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pagesin - Page in operations", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pgpgout{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pagesout - Page out operations", "refId": "B", "step": 240 } ], "title": "Memory Pages In / Out", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "pages out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*out/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 41 }, "id": 22, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pswpin{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pswpin - Pages swapped in", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pswpout{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pswpout - Pages swapped out", "refId": "B", "step": 240 } ], "title": "Memory Pages Swap In / Out", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "faults", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Apps" }, "properties": [ { "id": "color", "value": { "fixedColor": "#629E51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A437C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" }, "properties": [ { "id": "color", "value": { "fixedColor": "#CFFAFF", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "RAM_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab" }, "properties": [ { "id": "color", "value": { "fixedColor": "#806EB7", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#2F575E", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Unused" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Pgfault - Page major and minor fault operations" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.stacking", "value": { "group": false, "mode": "normal" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 51 }, "id": 175, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 350 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pgfault - Page major and minor fault operations", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pgmajfault - Major page fault operations", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval]) - irate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Pgminfault - Minor page fault operations", "refId": "C", "step": 240 } ], "title": "Memory Page Faults", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#99440A", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Buffers" }, "properties": [ { "id": "color", "value": { "fixedColor": "#58140C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6D1F62", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Cached" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Committed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#508642", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Dirty" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Free" }, "properties": [ { "id": "color", "value": { "fixedColor": "#B7DBAB", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Mapped" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "PageTables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Page_Tables" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Slab_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Swap_Cache" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C15C17", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total" }, "properties": [ { "id": "color", "value": { "fixedColor": "#511749", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total RAM + Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#052B51", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Total Swap" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "VmallocUsed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 51 }, "id": 307, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_vmstat_oom_kill{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "oom killer invocations ", "refId": "A", "step": 240 } ], "title": "OOM Killer", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Memory Vmstat", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 23 }, "id": 293, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "seconds", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Variation*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 24 }, "id": 260, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_estimated_error_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Estimated error in seconds", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_offset_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Time offset in between local system and reference clock", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_maxerror_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Maximum error in seconds", "refId": "C", "step": 240 } ], "title": "Time Synchronized Drift", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 24 }, "id": 291, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_loop_time_constant{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Phase-locked loop time adjust", "refId": "A", "step": 240 } ], "title": "Time PLL Adjust", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Variation*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 34 }, "id": 168, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_sync_status{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Is clock synchronized to a reliable server (1 = yes, 0 = no)", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_frequency_adjustment_ratio{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Local clock frequency adjustment", "refId": "B", "step": 240 } ], "title": "Time Synchronized Status", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "seconds", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 34 }, "id": 294, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_tick_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Seconds between clock ticks", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_timex_tai_offset_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "International Atomic Time (TAI) offset", "refId": "B", "step": 240 } ], "title": "Time Misc", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "System Timesync", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 24 }, "id": 312, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 73 }, "id": 62, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_procs_blocked{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Processes blocked waiting for I/O to complete", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_procs_running{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Processes in runnable state", "refId": "B", "step": 240 } ], "title": "Processes Status", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Enable with --collector.processes argument on node-exporter", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 73 }, "id": 315, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_processes_state{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{ state }}", "refId": "A", "step": 240 } ], "title": "Processes State", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "forks / sec", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 83 }, "id": 148, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_forks_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Processes forks second", "refId": "A", "step": 240 } ], "title": "Processes Forks", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "decbytes" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Max.*/" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 83 }, "id": 149, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(process_virtual_memory_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Processes virtual memory size in bytes", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "process_resident_memory_max_bytes{instance=\"$node\",job=\"$job\"}", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Maximum amount of virtual memory available in bytes", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(process_virtual_memory_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Processes virtual memory size in bytes", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(process_virtual_memory_max_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Maximum amount of virtual memory available in bytes", "refId": "D", "step": 240 } ], "title": "Processes Memory", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Enable with --collector.processes argument on node-exporter", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "PIDs limit" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F2495C", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 93 }, "id": 313, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_processes_pids{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Number of PIDs", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_processes_max_processes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "PIDs limit", "refId": "B", "step": 240 } ], "title": "PIDs Number and Limit", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "seconds", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*waiting.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 93 }, "id": 305, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_schedstat_running_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{ cpu }} - seconds spent running a process", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_schedstat_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{ cpu }} - seconds spent by processing waiting for this CPU", "refId": "B", "step": 240 } ], "title": "Process schedule stats Running / Waiting", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Enable with --collector.processes argument on node-exporter", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Threads limit" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F2495C", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 103 }, "id": 314, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_processes_threads{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Allocated threads", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_processes_max_threads{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Threads limit", "refId": "B", "step": 240 } ], "title": "Threads Number and Limit", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "System Processes", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 25 }, "id": 269, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 26 }, "id": 8, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_context_switches_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "Context switches", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_intr_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Interrupts", "refId": "B", "step": 240 } ], "title": "Context Switches / Interrupts", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 26 }, "id": 7, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_load1{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 4, "legendFormat": "Load 1m", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_load5{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 4, "legendFormat": "Load 5m", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_load15{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 4, "legendFormat": "Load 15m", "refId": "C", "step": 240 } ], "title": "System Load", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "hertz" }, "overrides": [ { "matcher": { "id": "byName", "options": "Max" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.hideFrom", "value": { "legend": true, "tooltip": false, "viz": false } }, { "id": "custom.fillBelowTo", "value": "Min" } ] }, { "matcher": { "id": "byName", "options": "Min" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }, { "id": "custom.hideFrom", "value": { "legend": true, "tooltip": false, "viz": false } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 36 }, "id": 321, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "node_cpu_scaling_frequency_hertz{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{ cpu }}", "range": true, "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "avg(node_cpu_scaling_frequency_max_hertz{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Max", "range": true, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "avg(node_cpu_scaling_frequency_min_hertz{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Min", "range": true, "refId": "C", "step": 240 } ], "title": "CPU Frequency Scaling", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "https://docs.kernel.org/accounting/psi.html", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byName", "options": "Memory some" }, "properties": [ { "id": "color", "value": { "fixedColor": "dark-red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Memory full" }, "properties": [ { "id": "color", "value": { "fixedColor": "light-red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "I/O some" }, "properties": [ { "id": "color", "value": { "fixedColor": "dark-blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "I/O full" }, "properties": [ { "id": "color", "value": { "fixedColor": "light-blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 36 }, "id": 322, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "rate(node_pressure_cpu_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "CPU some", "range": true, "refId": "CPU some", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "rate(node_pressure_memory_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Memory some", "range": true, "refId": "Memory some", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "rate(node_pressure_memory_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "Memory full", "range": true, "refId": "Memory full", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "rate(node_pressure_io_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "I/O some", "range": true, "refId": "I/O some", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "rate(node_pressure_io_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "I/O full", "range": true, "refId": "I/O full", "step": 240 } ], "title": "Pressure Stall Information", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Enable with --collector.interrupts argument on node-exporter", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Critical*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Max*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 46 }, "id": 259, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_interrupts_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{ type }} - {{ info }}", "refId": "A", "step": 240 } ], "title": "Interrupts Detail", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 46 }, "id": 306, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_schedstat_timeslices_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{ cpu }}", "refId": "A", "step": 240 } ], "title": "Schedule timeslices executed by each cpu", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 56 }, "id": 151, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_entropy_available_bits{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Entropy available to random number generators", "refId": "A", "step": 240 } ], "title": "Entropy", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "seconds", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 56 }, "id": 308, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(process_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Time spent", "refId": "A", "step": 240 } ], "title": "CPU time spent in user and system contexts", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Max*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 66 }, "id": 64, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "process_max_fds{instance=\"$node\",job=\"$job\"}", "interval": "", "intervalFactor": 1, "legendFormat": "Maximum open file descriptors", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "process_open_fds{instance=\"$node\",job=\"$job\"}", "interval": "", "intervalFactor": 1, "legendFormat": "Open file descriptors", "refId": "B", "step": 240 } ], "title": "File Descriptors", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "System Misc", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 26 }, "id": 304, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "temperature", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "celsius" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Critical*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Max*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 59 }, "id": 158, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_hwmon_temp_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{ chip_name }} {{ sensor }} temp", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_hwmon_temp_crit_alarm_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": true, "interval": "", "intervalFactor": 1, "legendFormat": "{{ chip_name }} {{ sensor }} Critical Alarm", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_hwmon_temp_crit_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{ chip_name }} {{ sensor }} Critical", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_hwmon_temp_crit_hyst_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": true, "interval": "", "intervalFactor": 1, "legendFormat": "{{ chip_name }} {{ sensor }} Critical Historical", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_hwmon_temp_max_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": true, "interval": "", "intervalFactor": 1, "legendFormat": "{{ chip_name }} {{ sensor }} Max", "refId": "E", "step": 240 } ], "title": "Hardware temperature monitor", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Max*./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 59 }, "id": 300, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_cooling_device_cur_state{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Current {{ name }} in {{ type }}", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_cooling_device_max_state{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Max {{ name }} in {{ type }}", "refId": "B", "step": 240 } ], "title": "Throttle cooling device", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 69 }, "id": 302, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_power_supply_online{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{ power_supply }} online", "refId": "A", "step": 240 } ], "title": "Power supply", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Hardware Misc", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 27 }, "id": 296, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 46 }, "id": 297, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_systemd_socket_accepted_connections_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{ name }} Connections", "refId": "A", "step": 240 } ], "title": "Systemd Sockets", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Failed" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F2495C", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Inactive" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FF9830", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Active" }, "properties": [ { "id": "color", "value": { "fixedColor": "#73BF69", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Deactivating" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FFCB7D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Activating" }, "properties": [ { "id": "color", "value": { "fixedColor": "#C8F2C2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 46 }, "id": 298, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"activating\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Activating", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"active\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Active", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"deactivating\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Deactivating", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"failed\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Failed", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"inactive\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Inactive", "refId": "E", "step": 240 } ], "title": "Systemd Units State", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Systemd", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 28 }, "id": 270, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The number (after merges) of I/O requests completed per second for the device", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "IO read (-) / write (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "iops" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Read.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 47 }, "id": 9, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "intervalFactor": 4, "legendFormat": "{{device}} - Reads completed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "intervalFactor": 1, "legendFormat": "{{device}} - Writes completed", "refId": "B", "step": 240 } ], "title": "Disk IOps Completed", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The number of bytes read from or written to the device per second", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes read (-) / write (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Read.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 47 }, "id": 33, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 4, "legendFormat": "{{device}} - Read bytes", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Written bytes", "refId": "B", "step": 240 } ], "title": "Disk R/W Data", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The average time for requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "time. read (-) / write (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Read.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 57 }, "id": 37, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_read_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "intervalFactor": 4, "legendFormat": "{{device}} - Read wait time avg", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_write_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{device}} - Write wait time avg", "refId": "B", "step": 240 } ], "title": "Disk Average Wait Time", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The average queue length of the requests that were issued to the device", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "aqu-sz", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 57 }, "id": 35, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_io_time_weighted_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "intervalFactor": 4, "legendFormat": "{{device}}", "refId": "A", "step": 240 } ], "title": "Average Queue Size", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The number of read and write requests merged per second that were queued to the device", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "I/Os", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "iops" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Read.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 67 }, "id": 133, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_reads_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "intervalFactor": 1, "legendFormat": "{{device}} - Read merged", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_writes_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "intervalFactor": 1, "legendFormat": "{{device}} - Write merged", "refId": "B", "step": 240 } ], "title": "Disk R/W Merged", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "%util", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 67 }, "id": 36, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "intervalFactor": 4, "legendFormat": "{{device}} - IO", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_discard_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "intervalFactor": 4, "legendFormat": "{{device}} - discard", "refId": "B", "step": 240 } ], "title": "Time Spent Doing I/Os", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "The number of outstanding requests at the instant the sample was taken. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "Outstanding req.", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 77 }, "id": 34, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_disk_io_now{instance=\"$node\",job=\"$job\"}", "interval": "", "intervalFactor": 4, "legendFormat": "{{device}} - IO now", "refId": "A", "step": 240 } ], "title": "Instantaneous Queue Size", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "IOs", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "iops" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*sda_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EAB839", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#6ED0E0", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EF843C", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#584477", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda2_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BA43A9", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sda3_.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F4D598", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#0A50A1", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#BF1B00", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdb3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0752D", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#962D82", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#614D93", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdc3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#9AC48A", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#65C5DB", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9934E", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#EA6460", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde1.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E0F9D7", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sdd2.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#FCEACA", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*sde3.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F9E2D2", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 77 }, "id": 301, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_discards_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "intervalFactor": 4, "legendFormat": "{{device}} - Discards completed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_disk_discards_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "intervalFactor": 1, "legendFormat": "{{device}} - Discards merged", "refId": "B", "step": 240 } ], "title": "Disk IOps Discards completed / merged", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Storage Disk", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 29 }, "id": 271, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 62 }, "id": 43, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{mountpoint}} - Available", "metric": "", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_free_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "hide": true, "intervalFactor": 1, "legendFormat": "{{mountpoint}} - Free", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "hide": true, "intervalFactor": 1, "legendFormat": "{{mountpoint}} - Size", "refId": "C", "step": 240 } ], "title": "Filesystem space available", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "file nodes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 62 }, "id": 41, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_files_free{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{mountpoint}} - Free file nodes", "refId": "A", "step": 240 } ], "title": "File Nodes Free", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "files", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 72 }, "id": 28, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filefd_maximum{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 4, "legendFormat": "Max open files", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filefd_allocated{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "Open files", "refId": "B", "step": 240 } ], "title": "File Descriptor", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "file Nodes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 72 }, "id": 219, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_files{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{mountpoint}} - File nodes total", "refId": "A", "step": 240 } ], "title": "File Nodes Size", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "/ ReadOnly" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 82 }, "id": 44, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_readonly{instance=\"$node\",job=\"$job\",device!~'rootfs'}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{mountpoint}} - ReadOnly", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_filesystem_device_error{instance=\"$node\",job=\"$job\",device!~'rootfs',fstype!~'tmpfs'}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{mountpoint}} - Device error", "refId": "B", "step": 240 } ], "title": "Filesystem in ReadOnly / Error", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Storage Filesystem", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 30 }, "id": 272, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byName", "options": "receive_packets_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "receive_packets_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "transmit_packets_eth0" }, "properties": [ { "id": "color", "value": { "fixedColor": "#7EB26D", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "transmit_packets_lo" }, "properties": [ { "id": "color", "value": { "fixedColor": "#E24D42", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 47 }, "id": 60, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{device}} - Receive", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit", "refId": "B", "step": 240 } ], "title": "Network Traffic by Packets", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 47 }, "id": 142, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive errors", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit errors", "refId": "B", "step": 240 } ], "title": "Network Traffic Errors", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 57 }, "id": 143, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive drop", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit drop", "refId": "B", "step": 240 } ], "title": "Network Traffic Drop", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 57 }, "id": 141, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive compressed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit compressed", "refId": "B", "step": 240 } ], "title": "Network Traffic Compressed", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 67 }, "id": 146, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_multicast_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive multicast", "refId": "A", "step": 240 } ], "title": "Network Traffic Multicast", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 67 }, "id": 144, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Receive fifo", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit fifo", "refId": "B", "step": 240 } ], "title": "Network Traffic Fifo", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "pps" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 77 }, "id": 145, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_receive_frame_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, "legendFormat": "{{device}} - Receive frame", "refId": "A", "step": 240 } ], "title": "Network Traffic Frame", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 77 }, "id": 231, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_carrier_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Statistic transmit_carrier", "refId": "A", "step": 240 } ], "title": "Network Traffic Carrier", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Trans.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 87 }, "id": 232, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_network_transmit_colls_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{device}} - Transmit colls", "refId": "A", "step": 240 } ], "title": "Network Traffic Colls", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "entries", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "NF conntrack limit" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 87 }, "id": 61, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_nf_conntrack_entries{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "NF conntrack entries", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_nf_conntrack_entries_limit{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "NF conntrack limit", "refId": "B", "step": 240 } ], "title": "NF Conntrack", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "Entries", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 97 }, "id": 230, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_arp_entries{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ device }} - ARP entries", "refId": "A", "step": 240 } ], "title": "ARP Entries", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 0, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 97 }, "id": 288, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_network_mtu_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ device }} - Bytes", "refId": "A", "step": 240 } ], "title": "MTU", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 0, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 107 }, "id": 280, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_network_speed_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ device }} - Speed", "refId": "A", "step": 240 } ], "title": "Speed", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packets", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 0, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 107 }, "id": 289, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_network_transmit_queue_length{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ device }} - Interface transmit queue length", "refId": "A", "step": 240 } ], "title": "Queue Length", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "packetes drop (-) / process (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Dropped.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 117 }, "id": 290, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_softnet_processed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{cpu}} - Processed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_softnet_dropped_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{cpu}} - Dropped", "refId": "B", "step": 240 } ], "title": "Softnet Packets", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 117 }, "id": 310, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_softnet_times_squeezed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "CPU {{cpu}} - Squeezed", "refId": "A", "step": 240 } ], "title": "Softnet Out of Quota", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 127 }, "id": 309, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_network_up{operstate=\"up\",instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{interface}} - Operational state UP", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_network_carrier{instance=\"$node\",job=\"$job\"}", "format": "time_series", "instant": false, "legendFormat": "{{device}} - Physical link state", "refId": "B" } ], "title": "Network Operational Status", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Network Traffic", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 31 }, "id": 273, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 48 }, "id": 63, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_alloc{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "TCP_alloc - Allocated sockets", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_inuse{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "TCP_inuse - Tcp sockets currently in use", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_mem{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": true, "interval": "", "intervalFactor": 1, "legendFormat": "TCP_mem - Used memory for tcp", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_orphan{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "TCP_orphan - Orphan sockets", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_tw{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "TCP_tw - Sockets waiting close", "refId": "E", "step": 240 } ], "title": "Sockstat TCP", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 48 }, "id": 124, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_UDPLITE_inuse{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "UDPLITE_inuse - Udplite sockets currently in use", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_UDP_inuse{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "UDP_inuse - Udp sockets currently in use", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_UDP_mem{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "UDP_mem - Used memory for udp", "refId": "C", "step": 240 } ], "title": "Sockstat UDP", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 58 }, "id": 125, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_FRAG_inuse{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "FRAG_inuse - Frag sockets currently in use", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_RAW_inuse{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "RAW_inuse - Raw sockets currently in use", "refId": "C", "step": 240 } ], "title": "Sockstat FRAG / RAW", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "bytes", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 58 }, "id": 220, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_TCP_mem_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "mem_bytes - TCP sockets in that state", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_UDP_mem_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "mem_bytes - UDP sockets in that state", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_FRAG_memory{instance=\"$node\",job=\"$job\"}", "interval": "", "intervalFactor": 1, "legendFormat": "FRAG_memory - Used memory for frag", "refId": "C" } ], "title": "Sockstat Memory Size", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "sockets", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 68 }, "id": 126, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_sockstat_sockets_used{instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Sockets_used - Sockets currently in use", "refId": "A", "step": 240 } ], "title": "Sockstat Used", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Network Sockstat", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 32 }, "id": 274, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "octets out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Out.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 33 }, "id": 221, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_IpExt_InOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "InOctets - Received octets", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_IpExt_OutOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "intervalFactor": 1, "legendFormat": "OutOctets - Sent octets", "refId": "B", "step": 240 } ], "title": "Netstat IP In / Out Octets", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "datagrams", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 33 }, "id": 81, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true, "width": 300 }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Ip_Forwarding{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Forwarding - IP forwarding", "refId": "A", "step": 240 } ], "title": "Netstat IP Forwarding", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "messages out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Out.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 43 }, "id": 115, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Icmp_InMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "InMsgs - Messages which the entity received. Note that this counter includes all those counted by icmpInErrors", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Icmp_OutMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "OutMsgs - Messages which this entity attempted to send. Note that this counter includes all those counted by icmpOutErrors", "refId": "B", "step": 240 } ], "title": "ICMP In / Out", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "messages out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Out.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 43 }, "id": 50, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Icmp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "InErrors - Messages which the entity received but determined as having ICMP-specific errors (bad ICMP checksums, bad length, etc.)", "refId": "A", "step": 240 } ], "title": "ICMP Errors", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "datagrams out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Out.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Snd.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 53 }, "id": 55, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_InDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "InDatagrams - Datagrams received", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_OutDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "OutDatagrams - Datagrams sent", "refId": "B", "step": 240 } ], "title": "UDP In / Out", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "datagrams", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 53 }, "id": 109, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "InErrors - UDP Datagrams that could not be delivered to an application", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_NoPorts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "NoPorts - UDP Datagrams received on a port with no listener", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_UdpLite_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "legendFormat": "InErrors Lite - UDPLite Datagrams that could not be delivered to an application", "refId": "C" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_RcvbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "RcvbufErrors - UDP buffer errors received", "refId": "D", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Udp_SndbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "SndbufErrors - UDP buffer errors send", "refId": "E", "step": 240 } ], "title": "UDP Errors", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "datagrams out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Out.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] }, { "matcher": { "id": "byRegexp", "options": "/.*Snd.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 63 }, "id": 299, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_InSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "instant": false, "interval": "", "intervalFactor": 1, "legendFormat": "InSegs - Segments received, including those received in error. This count includes segments received on currently established connections", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_OutSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "OutSegs - Segments sent, including those on current connections but excluding those containing only retransmitted octets", "refId": "B", "step": 240 } ], "title": "TCP In / Out", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 63 }, "id": 104, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_ListenOverflows{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "ListenOverflows - Times the listen queue of a socket overflowed", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_ListenDrops{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "ListenDrops - SYNs to LISTEN sockets ignored", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_TCPSynRetrans{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "TCPSynRetrans - SYN-SYN/ACK retransmits to break down retransmissions in SYN, fast/timeout retransmits", "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_RetransSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "legendFormat": "RetransSegs - Segments retransmitted - that is, the number of TCP segments transmitted containing one or more previously transmitted octets", "refId": "D" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_InErrs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "legendFormat": "InErrs - Segments received in error (e.g., bad TCP checksums)", "refId": "E" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_OutRsts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "interval": "", "legendFormat": "OutRsts - Segments sent with RST flag", "refId": "F" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "irate(node_netstat_TcpExt_TCPRcvQDrop{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "legendFormat": "TCPRcvQDrop - Packets meant to be queued in rcv queue but dropped because socket rcvbuf limit hit", "range": true, "refId": "G" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "irate(node_netstat_TcpExt_TCPOFOQueue{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "hide": false, "interval": "", "legendFormat": "TCPOFOQueue - TCP layer receives an out of order packet and has enough memory to queue it", "range": true, "refId": "H" } ], "title": "TCP Errors", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "connections", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*MaxConn *./" }, "properties": [ { "id": "color", "value": { "fixedColor": "#890F02", "mode": "fixed" } }, { "id": "custom.fillOpacity", "value": 0 } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 73 }, "id": 85, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_netstat_Tcp_CurrEstab{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "CurrEstab - TCP connections for which the current state is either ESTABLISHED or CLOSE- WAIT", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_netstat_Tcp_MaxConn{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "MaxConn - Limit on the total number of TCP connections the entity can support (Dynamic is \"-1\")", "refId": "B", "step": 240 } ], "title": "TCP Connections", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter out (-) / in (+)", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*Sent.*/" }, "properties": [ { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 73 }, "id": 91, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_SyncookiesFailed{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "SyncookiesFailed - Invalid SYN cookies received", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_SyncookiesRecv{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "SyncookiesRecv - SYN cookies received", "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_TcpExt_SyncookiesSent{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "SyncookiesSent - SYN cookies sent", "refId": "C", "step": 240 } ], "title": "TCP SynCookie", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "connections", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 83 }, "id": 82, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_ActiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "ActiveOpens - TCP connections that have made a direct transition to the SYN-SENT state from the CLOSED state", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "irate(node_netstat_Tcp_PassiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "PassiveOpens - TCP connections that have made a direct transition to the SYN-RCVD state from the LISTEN state", "refId": "B", "step": 240 } ], "title": "TCP Direct Transition", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "Enable with --collector.tcpstat argument on node-exporter", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "connections", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 83 }, "id": 320, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "node_tcp_connection_states{state=\"established\",instance=\"$node\",job=\"$job\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "established - TCP sockets in established state", "range": true, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "node_tcp_connection_states{state=\"fin_wait2\",instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "fin_wait2 - TCP sockets in fin_wait2 state", "range": true, "refId": "B", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "node_tcp_connection_states{state=\"listen\",instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "listen - TCP sockets in listen state", "range": true, "refId": "C", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "editorMode": "code", "expr": "node_tcp_connection_states{state=\"time_wait\",instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "time_wait - TCP sockets in time_wait state", "range": true, "refId": "D", "step": 240 } ], "title": "TCP Stat", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Network Netstat", "type": "row" }, { "collapsed": true, "datasource": { "type": "prometheus", "uid": "000000001" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 33 }, "id": 279, "panels": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "seconds", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 10, "w": 12, "x": 0, "y": 66 }, "id": 40, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_scrape_collector_duration_seconds{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{collector}} - Scrape duration", "refId": "A", "step": 240 } ], "title": "Node Exporter Scrape Time", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "counter", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byRegexp", "options": "/.*error.*/" }, "properties": [ { "id": "color", "value": { "fixedColor": "#F2495C", "mode": "fixed" } }, { "id": "custom.transform", "value": "negative-Y" } ] } ] }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 66 }, "id": 157, "links": [], "options": { "legend": { "calcs": [ "mean", "lastNotNull", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.2.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_scrape_collector_success{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{collector}} - Scrape success", "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "node_textfile_scrape_error{instance=\"$node\",job=\"$job\"}", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{collector}} - Scrape textfile error (1 = true)", "refId": "B", "step": 240 } ], "title": "Node Exporter Scrape", "type": "timeseries" } ], "targets": [ { "datasource": { "type": "prometheus", "uid": "000000001" }, "refId": "A" } ], "title": "Node Exporter", "type": "row" } ], "refresh": "1m", "revision": 1, "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "prometheus", "value": "P1809F7CD0C75ACF3" }, "hide": 0, "includeAll": false, "label": "Datasource", "multi": false, "name": "datasource", "options": [], "query": "prometheus", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": { "selected": false, "text": "nyarlathotep-node", "value": "nyarlathotep-node" }, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "definition": "", "hide": 0, "includeAll": false, "label": "Job", "multi": false, "name": "job", "options": [], "query": { "query": "label_values(node_uname_info, job)", "refId": "Prometheus-job-Variable-Query" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "current": { "selected": false, "text": "localhost:9100", "value": "localhost:9100" }, "datasource": { "type": "prometheus", "uid": "${datasource}" }, "definition": "label_values(node_uname_info{job=\"$job\"}, instance)", "hide": 0, "includeAll": false, "label": "Host", "multi": false, "name": "node", "options": [], "query": { "query": "label_values(node_uname_info{job=\"$job\"}, instance)", "refId": "Prometheus-node-Variable-Query" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "current": { "selected": false, "text": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", "value": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+" }, "hide": 2, "includeAll": false, "multi": false, "name": "diskdevices", "options": [ { "selected": true, "text": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", "value": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+" } ], "query": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", "skipUrlSync": false, "type": "custom" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": [ "5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d" ] }, "timezone": "browser", "title": "Node Stats (Detailed)", "uid": "rYdddlPWk", "version": 1, "weekStart": "" } ================================================ FILE: shared/default.nix ================================================ # Common configuration enabled on all hosts. # # **Alerts:** # # - A zpool is in "degraded" status (alertmanager) { config, lib, pkgs, flakeInputs, ... }: with lib; let promcfg = config.services.prometheus; nodeExporter = promcfg.enable && config.services.prometheus.exporters.node.enable; thereAreZfsFilesystems = any id (mapAttrsToList (_: attrs: attrs.fsType == "zfs") config.fileSystems); firewallcfg = config.nixfiles.firewall; readBlocklistFromFile = '' cat ${firewallcfg.ipBlocklistFile} | sed 's/\s//g' | sed 's/#.*$//' | grep . | while read ip; do iptables -A barrucadu-ip-blocklist -s "$ip" -j DROP done ''; in { imports = [ ./options.nix # modules ./acme ./bookdb ./bookmarks ./erase-your-darlings ./finder ./forgejo ./foundryvtt ./host-templates ./minecraft ./oci-containers ./pleroma ./resolved ./restic-backups ./torrents ]; config = { ############################################################################# ## General ############################################################################# # The NixOS release to be compatible with for stateful data such as databases. system.stateVersion = "25.05"; # Only keep the last 500MiB of systemd journal. services.journald.extraConfig = "SystemMaxUse=500M"; # Collect nix store garbage and optimise daily. nix.gc.automatic = true; nix.gc.options = "--delete-older-than 30d"; nix.optimise.automatic = true; # Enable flakes nix.extraOptions = "experimental-features = nix-command flakes"; # Clear out /tmp after a fortnight and give all normal users a ~/tmp # cleaned out weekly. systemd.tmpfiles.rules = [ "d /tmp 1777 root root 14d" ] ++ ( let mkTmpDir = n: u: "d ${u.home}/tmp 0700 ${n} ${u.group} 7d"; in mapAttrsToList mkTmpDir (filterAttrs (_: u: u.isNormalUser) config.users.users) ); # Enable passwd and co. users.mutableUsers = true; # Upgrade packages and reboot if needed system.autoUpgrade.enable = true; system.autoUpgrade.allowReboot = true; system.autoUpgrade.flags = [ "--recreate-lock-file" ]; system.autoUpgrade.flake = "/etc/nixos"; system.autoUpgrade.dates = "06:45"; # Reboot on panic and oops # https://utcc.utoronto.ca/~cks/space/blog/linux/RebootOnPanicSettings boot.kernel.sysctl = { "kernel.panic" = 10; "kernel.panic_on_oops" = 1; }; ############################################################################# ## Locale ############################################################################# # Locale i18n.defaultLocale = "en_GB.UTF-8"; # Timezone services.timesyncd.enable = mkForce true; time.timeZone = "Europe/London"; # Keyboard console.keyMap = "uk"; services.xserver.xkb.layout = "gb"; ############################################################################# ## Firewall ############################################################################# networking.firewall.enable = true; networking.firewall.allowPing = true; networking.firewall.trustedInterfaces = if config.nixfiles.oci-containers.backend == "docker" then [ "docker0" ] else [ "podman" ]; services.fail2ban.enable = true; networking.firewall.extraCommands = '' iptables -N barrucadu-ip-blocklist ${if firewallcfg.ipBlocklistFile == null then "" else readBlocklistFromFile} iptables -A barrucadu-ip-blocklist -j RETURN iptables -A INPUT -j barrucadu-ip-blocklist ''; networking.firewall.extraStopCommands = '' if iptables -n --list barrucadu-ip-blocklist &>/dev/null; then iptables -D INPUT -j barrucadu-ip-blocklist iptables -F barrucadu-ip-blocklist iptables -X barrucadu-ip-blocklist fi ''; ############################################################################# ## ZFS ############################################################################# # Auto-trim is enabled per-pool: # run `sudo zpool set autotrim=on ` services.zfs.trim.enable = thereAreZfsFilesystems; services.zfs.trim.interval = "weekly"; # Auto-scrub applies to all pools, no need to set any pool # properties. services.zfs.autoScrub.enable = thereAreZfsFilesystems; services.zfs.autoScrub.interval = "monthly"; # Auto-snapshot is enabled per dataset: # run `sudo zfs set com.sun:auto-snapshot=true ` # # The default of 12 monthly snapshots takes up too much disk space # in practice. services.zfs.autoSnapshot.enable = thereAreZfsFilesystems; services.zfs.autoSnapshot.monthly = 3; # Actually panic when ZFS "panics" # https://utcc.utoronto.ca/~cks/space/blog/linux/ZFSPanicsNotKernelPanics boot.extraModprobeConfig = mkIf thereAreZfsFilesystems '' options spl spl_panic_halt=1 ''; ############################################################################# ## Services ############################################################################# # Every machine gets an sshd services.openssh = { enable = true; # Only pubkey auth settings.PasswordAuthentication = false; settings.KbdInteractiveAuthentication = false; authorizedKeysInHomedir = true; }; # Start ssh-agent as a systemd user service programs.ssh.startAgent = true; # Mosh programs.mosh = { enable = true; # make `who` work withUtempter = true; }; # Syncthing for shared folders (configured directly in the syncthing client) services.syncthing = { enable = true; user = "barrucadu"; openDefaultPorts = true; }; # Use podman for all the OCI container based services nixfiles.oci-containers.backend = "podman"; # If running a docker registry, also enable deletion and garbage collection. services.dockerRegistry.port = 46453; services.dockerRegistry.enableDelete = config.services.dockerRegistry.enable; services.dockerRegistry.enableGarbageCollect = config.services.dockerRegistry.enable; ############################################################################# ## Dashboards & Alerting ############################################################################# services.grafana = { enable = promcfg.enable; settings.server.http_port = 47652; settings."auth.anonymous".enabled = true; provision.enable = true; provision.datasources.settings.datasources = mkIf promcfg.enable [ { name = "prometheus"; url = "http://localhost:${toString promcfg.port}"; type = "prometheus"; } ]; provision.dashboards.settings.providers = let nodeExporterDashboard = { name = "Node Stats (Detailed)"; folder = "Common"; options.path = ./dashboards/node-stats-detailed.json; }; in (if nodeExporter then [ nodeExporterDashboard ] else [ ]); }; services.prometheus = { enable = true; listenAddress = "127.0.0.1"; port = 9090; globalConfig.scrape_interval = "15s"; scrapeConfigs = let nodeExporterScraper = { job_name = "${config.networking.hostName}-node"; static_configs = [{ targets = [ "localhost:${toString promcfg.exporters.node.port}" ]; }]; }; in (if nodeExporter then [ nodeExporterScraper ] else [ ]); alertmanagers = mkIf promcfg.alertmanager.enable [ { static_configs = [{ targets = [ "localhost:${toString promcfg.alertmanager.port}" ]; }]; } ]; }; services.prometheus.alertmanager = { enable = promcfg.enable; port = 9093; configuration = { route = { group_by = [ "alertname" ]; repeat_interval = "6h"; receiver = "aws-sns"; }; receivers = [ { name = "aws-sns"; sns_configs = [{ sigv4 = { region = "eu-west-1"; }; topic_arn = "arn:aws:sns:eu-west-1:197544591260:host-notifications"; subject = "Alert: ${config.networking.hostName}"; }]; } ]; }; }; services.prometheus.rules = [ '' groups: - name: disk rules: - alert: DiskSpaceLow expr: node_filesystem_avail_bytes{fstype!~"(ramfs|tmpfs)"} / node_filesystem_size_bytes < 0.1 - name: zfs rules: - alert: ZPoolStatusDegraded expr: node_zfs_zpool_state{state!="online"} > 0 '' ]; # Host metrics services.prometheus.exporters.node = { enable = promcfg.enable; enabledCollectors = [ "processes" "systemd" ]; }; # if a disk is mounted at /home, then the default value of # `"true"` reports incorrect filesystem metrics systemd.services.prometheus-node-exporter.serviceConfig.ProtectHome = mkForce "read-only"; ############################################################################# ## User accounts ############################################################################# programs.zsh.enable = true; users.users.barrucadu = { uid = 1000; description = "Michael Walker "; isNormalUser = true; extraGroups = [ config.nixfiles.oci-containers.backend "wheel" ]; group = "users"; initialPassword = "breadbread"; shell = pkgs.zsh; packages = with pkgs; [ atuin chezmoi haskellPackages.hledger ]; # Such pubkey! openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDGsbaoX0seFfMTXePyaQchxU3g58xFMUipZPvddCT8c azathoth-windows" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIWvwOx9opSKGomvq8C3u1SghmaGiv0yiMZUdql6nBDB barrucadu@nyarlathotep" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJVnNyKbBcHMY7Tcak07bL6svb/x8KXCL5WJRck9PaDI barrucadu@carcosa" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ5qZ+i88qWduVQHjnfm3KFdUnTOI0HBqBufGMfk/CkR yog-sothoth" ]; }; ############################################################################# ## Package management ############################################################################# # gnupg doesn't come with pinentry, so require the agent programs.gnupg.agent.enable = true; # Allow packages with non-free licenses. nixpkgs.config.allowUnfree = true; # System-wide packages environment.systemPackages = with pkgs; [ aspell aspellDicts.en bind (if config.nixfiles.oci-containers.backend == "docker" then docker-compose else podman-compose) emacs fd file fortune fzf git gnum4 gnupg gnupg1compat htop imagemagick iotop lsof lynx man-pages mtr ncdu psmisc python3 ripgrep rsync shellcheck smartmontools stow tmux unzip vim wget which whois ]; }; } ================================================ FILE: shared/erase-your-darlings/default.nix ================================================ # Wipe `/` on boot, inspired by ["erase your darlings"][]. # # This module is responsible for configuring standard NixOS options and # services, all of my modules have their own `erase-your-darlings.nix` file # which makes any changes that they need. # # This requires a setting up ZFS in a specific way when first installing NixOS. # See the ["set up a new host"][] runbook. # # ["erase your darlings"]: https://grahamc.com/blog/erase-your-darlings/ # ["set up a new host"]: ./runbooks/set-up-a-new-host.md { config, lib, ... }: with lib; let cfg = config.nixfiles.eraseYourDarlings; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { # Wipe / on boot boot.initrd.postResumeCommands = mkAfter '' zfs rollback -r ${cfg.rootSnapshot} ''; # Set /etc/machine-id, so that journalctl can access logs from # previous boots. environment.etc.machine-id = { text = "${cfg.machineId}\n"; mode = "0444"; }; # Switch back to immutable users users.mutableUsers = mkForce false; users.users.barrucadu.initialPassword = mkForce null; users.users.barrucadu.hashedPasswordFile = cfg.barrucaduPasswordFile; # Persist state in `cfg.persistDir` services.openssh.hostKeys = [ { path = "${toString cfg.persistDir}/etc/ssh/ssh_host_ed25519_key"; type = "ed25519"; } { path = "${toString cfg.persistDir}/etc/ssh/ssh_host_rsa_key"; type = "rsa"; bits = 4096; } ]; services.samba.settings.global = { "log file" = "/var/log/samba/%m.log"; "private dir" = "${toString cfg.persistDir}/var/lib/samba/private"; }; systemd.tmpfiles.rules = [ "L+ /etc/nixos - - - - ${toString cfg.persistDir}/etc/nixos" ]; systemd.services.prometheus.serviceConfig.BindPaths = "${toString cfg.persistDir}/var/lib/${config.services.prometheus.stateDir}:/var/lib/${config.services.prometheus.stateDir}"; # Needs real path, not a symlink system.autoUpgrade.flake = mkForce "${cfg.persistDir}/etc/nixos"; services.caddy.dataDir = "${toString cfg.persistDir}/var/lib/caddy"; services.dockerRegistry.storagePath = "${toString cfg.persistDir}/var/lib/docker-registry"; services.syncthing.dataDir = "${toString cfg.persistDir}/var/lib/syncthing"; }; } ================================================ FILE: shared/erase-your-darlings/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.eraseYourDarlings = { enable = mkOption { type = types.bool; default = false; description = '' Enable wiping `/` on boot and storing persistent data in `''${persistDir}`. ''; }; barrucaduPasswordFile = mkOption { type = types.str; description = '' File containing the hashed password for `barrucadu`. If using [sops-nix](https://github.com/Mic92/sops-nix) set the `neededForUsers` option on the secret. ''; }; rootSnapshot = mkOption { type = types.str; default = "local/volatile/root@blank"; description = '' ZFS snapshot to roll back to on boot. ''; }; persistDir = mkOption { type = types.path; default = "/persist"; description = '' Persistent directory which will not be erased. This must be on a different ZFS dataset that will not be wiped when rolling back to the `rootSnapshot`. This module moves various files from `/` to here. ''; }; machineId = mkOption { type = types.str; example = "64b1b10f3bef4616a7faf5edf1ef3ca5"; description = '' An arbitrary 32-character hexadecimal string, used to identify the host. This is needed for journalctl logs from previous boots to be accessible. See [the systemd documentation](https://www.freedesktop.org/software/systemd/man/machine-id.html). ''; }; }; } ================================================ FILE: shared/finder/default.nix ================================================ # finder is a webapp to read downloaded manga. There is no public deployment. # # finder uses a containerised elasticsearch database, and requires read access # to the filesystem where manga is stored. It does not manage the manga, only # provides an interface to search and read. # # The database can be recreated from the manga files, so this module does not # include a backup script. { config, lib, ... }: with lib; let cfg = config.nixfiles.finder; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { nixfiles.oci-containers.pods.finder = { containers = { web = { image = cfg.image; environment = { "DATA_DIR" = "/data"; "ES_HOST" = "http://finder-db:9200"; }; dependsOn = [ "finder-db" ]; ports = [{ host = cfg.port; inner = 8888; }]; volumes = [{ host = cfg.mangaDir; inner = "/data"; }]; }; db = { image = "mirror.gcr.io/elasticsearch:${cfg.elasticsearchTag}"; environment = { "http.host" = "0.0.0.0"; "discovery.type" = "single-node"; "xpack.security.enabled" = "false"; "ES_JAVA_OPTS" = "-Xms512M -Xmx512M"; }; volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }]; }; }; }; }; } ================================================ FILE: shared/finder/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.finder = { enable = mkOption { type = types.bool; default = false; description = '' Enable the finder service. ''; }; image = mkOption { type = types.str; description = '' Container image to run. ''; }; port = mkOption { type = types.int; default = 44986; description = '' Port (on 127.0.0.1) to expose finder on. ''; }; elasticsearchTag = mkOption { type = types.str; default = "9.0.1"; description = '' Tag to use of the `elasticsearch` container image. ''; }; mangaDir = mkOption { type = types.path; example = "/mnt/nas/manga"; description = '' Directory to serve manga files from. ''; }; }; } ================================================ FILE: shared/forgejo/default.nix ================================================ # [Forgejo][] is git forge (I'll never like that term). This module sets up an # instance with user registration disabled and an admin user set up. The admin # user password path must be readable by the forgejo user. # # After initialising the instance log into the admin account and: # # 1. Set up non-admin users for normal usage. # 2. Generate a token for the runner, and update this configuration. # # Forgejo uses a containerised postgres database. # # **Backups:** the postgres database and state files (as a forgejo dump). # # [Forgejo]: https://forgejo.org/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.forgejo; dbSocketDir = "/run/forgejo-db"; forgejoUser = config.services.forgejo.user; forgejoGroup = config.services.forgejo.group; in { imports = [ ./erase-your-darlings.nix ./options.nix ]; config = mkIf cfg.enable { services.forgejo = { enable = true; package = pkgs.forgejo; database = { createDatabase = false; socket = dbSocketDir; type = "postgres"; }; dump = { enable = true; type = "tar.xz"; }; settings = { actions = { ENABLED = true; }; server = { DOMAIN = cfg.domain; ROOT_URL = "https://${cfg.domain}/"; HTTP_PORT = cfg.port; SSH_PORT = lib.head config.services.openssh.ports; }; service = { DISABLE_REGISTRATION = true; REQUIRE_SIGNIN_VIEW = true; ENABLE_BASIC_AUTHENTICATION = false; ENABLE_TIMETRACKING = false; DEFAULT_USER_VISIBILITY = "limited"; DEFAULT_ORG_VISIBILITY = "limited"; }; mailer = { ENABLED = false; }; }; }; systemd.services.forgejo = { after = [ "${config.nixfiles.oci-containers.backend}-pleroma-db.service" ]; requires = [ "${config.nixfiles.oci-containers.backend}-pleroma-db.service" ]; preStart = let cmd = "${lib.getExe config.services.forgejo.package} admin user"; in '' ${cmd} create --admin --email "root@localhost" --username ${cfg.adminUserName} --password "$(tr -d '\n' < ${cfg.adminUserPasswordPath})" || true ${cmd} change-password --username ${cfg.adminUserName} --password "$(tr -d '\n' < ${cfg.adminUserPasswordPath})" || true ''; }; services.gitea-actions-runner = { package = pkgs.forgejo-runner; instances.default = mkIf (cfg.runnerTokenPath != null) { enable = true; name = "default"; url = config.services.forgejo.settings.server.ROOT_URL; tokenFile = cfg.runnerTokenPath; labels = [ "nix:docker://mirror.gcr.io/nixos/nix:2.33.5" ]; }; }; users.users."${forgejoUser}".uid = 980; users.groups."${forgejoGroup}".gid = 980; nixfiles.oci-containers.pods.forgejo.containers.db = { image = "mirror.gcr.io/postgres:${cfg.postgresTag}"; environment = { "POSTGRES_DB" = "forgejo"; "POSTGRES_USER" = "forgejo"; "POSTGRES_PASSWORD" = "forgejo"; }; volumes = [ { name = "pgdata"; inner = "/var/lib/postgresql"; } { host = dbSocketDir; inner = "/var/run/postgresql"; } ]; }; systemd.tmpfiles.rules = [ "d ${dbSocketDir} 0700 ${forgejoUser} ${forgejoGroup}" ]; nixfiles.restic-backups.backups.forgejo = { paths = [ config.services.forgejo.dump.backupDir ]; }; }; } ================================================ FILE: shared/forgejo/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.forgejo; eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf (cfg.enable && eyd.enable) { services.forgejo.stateDir = "${toString eyd.persistDir}/var/lib/forgejo"; }; } ================================================ FILE: shared/forgejo/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.forgejo = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [Forgejo](https://forgejo.org/. ''; }; port = mkOption { type = types.int; default = 46484; description = '' Port (on 127.0.0.1) to expose Forgejo on. ''; }; postgresTag = mkOption { type = types.str; default = "18"; description = '' Tag to use of the `postgres` container image. ''; }; domain = mkOption { type = types.str; example = "git.barrucadu.dev"; description = '' Domain which Forgejo will be exposed on. ''; }; runnerTokenPath = mkOption { type = types.nullOr types.path; default = null; description = '' File in the format 'TOKEN=...' with the runner token. If not specified, the runner is not enabled. ''; }; adminUserName = mkOption { type = types.str; default = "root"; description = '' Name of the admin user (note: cannot be 'admin' as forgejo prevents creation of a user called 'admin'). ''; }; adminUserPasswordPath = mkOption { type = types.path; description = '' Path to a file containing the admin user password. ''; }; }; } ================================================ FILE: shared/foundryvtt/default.nix ================================================ # [FoundryVTT][] is a virtual tabletop to run roleplaying games. It is licensed # software and needs to be downloaded after purchase. This module doesn't # manage the FoundryVTT program files, only operating it. # # The downloaded FoundryVTT program files must be in `''${dataDir}/bin`. # # **Backups:** the data files - this requires briefly stopping the service, so # don't schedule backups during game time. # # **Erase your darlings:** overrides the `dataDir`. # # [FoundryVTT]: https://foundryvtt.com/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.foundryvtt; in { imports = [ ./erase-your-darlings.nix ./options.nix ]; config = mkIf cfg.enable { systemd.services.foundryvtt = { enable = true; description = "Foundry Virtual Tabletop"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; serviceConfig = { ExecStart = "${pkgs.nodejs_24}/bin/node resources/app/main.js --dataPath=${cfg.dataDir}/data --port=${toString cfg.port}"; Restart = "always"; User = "foundryvtt"; WorkingDirectory = "${cfg.dataDir}/bin"; }; }; users.users.foundryvtt = { uid = 994; description = "Foundry VTT service user"; home = cfg.dataDir; createHome = true; isSystemUser = true; group = "nogroup"; }; nixfiles.restic-backups.backups.foundryvtt = { prepareCommand = '' /run/wrappers/bin/sudo ${pkgs.systemd}/bin/systemctl stop foundryvtt ''; cleanupCommand = '' /run/wrappers/bin/sudo ${pkgs.systemd}/bin/systemctl start foundryvtt ''; paths = [ cfg.dataDir ]; }; nixfiles.restic-backups.sudoRules = [ { command = "${pkgs.systemd}/bin/systemctl stop foundryvtt"; } { command = "${pkgs.systemd}/bin/systemctl start foundryvtt"; } ]; }; } ================================================ FILE: shared/foundryvtt/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.foundryvtt; eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf (cfg.enable && eyd.enable) { nixfiles.foundryvtt.dataDir = "${toString eyd.persistDir}/var/lib/foundryvtt"; }; } ================================================ FILE: shared/foundryvtt/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.foundryvtt = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [FoundryVTT](https://foundryvtt.com/) service. ''; }; port = mkOption { type = types.int; default = 46885; description = '' Port (on 127.0.0.1) to expose FoundryVTT on. ''; }; dataDir = mkOption { type = types.str; default = "/var/lib/foundryvtt"; description = '' Directory to store data files in. The downloaded FoundryVTT program files must be in `''${dataDir}/bin`. If the `erase-your-darlings` module is enabled, this is overridden to be on the persistent volume. ''; }; }; } ================================================ FILE: shared/host-templates/default.nix ================================================ # Template configuration for a variety of functionality. # # See [the documentation for each template][]. # # [the documentation for each template]: host-templates.html { ... }: { imports = [ ./website-mirror ]; } ================================================ FILE: shared/host-templates/website-mirror/default.nix ================================================ # Configures a webserver for the following domains: # # - {www,bookdb,bookmarks,memos,weeknotes,}barrucadu.co.uk # - {www,}barrucadu.com # - {www,}barrucadu.dev # - {www,}barrucadu.uk # # Access is configured for push-based updates: # # - Remote sync (defaulting to the nyarlathotep SSH key) for bookdb and bookmarks # - SSH and file ownership (defaulting to the concourse SSH key) for static websites # # Push needs to be configured in the appropriate places. { config, lib, pkgs, ... }: with lib; let baseDir = if config.nixfiles.eraseYourDarlings.enable then toString config.nixfiles.eraseYourDarlings.persistDir else ""; httpDir = "${baseDir}/srv/http"; certDir = "${baseDir}/var/lib/acme"; caddyTlsConfig = certDomain: '' tls ${certDir}/${certDomain}/cert.pem ${certDir}/${certDomain}/key.pem { protocols tls1.3 } ''; caddyConfig = '' encode gzip header Permissions-Policy "interest-cohort=()" header Referrer-Policy "strict-origin-when-cross-origin" header Strict-Transport-Security "max-age=31536000; includeSubDomains" header X-Content-Type-Options "nosniff" header X-Frame-Options "SAMEORIGIN" header -Server ''; mdBook = path: '' root * ${httpDir}/${path} file_server handle_errors { @404 { expression {http.error.status_code} == 404 } rewrite @404 /404.html file_server } ''; cfg = config.nixfiles.hostTemplates.websiteMirror; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { ############################################################################### ## Certificates ############################################################################### # Provision certificates via DNS challenge nixfiles.acme = { enable = true; environmentFile = cfg.acmeEnvironmentFile; domains."barrucadu.co.uk" = { extraDomainNames = [ "*.barrucadu.co.uk" ]; }; domains."barrucadu.com" = { extraDomainNames = [ "*.barrucadu.com" ]; }; domains."barrucadu.dev" = { extraDomainNames = [ "*.barrucadu.dev" "*.docs.barrucadu.dev" ]; }; domains."barrucadu.uk" = { extraDomainNames = [ "*.barrucadu.uk" ]; }; }; ############################################################################### ## Websites ############################################################################### services.caddy.enable = true; services.caddy.virtualHosts = let vhosts = { "barrucadu.co.uk" = { "" = '' redir https://www.barrucadu.co.uk{uri} ''; "bookdb" = '' reverse_proxy http://127.0.0.1:${toString config.nixfiles.bookdb.port} ''; "bookmarks" = '' reverse_proxy http://127.0.0.1:${toString config.nixfiles.bookmarks.port} ''; "memo" = '' header /fonts/* Cache-Control "public, immutable, max-age=31536000" header /mathjax/* Cache-Control "public, immutable, max-age=7776000" header /*.css Cache-Control "public, immutable, max-age=31536000" root * ${httpDir}/barrucadu.co.uk/memo file_server handle_errors { @410 { expression {http.error.status_code} == 410 } rewrite @410 /410.html file_server } ${fileContents ./resources/memo-barrucadu-co-uk.caddyfile} ''; "weeknotes" = '' header /fonts/* Cache-Control "public, immutable, max-age=31536000" header /*.css Cache-Control "public, immutable, max-age=31536000" file_server { root ${httpDir}/barrucadu.co.uk/weeknotes } ''; "www" = '' header /fonts/* Cache-Control "public, immutable, max-age=31536000" header /*.css Cache-Control "public, immutable, max-age=31536000" root * ${httpDir}/barrucadu.co.uk/www file_server handle_errors { @404 { expression {http.error.status_code} == 404 } @410 { expression {http.error.status_code} == 410 } rewrite @404 /404.html rewrite @410 /410.html file_server } ${fileContents ./resources/www-barrucadu-co-uk.caddyfile} ''; }; "barrucadu.com" = { "" = '' redir https://www.barrucadu.co.uk ''; "www" = '' redir https://www.barrucadu.co.uk ''; }; "barrucadu.uk" = { "" = '' redir https://www.barrucadu.co.uk ''; "www" = '' redir https://www.barrucadu.co.uk ''; }; "barrucadu.dev" = { "" = '' redir https://www.barrucadu.co.uk ''; "www" = '' redir https://www.barrucadu.co.uk ''; "dejafu.docs" = mdBook "barrucadu.dev/docs/dejafu"; "nixfiles.docs" = mdBook "barrucadu.dev/docs/nixfiles"; "resolved.docs" = mdBook "barrucadu.dev/docs/resolved"; }; }; mkVirtualHost = withTlsConfig: domain: subdomain: extraConfig: nameValuePair (if subdomain == "" then domain else "${subdomain}.${domain}") { extraConfig = '' ${caddyConfig} ${optionalString withTlsConfig (caddyTlsConfig domain)} ${extraConfig} ''; }; mkVirtualHosts = domain: subdomains: mapAttrs' (mkVirtualHost true domain) subdomains; mkPrefixedVirtualHosts = domain: subdomains: mapAttrs' (mkVirtualHost false "${config.networking.hostName}.${domain}") (filterAttrs (n: _: n != "") subdomains); in mkMerge [ (concatMapAttrs mkVirtualHosts vhosts) (concatMapAttrs mkPrefixedVirtualHosts vhosts) ]; ############################################################################### ## Services ############################################################################### nixfiles.bookdb.enable = true; nixfiles.bookdb.readOnly = true; nixfiles.bookmarks.enable = true; nixfiles.bookmarks.readOnly = true; nixfiles.bookdb.remoteSync.receive.enable = config.nixfiles.bookdb.enable; nixfiles.bookdb.remoteSync.receive.authorizedKeys = cfg.bookdbRemoteSyncAuthorizedKeys; nixfiles.bookmarks.remoteSync.receive.enable = config.nixfiles.bookmarks.enable; nixfiles.bookmarks.remoteSync.receive.authorizedKeys = cfg.bookmarksRemoteSyncAuthorizedKeys; ############################################################################### ## Miscellaneous ############################################################################### # Firewall networking.firewall.allowedTCPPorts = [ 80 443 ]; # Concourse access users.users.concourse-deploy-robot = { uid = 997; home = "/var/lib/concourse-deploy-robot"; createHome = true; isSystemUser = true; openssh.authorizedKeys.keys = cfg.concourseDeployRobotAuthorizedKeys; shell = pkgs.bashInteractive; group = "nogroup"; }; # Create needed directories if they don't already exist systemd.tmpfiles.rules = [ # acme & caddy services "d ${certDir} - root root -" "d ${baseDir}/var/lib/caddy 700 caddy caddy -" # static websites (for rsync - seems to want to traverse from /) "d ${baseDir}/srv - root root -" "d ${httpDir} - root root -" "d ${httpDir}/barrucadu.co.uk - root root -" "d ${httpDir}/barrucadu.co.uk/memo - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.co.uk/weeknotes - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.co.uk/www - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.dev - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.dev/docs - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.dev/docs/dejafu - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.dev/docs/nixfiles - concourse-deploy-robot nogroup -" "d ${httpDir}/barrucadu.dev/docs/resolved - concourse-deploy-robot nogroup -" # docker volumes "d ${config.nixfiles.oci-containers.volumeBaseDir}/bookdb/esdata - 1000 100 -" "d ${config.nixfiles.oci-containers.volumeBaseDir}/bookmarks/esdata - 1000 100 -" ]; }; } ================================================ FILE: shared/host-templates/website-mirror/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.hostTemplates.websiteMirror = { enable = mkOption { type = types.bool; default = false; description = '' Enable the website-mirror template. ''; }; acmeEnvironmentFile = mkOption { type = types.path; description = '' Environment file with AWS Route53 credentials for the ACME DNS-01 challenge. ''; }; concourseDeployRobotAuthorizedKeys = mkOption { type = types.listOf types.str; default = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFilTWek5xNpl82V48oQ99briJhn9BqwCACeRq1dQnZn concourse-worker@cd.barrucadu.dev" ]; description = '' SSH public keys to allow Concourse deployments from. ''; }; bookdbRemoteSyncAuthorizedKeys = mkOption { type = types.listOf types.str; default = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIChVw9DPLafA3lCLCI4Df9rYuxedFQTXAwDOOHUfZ0Ac remote-sync@nyarlathotep" ]; description = '' SSH public keys to allow bookdb remots sync from. ''; }; bookmarksRemoteSyncAuthorizedKeys = mkOption { type = types.listOf types.str; default = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIChVw9DPLafA3lCLCI4Df9rYuxedFQTXAwDOOHUfZ0Ac remote-sync@nyarlathotep" ]; description = '' SSH public keys to allow bookdb remots sync from. ''; }; }; } ================================================ FILE: shared/host-templates/website-mirror/resources/memo-barrucadu-co-uk.caddyfile ================================================ # SUPERSEDED redir /2018-budget.html /personal-finance.html permanent redir /concourseci-nixos.html /ci-cd.html permanent redir /hledger.html /personal-finance.html permanent redir /taxon/general-games.html /taxon/games.html permanent redir /taxon/general-games.xml /taxon/games.xml permanent redir /taxon/self-koans.html /taxon/general.html permanent error /concourseci-on-nixos/barrucadu.co.uk-pipeline.png 410 error /concourseci-on-nixos/dashboard.png 410 error /taxon/self-koans.xml 410 ## By non-memos redir /backups.html https://github.com/barrucadu/nixfiles permanent redir /call-of-cthulhu-dice-rolls.html https://www.lookwhattheshoggothdraggedin.com/post/dice-rolls-in-call-of-cthulhu.html permanent redir /how-to-make-a-dejafu-release.html https://dejafu.readthedocs.io/en/latest/release_process.html permanent redir /how-to-set-up-a-new-machine.html https://github.com/barrucadu/nixfiles permanent redir /how-to-set-up-the-user-environment.html https://github.com/barrucadu/nixfiles permanent redir /machines.html https://github.com/barrucadu/nixfiles permanent redir /monitoring.html https://github.com/barrucadu/nixfiles permanent redir /sms-email-alerting.html https://github.com/barrucadu/nixfiles permanent error /sms-email-alerting.png 410 # ------------------------------------------------------------------------------- # GONE error /a-new-kind-of-imageboard.html 410 error /academic-mindset.html 410 error /blub-crisis.html 410 error /career-levels.html 410 error /contraptions-components-cables.html 410 error /game-systems.html 410 error /games-i-would-like-to-run.html 410 error /granfalloons.html 410 error /haskell-style-guide.html 410 error /how-to-add-new-emoji-to-pleroma.html 410 error /how-to-fix-lainradio.html 410 error /how-to-update-pihole.html 410 error /imageboards.html 410 error /incident-20210901-nyarlathotep-zpool-degraded.html 410 error /incident-report-template.html 410 error /m4-is-good.html 410 error /magic-mechanics.html 410 error /memo-organisation.html 410 error /memos-vs-blog-posts.html 410 error /one-shot-ideas.html 410 error /read-me-first.html 410 error /running-a-yusu-society.html 410 error /sed-as-a-service.html 410 error /slog17.html 410 error /symlinks-are-bad.html 410 error /taxon/techdocs-practices.html 410 error /taxon/techdocs-practices.xml 410 error /tea.html 410 error /texttt-vs-verb.html 410 error /the-way.html 410 error /time-tracking.html 410 error /incident-20210901-nyarlathoteop-zpool-degraded/prometheus-state-change.png 410 error /incident-20210901-nyarlathoteop-zpool-degraded/uptime.png 410 error /running-a-yusu-society/societea-journal.txt 410 error /running-a-yusu-society/societea-report.txt 410 ## Moved to personal notes error /book-wishlist.html 410 error /cd-wishlist.html 410 error /kitchen-staples.html 410 error /recipe-bolognese.html 410 error /recipe-bread.html 410 error /recipe-chilli-slow-cooker.html 410 error /recipe-chilli.html 410 error /recipe-cottage-pie.html 410 error /recipe-flapjacks.html 410 error /recipe-pasta-bake.html 410 error /taxon/self-recipes.html 410 error /taxon/self-recipes.xml 410 error /campaign-notes-2018-09-masks-of-nyarlathotep.html 410 error /campaign-notes-2020-02-apocalypse-world.html 410 error /campaign-notes-2020-04-golden-sky-stories.html 410 error /campaign-notes-2020-05-call-of-cthulhu.html 410 error /campaign-notes-2021-10-traveller.html 410 error /campaign-notes-2021-11-ars-magica.html 410 error /campaign-notes-2022-06-cartographic-curiosities.html 410 error /campaign-notes-2022-08-goadventuring.html 410 error /campaign-notes-2022-09-wicked-ones.html 410 error /campaign-notes-2022-11-sylea-rising.html 410 error /taxon/games-campaigns.html 410 error /taxon/games-campaigns.xml 410 error /campaign-notes-2020-05-call-of-cthulhu/ap-telegram.jpg 410 error /campaign-notes-2020-05-call-of-cthulhu/central-america.png 410 error /campaign-notes-2020-05-call-of-cthulhu/city-of-the-great-race.jpg 410 error /campaign-notes-2020-05-call-of-cthulhu/city-of-the-great-race.xcf 410 error /campaign-notes-2020-05-call-of-cthulhu/quebec.png 410 error /campaign-notes-2020-05-call-of-cthulhu/rachels-notes-eye-of-light-and-darkness.png 410 error /campaign-notes-2020-05-call-of-cthulhu/rachels-notes-eye-of-light-and-darkness.xcf 410 error /campaign-notes-2020-05-call-of-cthulhu/san-jose-herald.png 410 error /campaign-notes-2020-05-call-of-cthulhu/the-aftermath.png 410 error /campaign-notes-2021-10-traveller/astraea-filipovna.png 410 error /campaign-notes-2021-10-traveller/far-trader.png 410 error /campaign-notes-2021-10-traveller/harrier.png 410 error /campaign-notes-2021-10-traveller/htoua.jpg 410 error /campaign-notes-2021-10-traveller/ilijah-veryn.png 410 error /campaign-notes-2021-10-traveller/lynette-hershey.png 410 error /campaign-notes-2021-10-traveller/metadata.xml 410 error /campaign-notes-2021-10-traveller/orcan-march.png 410 error /campaign-notes-2021-10-traveller/poster.png 410 error /campaign-notes-2021-10-traveller/scout-courier.png 410 error /campaign-notes-2021-10-traveller/sector-data.txt 410 error /campaign-notes-2021-10-traveller/xavier-echithilei.png 410 error /campaign-notes-2022-06-cartographic-curiosities/.gitignore 410 error /campaign-notes-2022-06-cartographic-curiosities/1406-the-golden-wood.pdf 410 error /campaign-notes-2022-06-cartographic-curiosities/1406-the-golden-wood.tex 410 error /campaign-notes-2022-06-cartographic-curiosities/hexmap.png 410 error /campaign-notes-2022-06-cartographic-curiosities/hexmap.xcf 410 error /campaign-notes-2022-11-sylea-rising/bulletins/01.html 410 error /campaign-notes-2022-11-sylea-rising/bulletins/02.html 410 error /campaign-notes-2022-11-sylea-rising/bulletins/sfss-bulletin.css 410 error /campaign-notes-2022-11-sylea-rising/bulletins/sfss-logo.svg 410 error /campaign-notes-2022-11-sylea-rising/bulletins/template.html 410 error /campaign-notes-2022-11-sylea-rising/generate-worlds-html.py 410 error /campaign-notes-2022-11-sylea-rising/lishun-metadata--players.xml 410 error /campaign-notes-2022-11-sylea-rising/lishun-metadata.xml 410 error /campaign-notes-2022-11-sylea-rising/lishun-poster--players.png 410 error /campaign-notes-2022-11-sylea-rising/lishun-poster.png 410 error /campaign-notes-2022-11-sylea-rising/lishun-sector-data--players.txt 410 error /campaign-notes-2022-11-sylea-rising/lishun-sector-data.txt 410 error /campaign-notes-2022-11-sylea-rising/tweak-uwps.py 410 # ------------------------------------------------------------------------------- # WEEKNOTES redir /taxon/weeknotes.html https://weeknotes.barrucadu.co.uk permanent redir /taxon/weeknotes.xml https://weeknotes.barrucadu.co.uk/atom.xml permanent redir /taxon/weeknotes-2022.html https://weeknotes.barrucadu.co.uk permanent redir /taxon/weeknotes-2021.html https://weeknotes.barrucadu.co.uk permanent redir /taxon/weeknotes-2020.html https://weeknotes.barrucadu.co.uk permanent redir /taxon/weeknotes-2019.html https://weeknotes.barrucadu.co.uk permanent redir /taxon/weeknotes-2018.html https://weeknotes.barrucadu.co.uk permanent error /taxon/weeknotes-2022.xml 410 error /taxon/weeknotes-2021.xml 410 error /taxon/weeknotes-2020.xml 410 error /taxon/weeknotes-2019.xml 410 error /taxon/weeknotes-2018.xml 410 error /weeknotes-template.html 410 redir /weeknotes-001.html https://weeknotes.barrucadu.co.uk/notes/001.html permanent redir /weeknotes-002.html https://weeknotes.barrucadu.co.uk/notes/002.html permanent redir /weeknotes-003.html https://weeknotes.barrucadu.co.uk/notes/003.html permanent redir /weeknotes-004.html https://weeknotes.barrucadu.co.uk/notes/004.html permanent redir /weeknotes-005.html https://weeknotes.barrucadu.co.uk/notes/005.html permanent redir /weeknotes-006.html https://weeknotes.barrucadu.co.uk/notes/006.html permanent redir /weeknotes-007.html https://weeknotes.barrucadu.co.uk/notes/007.html permanent redir /weeknotes-008.html https://weeknotes.barrucadu.co.uk/notes/008.html permanent redir /weeknotes-009.html https://weeknotes.barrucadu.co.uk/notes/009.html permanent redir /weeknotes-010.html https://weeknotes.barrucadu.co.uk/notes/010.html permanent redir /weeknotes-011.html https://weeknotes.barrucadu.co.uk/notes/011.html permanent redir /weeknotes-012.html https://weeknotes.barrucadu.co.uk/notes/012.html permanent redir /weeknotes-013.html https://weeknotes.barrucadu.co.uk/notes/013.html permanent redir /weeknotes-014.html https://weeknotes.barrucadu.co.uk/notes/014.html permanent redir /weeknotes-015.html https://weeknotes.barrucadu.co.uk/notes/015.html permanent redir /weeknotes-016.html https://weeknotes.barrucadu.co.uk/notes/016.html permanent redir /weeknotes-017.html https://weeknotes.barrucadu.co.uk/notes/017.html permanent redir /weeknotes-018.html https://weeknotes.barrucadu.co.uk/notes/018.html permanent redir /weeknotes-019.html https://weeknotes.barrucadu.co.uk/notes/019.html permanent redir /weeknotes-020.html https://weeknotes.barrucadu.co.uk/notes/020.html permanent redir /weeknotes-021.html https://weeknotes.barrucadu.co.uk/notes/021.html permanent redir /weeknotes-022.html https://weeknotes.barrucadu.co.uk/notes/022.html permanent redir /weeknotes-023.html https://weeknotes.barrucadu.co.uk/notes/023.html permanent redir /weeknotes-024.html https://weeknotes.barrucadu.co.uk/notes/024.html permanent redir /weeknotes-025.html https://weeknotes.barrucadu.co.uk/notes/025.html permanent redir /weeknotes-026.html https://weeknotes.barrucadu.co.uk/notes/026.html permanent redir /weeknotes-027.html https://weeknotes.barrucadu.co.uk/notes/027.html permanent redir /weeknotes-028.html https://weeknotes.barrucadu.co.uk/notes/028.html permanent redir /weeknotes-029.html https://weeknotes.barrucadu.co.uk/notes/029.html permanent redir /weeknotes-030.html https://weeknotes.barrucadu.co.uk/notes/030.html permanent redir /weeknotes-031.html https://weeknotes.barrucadu.co.uk/notes/031.html permanent redir /weeknotes-032.html https://weeknotes.barrucadu.co.uk/notes/032.html permanent redir /weeknotes-033.html https://weeknotes.barrucadu.co.uk/notes/033.html permanent redir /weeknotes-034.html https://weeknotes.barrucadu.co.uk/notes/034.html permanent redir /weeknotes-035.html https://weeknotes.barrucadu.co.uk/notes/035.html permanent redir /weeknotes-036.html https://weeknotes.barrucadu.co.uk/notes/036.html permanent redir /weeknotes-037.html https://weeknotes.barrucadu.co.uk/notes/037.html permanent redir /weeknotes-038.html https://weeknotes.barrucadu.co.uk/notes/038.html permanent redir /weeknotes-039.html https://weeknotes.barrucadu.co.uk/notes/039.html permanent redir /weeknotes-040.html https://weeknotes.barrucadu.co.uk/notes/040.html permanent redir /weeknotes-041.html https://weeknotes.barrucadu.co.uk/notes/041.html permanent redir /weeknotes-042.html https://weeknotes.barrucadu.co.uk/notes/042.html permanent redir /weeknotes-043.html https://weeknotes.barrucadu.co.uk/notes/043.html permanent redir /weeknotes-044.html https://weeknotes.barrucadu.co.uk/notes/044.html permanent redir /weeknotes-045.html https://weeknotes.barrucadu.co.uk/notes/045.html permanent redir /weeknotes-046.html https://weeknotes.barrucadu.co.uk/notes/046.html permanent redir /weeknotes-047.html https://weeknotes.barrucadu.co.uk/notes/047.html permanent redir /weeknotes-048.html https://weeknotes.barrucadu.co.uk/notes/048.html permanent redir /weeknotes-049.html https://weeknotes.barrucadu.co.uk/notes/049.html permanent redir /weeknotes-050.html https://weeknotes.barrucadu.co.uk/notes/050.html permanent redir /weeknotes-051.html https://weeknotes.barrucadu.co.uk/notes/051.html permanent redir /weeknotes-052.html https://weeknotes.barrucadu.co.uk/notes/052.html permanent redir /weeknotes-053.html https://weeknotes.barrucadu.co.uk/notes/053.html permanent redir /weeknotes-054.html https://weeknotes.barrucadu.co.uk/notes/054.html permanent redir /weeknotes-055.html https://weeknotes.barrucadu.co.uk/notes/055.html permanent redir /weeknotes-056.html https://weeknotes.barrucadu.co.uk/notes/056.html permanent redir /weeknotes-057.html https://weeknotes.barrucadu.co.uk/notes/057.html permanent redir /weeknotes-058.html https://weeknotes.barrucadu.co.uk/notes/058.html permanent redir /weeknotes-059.html https://weeknotes.barrucadu.co.uk/notes/059.html permanent redir /weeknotes-060.html https://weeknotes.barrucadu.co.uk/notes/060.html permanent redir /weeknotes-061.html https://weeknotes.barrucadu.co.uk/notes/061.html permanent redir /weeknotes-062.html https://weeknotes.barrucadu.co.uk/notes/062.html permanent redir /weeknotes-063.html https://weeknotes.barrucadu.co.uk/notes/063.html permanent redir /weeknotes-064.html https://weeknotes.barrucadu.co.uk/notes/064.html permanent redir /weeknotes-065.html https://weeknotes.barrucadu.co.uk/notes/065.html permanent redir /weeknotes-066.html https://weeknotes.barrucadu.co.uk/notes/066.html permanent redir /weeknotes-067.html https://weeknotes.barrucadu.co.uk/notes/067.html permanent redir /weeknotes-068.html https://weeknotes.barrucadu.co.uk/notes/068.html permanent redir /weeknotes-069.html https://weeknotes.barrucadu.co.uk/notes/069.html permanent redir /weeknotes-070.html https://weeknotes.barrucadu.co.uk/notes/070.html permanent redir /weeknotes-071.html https://weeknotes.barrucadu.co.uk/notes/071.html permanent redir /weeknotes-072.html https://weeknotes.barrucadu.co.uk/notes/072.html permanent redir /weeknotes-073.html https://weeknotes.barrucadu.co.uk/notes/073.html permanent redir /weeknotes-074.html https://weeknotes.barrucadu.co.uk/notes/074.html permanent redir /weeknotes-075.html https://weeknotes.barrucadu.co.uk/notes/075.html permanent redir /weeknotes-076.html https://weeknotes.barrucadu.co.uk/notes/076.html permanent redir /weeknotes-077.html https://weeknotes.barrucadu.co.uk/notes/077.html permanent redir /weeknotes-078.html https://weeknotes.barrucadu.co.uk/notes/078.html permanent redir /weeknotes-079.html https://weeknotes.barrucadu.co.uk/notes/079.html permanent redir /weeknotes-080.html https://weeknotes.barrucadu.co.uk/notes/080.html permanent redir /weeknotes-081.html https://weeknotes.barrucadu.co.uk/notes/081.html permanent redir /weeknotes-082.html https://weeknotes.barrucadu.co.uk/notes/082.html permanent redir /weeknotes-083.html https://weeknotes.barrucadu.co.uk/notes/083.html permanent redir /weeknotes-084.html https://weeknotes.barrucadu.co.uk/notes/084.html permanent redir /weeknotes-085.html https://weeknotes.barrucadu.co.uk/notes/085.html permanent redir /weeknotes-086.html https://weeknotes.barrucadu.co.uk/notes/086.html permanent redir /weeknotes-087.html https://weeknotes.barrucadu.co.uk/notes/087.html permanent redir /weeknotes-088.html https://weeknotes.barrucadu.co.uk/notes/088.html permanent redir /weeknotes-089.html https://weeknotes.barrucadu.co.uk/notes/089.html permanent redir /weeknotes-090.html https://weeknotes.barrucadu.co.uk/notes/090.html permanent redir /weeknotes-091.html https://weeknotes.barrucadu.co.uk/notes/091.html permanent redir /weeknotes-092.html https://weeknotes.barrucadu.co.uk/notes/092.html permanent redir /weeknotes-093.html https://weeknotes.barrucadu.co.uk/notes/093.html permanent redir /weeknotes-094.html https://weeknotes.barrucadu.co.uk/notes/094.html permanent redir /weeknotes-095.html https://weeknotes.barrucadu.co.uk/notes/095.html permanent redir /weeknotes-096.html https://weeknotes.barrucadu.co.uk/notes/096.html permanent redir /weeknotes-097.html https://weeknotes.barrucadu.co.uk/notes/097.html permanent redir /weeknotes-098.html https://weeknotes.barrucadu.co.uk/notes/098.html permanent redir /weeknotes-099.html https://weeknotes.barrucadu.co.uk/notes/099.html permanent redir /weeknotes-100.html https://weeknotes.barrucadu.co.uk/notes/100.html permanent redir /weeknotes-101.html https://weeknotes.barrucadu.co.uk/notes/101.html permanent redir /weeknotes-102.html https://weeknotes.barrucadu.co.uk/notes/102.html permanent redir /weeknotes-103.html https://weeknotes.barrucadu.co.uk/notes/103.html permanent redir /weeknotes-104.html https://weeknotes.barrucadu.co.uk/notes/104.html permanent redir /weeknotes-105.html https://weeknotes.barrucadu.co.uk/notes/105.html permanent redir /weeknotes-106.html https://weeknotes.barrucadu.co.uk/notes/106.html permanent redir /weeknotes-107.html https://weeknotes.barrucadu.co.uk/notes/107.html permanent redir /weeknotes-108.html https://weeknotes.barrucadu.co.uk/notes/108.html permanent redir /weeknotes-109.html https://weeknotes.barrucadu.co.uk/notes/109.html permanent redir /weeknotes-110.html https://weeknotes.barrucadu.co.uk/notes/110.html permanent redir /weeknotes-111.html https://weeknotes.barrucadu.co.uk/notes/111.html permanent redir /weeknotes-112.html https://weeknotes.barrucadu.co.uk/notes/112.html permanent redir /weeknotes-113.html https://weeknotes.barrucadu.co.uk/notes/113.html permanent redir /weeknotes-114.html https://weeknotes.barrucadu.co.uk/notes/114.html permanent redir /weeknotes-115.html https://weeknotes.barrucadu.co.uk/notes/115.html permanent redir /weeknotes-116.html https://weeknotes.barrucadu.co.uk/notes/116.html permanent redir /weeknotes-117.html https://weeknotes.barrucadu.co.uk/notes/117.html permanent redir /weeknotes-118.html https://weeknotes.barrucadu.co.uk/notes/118.html permanent redir /weeknotes-119.html https://weeknotes.barrucadu.co.uk/notes/119.html permanent redir /weeknotes-120.html https://weeknotes.barrucadu.co.uk/notes/120.html permanent redir /weeknotes-121.html https://weeknotes.barrucadu.co.uk/notes/121.html permanent redir /weeknotes-122.html https://weeknotes.barrucadu.co.uk/notes/122.html permanent redir /weeknotes-123.html https://weeknotes.barrucadu.co.uk/notes/123.html permanent redir /weeknotes-124.html https://weeknotes.barrucadu.co.uk/notes/124.html permanent redir /weeknotes-125.html https://weeknotes.barrucadu.co.uk/notes/125.html permanent redir /weeknotes-126.html https://weeknotes.barrucadu.co.uk/notes/126.html permanent redir /weeknotes-127.html https://weeknotes.barrucadu.co.uk/notes/127.html permanent redir /weeknotes-128.html https://weeknotes.barrucadu.co.uk/notes/128.html permanent redir /weeknotes-129.html https://weeknotes.barrucadu.co.uk/notes/129.html permanent redir /weeknotes-130.html https://weeknotes.barrucadu.co.uk/notes/130.html permanent redir /weeknotes-131.html https://weeknotes.barrucadu.co.uk/notes/131.html permanent redir /weeknotes-132.html https://weeknotes.barrucadu.co.uk/notes/132.html permanent redir /weeknotes-133.html https://weeknotes.barrucadu.co.uk/notes/133.html permanent redir /weeknotes-134.html https://weeknotes.barrucadu.co.uk/notes/134.html permanent redir /weeknotes-135.html https://weeknotes.barrucadu.co.uk/notes/135.html permanent redir /weeknotes-136.html https://weeknotes.barrucadu.co.uk/notes/136.html permanent redir /weeknotes-137.html https://weeknotes.barrucadu.co.uk/notes/137.html permanent redir /weeknotes-138.html https://weeknotes.barrucadu.co.uk/notes/138.html permanent redir /weeknotes-139.html https://weeknotes.barrucadu.co.uk/notes/139.html permanent redir /weeknotes-140.html https://weeknotes.barrucadu.co.uk/notes/140.html permanent redir /weeknotes-141.html https://weeknotes.barrucadu.co.uk/notes/141.html permanent redir /weeknotes-142.html https://weeknotes.barrucadu.co.uk/notes/142.html permanent redir /weeknotes-143.html https://weeknotes.barrucadu.co.uk/notes/143.html permanent redir /weeknotes-144.html https://weeknotes.barrucadu.co.uk/notes/144.html permanent redir /weeknotes-145.html https://weeknotes.barrucadu.co.uk/notes/145.html permanent redir /weeknotes-146.html https://weeknotes.barrucadu.co.uk/notes/146.html permanent redir /weeknotes-147.html https://weeknotes.barrucadu.co.uk/notes/147.html permanent redir /weeknotes-148.html https://weeknotes.barrucadu.co.uk/notes/148.html permanent redir /weeknotes-149.html https://weeknotes.barrucadu.co.uk/notes/149.html permanent redir /weeknotes-150.html https://weeknotes.barrucadu.co.uk/notes/150.html permanent redir /weeknotes-151.html https://weeknotes.barrucadu.co.uk/notes/151.html permanent redir /weeknotes-152.html https://weeknotes.barrucadu.co.uk/notes/152.html permanent redir /weeknotes-153.html https://weeknotes.barrucadu.co.uk/notes/153.html permanent redir /weeknotes-154.html https://weeknotes.barrucadu.co.uk/notes/154.html permanent redir /weeknotes-155.html https://weeknotes.barrucadu.co.uk/notes/155.html permanent redir /weeknotes-156.html https://weeknotes.barrucadu.co.uk/notes/156.html permanent redir /weeknotes-157.html https://weeknotes.barrucadu.co.uk/notes/157.html permanent redir /weeknotes-158.html https://weeknotes.barrucadu.co.uk/notes/158.html permanent redir /weeknotes-159.html https://weeknotes.barrucadu.co.uk/notes/159.html permanent redir /weeknotes-160.html https://weeknotes.barrucadu.co.uk/notes/160.html permanent redir /weeknotes-161.html https://weeknotes.barrucadu.co.uk/notes/161.html permanent redir /weeknotes-162.html https://weeknotes.barrucadu.co.uk/notes/162.html permanent redir /weeknotes-163.html https://weeknotes.barrucadu.co.uk/notes/163.html permanent redir /weeknotes-164.html https://weeknotes.barrucadu.co.uk/notes/164.html permanent redir /weeknotes-165.html https://weeknotes.barrucadu.co.uk/notes/165.html permanent redir /weeknotes-166.html https://weeknotes.barrucadu.co.uk/notes/166.html permanent redir /weeknotes-167.html https://weeknotes.barrucadu.co.uk/notes/167.html permanent redir /weeknotes-168.html https://weeknotes.barrucadu.co.uk/notes/168.html permanent redir /weeknotes-169.html https://weeknotes.barrucadu.co.uk/notes/169.html permanent redir /weeknotes-170.html https://weeknotes.barrucadu.co.uk/notes/170.html permanent redir /weeknotes-171.html https://weeknotes.barrucadu.co.uk/notes/171.html permanent redir /weeknotes-172.html https://weeknotes.barrucadu.co.uk/notes/172.html permanent redir /weeknotes-173.html https://weeknotes.barrucadu.co.uk/notes/173.html permanent redir /weeknotes-174.html https://weeknotes.barrucadu.co.uk/notes/174.html permanent redir /weeknotes-175.html https://weeknotes.barrucadu.co.uk/notes/175.html permanent redir /weeknotes-176.html https://weeknotes.barrucadu.co.uk/notes/176.html permanent redir /weeknotes-177.html https://weeknotes.barrucadu.co.uk/notes/177.html permanent redir /weeknotes-178.html https://weeknotes.barrucadu.co.uk/notes/178.html permanent redir /weeknotes-179.html https://weeknotes.barrucadu.co.uk/notes/179.html permanent redir /weeknotes-180.html https://weeknotes.barrucadu.co.uk/notes/180.html permanent redir /weeknotes-181.html https://weeknotes.barrucadu.co.uk/notes/181.html permanent redir /weeknotes-182.html https://weeknotes.barrucadu.co.uk/notes/182.html permanent redir /weeknotes-183.html https://weeknotes.barrucadu.co.uk/notes/183.html permanent redir /weeknotes-184.html https://weeknotes.barrucadu.co.uk/notes/184.html permanent redir /weeknotes-185.html https://weeknotes.barrucadu.co.uk/notes/185.html permanent redir /weeknotes-186.html https://weeknotes.barrucadu.co.uk/notes/186.html permanent redir /weeknotes-187.html https://weeknotes.barrucadu.co.uk/notes/187.html permanent redir /weeknotes-188.html https://weeknotes.barrucadu.co.uk/notes/188.html permanent redir /weeknotes-189.html https://weeknotes.barrucadu.co.uk/notes/189.html permanent redir /weeknotes-190.html https://weeknotes.barrucadu.co.uk/notes/190.html permanent redir /weeknotes-191.html https://weeknotes.barrucadu.co.uk/notes/191.html permanent redir /weeknotes-192.html https://weeknotes.barrucadu.co.uk/notes/192.html permanent redir /weeknotes-193.html https://weeknotes.barrucadu.co.uk/notes/193.html permanent redir /weeknotes-194.html https://weeknotes.barrucadu.co.uk/notes/194.html permanent redir /weeknotes-195.html https://weeknotes.barrucadu.co.uk/notes/195.html permanent redir /weeknotes-196.html https://weeknotes.barrucadu.co.uk/notes/196.html permanent redir /weeknotes-197.html https://weeknotes.barrucadu.co.uk/notes/197.html permanent redir /weeknotes-198.html https://weeknotes.barrucadu.co.uk/notes/198.html permanent redir /weeknotes-199.html https://weeknotes.barrucadu.co.uk/notes/199.html permanent redir /weeknotes-200.html https://weeknotes.barrucadu.co.uk/notes/200.html permanent redir /weeknotes-201.html https://weeknotes.barrucadu.co.uk/notes/201.html permanent redir /weeknotes-202.html https://weeknotes.barrucadu.co.uk/notes/202.html permanent redir /weeknotes-203.html https://weeknotes.barrucadu.co.uk/notes/203.html permanent redir /weeknotes-204.html https://weeknotes.barrucadu.co.uk/notes/204.html permanent redir /weeknotes-205.html https://weeknotes.barrucadu.co.uk/notes/205.html permanent redir /weeknotes-206.html https://weeknotes.barrucadu.co.uk/notes/206.html permanent redir /weeknotes-207.html https://weeknotes.barrucadu.co.uk/notes/207.html permanent redir /weeknotes-208.html https://weeknotes.barrucadu.co.uk/notes/208.html permanent redir /weeknotes-209.html https://weeknotes.barrucadu.co.uk/notes/209.html permanent redir /weeknotes-210.html https://weeknotes.barrucadu.co.uk/notes/210.html permanent redir /weeknotes-211.html https://weeknotes.barrucadu.co.uk/notes/211.html permanent redir /weeknotes-212.html https://weeknotes.barrucadu.co.uk/notes/212.html permanent redir /weeknotes-002/welsh.png https://weeknotes.barrucadu.co.uk/notes/002/welsh.png permanent redir /weeknotes-002/x-ray.png https://weeknotes.barrucadu.co.uk/notes/002/x-ray.png permanent redir /weeknotes-004/assets-vs-documents.png https://weeknotes.barrucadu.co.uk/notes/004/assets-vs-documents.png permanent redir /weeknotes-004/asset-workflow.png https://weeknotes.barrucadu.co.uk/notes/004/asset-workflow.png permanent redir /weeknotes-004/transition-architecture.png https://weeknotes.barrucadu.co.uk/notes/004/transition-architecture.png permanent redir /weeknotes-020/thesis.png https://weeknotes.barrucadu.co.uk/notes/020/thesis.png permanent redir /weeknotes-062/bank-holidays.png https://weeknotes.barrucadu.co.uk/notes/062/bank-holidays.png permanent redir /weeknotes-071/docs.png https://weeknotes.barrucadu.co.uk/notes/071/docs.png permanent redir /weeknotes-071/notion.png https://weeknotes.barrucadu.co.uk/notes/071/notion.png permanent redir /weeknotes-096/cheatsheet.pdf https://weeknotes.barrucadu.co.uk/notes/096/cheatsheet.pdf permanent redir /weeknotes-096/spellbook.pdf https://weeknotes.barrucadu.co.uk/notes/096/spellbook.pdf permanent redir /weeknotes-100/barking-permit.png https://weeknotes.barrucadu.co.uk/notes/100/barking-permit.png permanent redir /weeknotes-106/dashboard.png https://weeknotes.barrucadu.co.uk/notes/106/dashboard.png permanent redir /weeknotes-106/startpage.png https://weeknotes.barrucadu.co.uk/notes/106/startpage.png permanent redir /weeknotes-117/leisure-breakdown.png https://weeknotes.barrucadu.co.uk/notes/117/leisure-breakdown.png permanent redir /weeknotes-128/lookwhattheshoggothdraggedin.png https://weeknotes.barrucadu.co.uk/notes/128/lookwhattheshoggothdraggedin.png permanent redir /weeknotes-133/to-do.jpg https://weeknotes.barrucadu.co.uk/notes/133/to-do.jpg permanent redir /weeknotes-147/basics.pdf https://weeknotes.barrucadu.co.uk/notes/147/basics.pdf permanent redir /weeknotes-147/spacecraft.pdf https://weeknotes.barrucadu.co.uk/notes/147/spacecraft.pdf permanent redir /weeknotes-147/uwp.pdf https://weeknotes.barrucadu.co.uk/notes/147/uwp.pdf permanent redir /weeknotes-148/temperature.png https://weeknotes.barrucadu.co.uk/notes/148/temperature.png permanent redir /weeknotes-176/assets.png https://weeknotes.barrucadu.co.uk/notes/176/assets.png permanent redir /weeknotes-176/piracy.pdf https://weeknotes.barrucadu.co.uk/notes/176/piracy.pdf permanent redir /weeknotes-178/book-leak.jpg https://weeknotes.barrucadu.co.uk/notes/178/book-leak.jpg permanent redir /weeknotes-180/repetitive.jpg https://weeknotes.barrucadu.co.uk/notes/180/repetitive.jpg permanent redir /weeknotes-184/dns-dashboard.png https://weeknotes.barrucadu.co.uk/notes/184/dns-dashboard.png permanent redir /weeknotes-196/hot-springs-island-current-cover.jpg https://weeknotes.barrucadu.co.uk/notes/196/hot-springs-island-current-cover.jpg permanent redir /weeknotes-196/hot-springs-island-new-cover.jpg https://weeknotes.barrucadu.co.uk/notes/196/hot-springs-island-new-cover.jpg permanent redir /weeknotes-196/ose-photo.jpg https://weeknotes.barrucadu.co.uk/notes/196/ose-photo.jpg permanent redir /weeknotes-196/traveller-map.png https://weeknotes.barrucadu.co.uk/notes/196/traveller-map.png permanent redir /weeknotes-198/photo-hot-springs-island.jpg https://weeknotes.barrucadu.co.uk/notes/198/photo-hot-springs-island.jpg permanent redir /weeknotes-209/cult-of-the-lamb.jpg https://weeknotes.barrucadu.co.uk/notes/209/cult-of-the-lamb.jpg permanent ================================================ FILE: shared/host-templates/website-mirror/resources/www-barrucadu-co-uk.caddyfile ================================================ # Removed posts error /posts/2013-05-27-a-gentle-introduction-to-parsec.html 410 error /posts/2014-01-07-garbage-collection.html 410 error /posts/2014-12-26-haskell-systematic-concurrency-testing.html 410 error /posts/2015-01-10-pre-emption-bounding.html 410 error /posts/2015-07-18-continuous-integration-with-jenkins-and-stack.html 410 error /posts/2015-07-26-erlang-gopher-server.html 410 error /posts/2015-08-01-debugging-an-allocation-issue.html 410 error /posts/2015-08-09-identity-monads-ahoy.html 410 error /posts/2015-09-23-icfp-retrospective.html 410 error /posts/2015-10-04-secure-communications-over-insecure-channels.html 410 error /posts/2015-12-15-finite-maps-in-isabelle.html 410 error /posts/2016-02-02-cabal-info.html 410 error /posts/2016-04-03-dejafu-0.3.0.0-release.html 410 error /posts/2016-05-18-some-thoughts-on-distributed-systems.html 410 error /posts/2016-09-10-dejafu-0.4.0.0-release.html 410 error /posts/2017-02-02-subconcurrency.html 410 error /posts/2017-02-21-concurrency-1.1.0.0-dejafu-0.5.0.1-release.html 410 error /posts/concurrency/2014-12-26-haskell-systematic-concurrency-testing.html 410 error /posts/concurrency/2015-01-10-pre-emption-bounding.html 410 error /posts/concurrency/2016-05-18-some-thoughts-on-distributed-systems.html 410 error /posts/concurrency/2017-02-02-subconcurrency.html 410 error /posts/etc/2013-05-27-a-gentle-introduction-to-parsec.html 410 error /posts/etc/2015-08-01-debugging-an-allocation-issue.html 410 error /posts/etc/2015-09-23-icfp-retrospective.html 410 error /posts/etc/2016-02-02-cabal-info.html 410 error /posts/etc/2017-03-15-optimising-haskell.html 410 error /posts/etc/2017-04-16-representing-generating-comparing-typed-expressions.html 410 error /posts/relnotes/2016-04-03-dejafu-0.3.0.0-release.html 410 error /posts/relnotes/2016-09-10-dejafu-0.4.0.0-release.html 410 error /posts/relnotes/2017-02-21-concurrency-1.1.0.0-dejafu-0.5.0.1-release.html 410 # Moved proxies redir /bookdb https://bookdb.barrucadu.co.uk permanent redir /bookdb/* https://bookdb.barrucadu.co.uk permanent # Removed files error /now.html 410 # Moved files redir /publications/coco-flops18-prelim.pdf /publications/coco-flops18.pdf permanent redir /publications/coco-flops18-prelim.bib /publications/coco-flops18.bib permanent # Renamed posts redir /posts/2015-08-21-reducing-combinatorial-explosion.html /posts/concurrency/2015-08-21-reducing-combinatorial-explosion.html permanent redir /posts/2015-08-27-announce-dejafu.html /posts/relnotes/2015-08-27-announce-dejafu.html permanent redir /posts/2015-11-29-breaking-the-law-verifying-typeclass-laws-with-quickcheck-and-dejafu.html /posts/concurrency/2015-11-29-breaking-the-law-verifying-typeclass-laws-with-quickcheck-and-dejafu.html permanent redir /posts/2016-01-09-c-is-not-turing-complete.html /posts/etc/2016-01-09-c-is-not-turing-complete.html permanent redir /posts/2016-02-12-strict-vs-lazy.html /posts/etc/2016-02-12-strict-vs-lazy.html permanent redir /posts/2016-05-13-systematic-concurrency-testing-and-daemon-threads.html /posts/concurrency/2016-05-13-systematic-concurrency-testing-and-daemon-threads.html permanent redir /posts/2016-08-25-three-months-of-go.html /posts/etc/2016-08-25-three-months-of-go.html permanent # Converted to memos redir /posts/concurrency/2015-08-21-reducing-combinatorial-explosion.html https://memo.barrucadu.co.uk/reducing-combinatorial-explosion.html permanent redir /posts/concurrency/2015-11-29-breaking-the-law-verifying-typeclass-laws-with-quickcheck-and-dejafu.html https://memo.barrucadu.co.uk/concurrency-and-typeclass-laws.html permanent redir /posts/concurrency/2016-05-13-systematic-concurrency-testing-and-daemon-threads.html https://memo.barrucadu.co.uk/sct-and-daemons.html permanent redir /posts/concurrency/2017-06-09-property-testing-side-effects.html https://memo.barrucadu.co.uk/property-testing-side-effects.html permanent redir /posts/concurrency/2017-10-14-writing-a-concurrency-testing-library-01.html https://memo.barrucadu.co.uk/minifu-01.html permanent redir /posts/concurrency/2017-10-28-writing-a-concurrency-testing-library-02.html https://memo.barrucadu.co.uk/minifu-02.html permanent redir /posts/etc/2016-01-09-c-is-not-turing-complete.html https://memo.barrucadu.co.uk/c-is-not-turing-complete.html permanent redir /posts/etc/2016-02-12-strict-vs-lazy.html https://memo.barrucadu.co.uk/strict-vs-lazy.html permanent redir /posts/etc/2016-08-25-three-months-of-go.html https://memo.barrucadu.co.uk/three-months-of-go.html permanent redir /posts/etc/2017-05-18-visualise-your-finances-with-hledger-influxdb-grafana.html https://memo.barrucadu.co.uk/hledger-influxdb-grafana.html permanent redir /posts/etc/2017-12-06-the-academic-mindset-and-me.html https://memo.barrucadu.co.uk/academic-mindset.html permanent redir /posts/etc/2017-12-16-i-need-a-budget.html https://memo.barrucadu.co.uk/2018-budget.html permanent redir /posts/relnotes/2015-08-27-announce-dejafu.html https://memo.barrucadu.co.uk/dejafu-0.1.0.0.html permanent redir /posts/relnotes/2017-08-16-significant-performance-improvements.html https://memo.barrucadu.co.uk/throwing-away-traces.html permanent redir /posts/relnotes/2017-09-22-irc-client-1.0.0.0.html https://memo.barrucadu.co.uk/irc-client-1.0.0.0.html permanent ================================================ FILE: shared/minecraft/default.nix ================================================ # [Minecraft][] Java Edition runner. Supports multiple servers, with mods. # This module doesn't manage the Minecraft server files, only operating them. # # Yes, I know there's a NixOS minecraft module, but it uses the Minecraft in # nixpkgs and only runs one server, whereas I want to run multiple modded # servers. # # The Minecraft server files must be in `''${dataDir}/{name}`. # # This module does not include a backup script. Servers must be backed up # independently. # # **Erase your darlings:** overrides the `dataDir`. # # [Minecraft]: https://www.minecraft.net/en-us { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.minecraft; serverPorts = mapAttrsToList (_: server: server.port) cfg.servers; in { imports = [ ./erase-your-darlings.nix ./options.nix ]; config = mkIf cfg.enable { # from https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/games/minecraft-server.nix users.users.minecraft = { uid = 993; description = "Minecraft server service user"; home = cfg.dataDir; createHome = true; isSystemUser = true; group = "nogroup"; }; systemd.sockets = let make = name: _: nameValuePair "minecraft-${name}-stdin" { description = "stdin for minecraft-${name}"; socketConfig = { ListenFIFO = "%t/minecraft-${name}.stdin"; Service = "minecraft-${name}.service"; }; }; in mapAttrs' make cfg.servers; systemd.services = let make = name: server: nameValuePair "minecraft-${name}" { description = "Minecraft Server Service (${name})"; wantedBy = if server.autoStart then [ "multi-user.target" ] else [ ]; after = [ "network.target" ]; serviceConfig = { ExecStart = "${server.jre}/bin/java ${server.jvmOpts} -jar ${server.jar}"; Restart = "always"; User = "minecraft"; WorkingDirectory = "${cfg.dataDir}/${name}"; Sockets = "minecraft-${name}-stdin.socket"; StandardInput = "socket"; StandardOutput = "journal"; StandardError = "journal"; }; }; in mapAttrs' make cfg.servers; networking.firewall.allowedUDPPorts = serverPorts; networking.firewall.allowedTCPPorts = serverPorts; }; } ================================================ FILE: shared/minecraft/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.minecraft; eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf (cfg.enable && eyd.enable) { nixfiles.minecraft.dataDir = "${toString eyd.persistDir}/var/lib/minecraft"; }; } ================================================ FILE: shared/minecraft/options.nix ================================================ { lib, pkgs, ... }: with lib; { options.nixfiles.minecraft = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [Minecraft](https://www.minecraft.net/en-us) service. ''; }; dataDir = mkOption { type = types.path; default = "/var/lib/minecraft"; description = '' Directory to store data files in. If the `erase-your-darlings` module is enabled, this is overridden to be on the persistent volume. ''; }; servers = mkOption { type = types.attrsOf (types.submodule { options = { autoStart = mkOption { type = types.bool; default = true; description = '' Start the server automatically on boot. ''; }; port = mkOption { type = types.int; description = '' Port to open in the firewall. This must match the port in the `server.properties` file. ''; }; jar = mkOption { type = types.str; default = "minecraft-server.jar"; description = '' Name of the JAR file to use. This file must be in the working directory. ''; }; jre = mkOption { type = types.package; default = pkgs.jdk17_headless; description = '' Java runtime package to use. ''; }; jvmOpts = mkOption { type = types.separatedString " "; default = "-Xmx4G -Xms4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"; description = '' Java runtime arguments. Cargo cult these from a forum post and then never think about them again. ''; }; }; } ); default = { }; description = '' Attrset of minecraft server definitions. Each server `{name}` is run in the working directory `''${dataDir}/{name}`. ''; }; }; } ================================================ FILE: shared/oci-containers/default.nix ================================================ # > [!NOTE] # > **TODO:** Run podman containers run as a non-root user. # # An abstraction over running containers as systemd units, enforcing some good # practices: # # - Container DNS behaves the same under docker and podman. # - Ports are exposed on `127.0.0.1`, rather than `0.0.0.0`. # - Volumes are backed up by bind-mounts to the host filesystem. # # Switching between using docker or podman for the container runtime should be # totally transparent. # # **Erase your darlings:** overrides the `volumeBaseDir`. { config, lib, pkgs, ... }: with lib; let mkPortDef = { host, inner }: "127.0.0.1:${toString host}:${toString inner}"; mkVolumeDef = container: { name, host, inner }: if host != null then "${host}:${inner}" else "${cfg.volumeBaseDir}/${container.volumeSubDir}/${name}:${inner}"; shouldPreStart = _name: container: container.pullOnStart; mkPreStart = name: container: nameValuePair "${cfg.backend}-${name}" { preStart = "${cfg.backend} pull ${container.image}"; }; shouldDependOnNetwork = _name: container: container.network != null; mkDependOnNetwork = nameValuePair "${cfg.backend}-${name}" ( let u = "${cfg.backend}-net-${container.network}.service"; in { after = [u]; requires = [u]; } ); shouldDependOnPod = _name: container: container.pod != null; mkDependOnPod = name: container: nameValuePair "${cfg.backend}-${name}" ( let u = "${cfg.backend}-pod-${container.pod}.service"; in { after = [u]; requires = [u]; } ); shouldNetworkService = _name: container: container.network != null; mkNetworkService = _name: container: let package = if cfg.backend == "docker" then pkgs.docker else pkgs.podman; in nameValuePair "${cfg.backend}-net-${container.network}" { description = "Manage the ${container.network} network for ${cfg.backend}"; preStart = "${package}/bin/${cfg.backend} network rm ${container.network} || true"; serviceConfig = { Type = "oneshot"; ExecStart = "${package}/bin/${cfg.backend} network create -d bridge ${container.network}"; ExecStop = "${package}/bin/${cfg.backend} network rm ${container.network}"; RemainAfterExit = "yes"; }; }; mkPodService = name: pod: let package = if cfg.backend == "podman" then pkgs.podman else throw "mkPodService only supports podman"; aliases = map (cn: "${name}-${cn}") (attrNames pod.containers); ports = concatLists (catAttrs "ports" (attrValues pod.containers)); in nameValuePair "${cfg.backend}-pod-${name}" { description = "Manage the ${name} pod for ${cfg.backend}"; preStart = "${package}/bin/${cfg.backend} pod rm --force --ignore ${name} || true"; serviceConfig = { Type = "oneshot"; ExecStart = let args = map (n: "--network-alias=${n}") aliases ++ map (pd: "-p ${mkPortDef pd}") ports; in "${package}/bin/${cfg.backend} pod create ${concatStringsSep " " args} ${name}"; ExecStop = "${package}/bin/${cfg.backend} pod rm ${name}"; RemainAfterExit = "yes"; }; }; mkContainer = _name: container: with container; let hasNetwork = container.network != null; hasPod = container.pod != null; in { inherit autoStart cmd dependsOn environment environmentFiles image login; extraOptions = container.extraOptions ++ (if hasNetwork then [ "--network=${container.network}" ] else [ ]) ++ (if hasPod then [ "--pod=${container.pod}" ] else [ ]); /* ports are defined at the pod level */ ports = if hasPod then [ ] else map mkPortDef ports; volumes = map (mkVolumeDef container) volumes; }; cfg = config.nixfiles.oci-containers; allContainers = let mkPodContainer = podName: pod: containerName: container: nameValuePair "${podName}-${containerName}" ( container // { network = if cfg.backend == "docker" then podName else null; pod = if cfg.backend == "docker" then null else podName; volumeSubDir = pod.volumeSubDir; } ); in concatMapAttrs (podName: pod: mapAttrs' (mkPodContainer podName pod) pod.containers) cfg.pods; in { imports = [ ./options.nix ./erase-your-darlings.nix ]; config = { virtualisation.${cfg.backend} = { enable = true; autoPrune.enable = true; }; virtualisation.oci-containers = { backend = cfg.backend; containers = mapAttrs mkContainer allContainers; }; systemd.services = mkMerge [ (mapAttrs' mkPreStart (filterAttrs shouldPreStart allContainers)) (mapAttrs' mkDependOnNetwork (filterAttrs shouldDependOnNetwork allContainers)) (mapAttrs' mkDependOnPod (filterAttrs shouldDependOnPod allContainers)) (mapAttrs' mkNetworkService (filterAttrs shouldNetworkService allContainers)) (if cfg.backend == "podman" then mapAttrs' mkPodService cfg.pods else { }) ]; }; } ================================================ FILE: shared/oci-containers/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf eyd.enable { nixfiles.oci-containers.volumeBaseDir = "${toString eyd.persistDir}/docker-volumes"; }; } ================================================ FILE: shared/oci-containers/options.nix ================================================ { lib, ... }: with lib; let portOptions = { host = mkOption { type = types.int; description = '' Host port (on 127.0.0.1) to expose the container port on. ''; }; inner = mkOption { type = types.int; description = '' The container port to expose to the hosti. ''; }; }; volumeOptions = { name = mkOption { type = types.nullOr types.str; default = null; description = '' Name of the volume. This is equivalent to: ```nix host = "''${volumeBaseDir}/''${volumeSubDir}/''${name}"; ``` This option c.logonflicts with `''${host}`. ''; }; host = mkOption { type = types.nullOr types.str; default = null; description = '' Directory on the host to bind-mount into the container. This option conflicts with `''${name}`. ''; }; inner = mkOption { type = types.str; description = '' Directory in the container to mount the volume to. ''; }; }; containerOptions = { /* regular oci-containers */ autoStart = mkOption { type = types.bool; default = true; description = '' Start the container automatically on boot. ''; }; cmd = mkOption { type = types.listOf types.str; default = [ ]; description = '' Command-line arguments to pass to the container image's entrypoint. ''; }; dependsOn = mkOption { type = types.listOf types.str; default = [ ]; example = [ "concourse-db" ]; description = '' Other containers that this one depends on, in `''${pod}-''${name}` format. ''; }; environment = mkOption { type = types.attrsOf types.str; default = { }; description = '' Environment variables to set for this container. ''; }; environmentFiles = mkOption { type = types.listOf types.path; default = [ ]; description = '' List of environment files for this container. ''; }; extraOptions = mkOption { type = types.listOf types.str; default = [ ]; description = '' Extra options to pass to `docker run` / `podman run`. ''; }; image = mkOption { type = types.str; description = '' Container image to run. ''; }; login = { username = mkOption { type = types.nullOr types.str; default = null; description = '' Username for the container registry. ''; }; passwordFile = mkOption { type = types.nullOr types.str; default = null; description = '' File containing the password for the container registry. ''; }; registry = mkOption { type = types.nullOr types.str; default = null; description = '' Container registry to authenticate with. ''; }; }; /* changed */ ports = mkOption { type = types.listOf (types.submodule { options = portOptions; }); default = [ ]; description = '' List of ports to expose. ''; }; volumes = mkOption { type = types.listOf (types.submodule { options = volumeOptions; }); default = [ ]; description = '' List of volume definitions. ''; }; /* new options */ pullOnStart = mkOption { type = types.bool; default = true; description = '' Pull the container image when starting (useful for `:latest` images). ''; }; }; in { options.nixfiles.oci-containers = { backend = mkOption { type = types.enum [ "docker" "podman" ]; default = "docker"; description = '' The container runtime. ''; }; pods = mkOption { type = types.attrsOf (types.submodule ({ name, ... }: { options = { containers = mkOption { type = types.attrsOf (types.submodule { options = containerOptions; }); default = { }; description = '' Attrset of container definitions. ''; }; volumeSubDir = mkOption { type = types.str; default = name; description = '' Subdirectory of the `''${volumeBaseDir}` to store bind-mounts under. ''; }; }; })); default = { }; description = '' Attrset of pod definitions. ''; }; volumeBaseDir = mkOption { type = types.str; description = '' Directory to store volume bind-mounts under. If the `erase-your-darlings` module is enabled, this is overridden to be on the persistent volume. ''; }; }; } ================================================ FILE: shared/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.firewall = { ipBlocklistFile = mkOption { type = types.nullOr types.str; default = null; description = '' File containing IPs to block. This is of the form: ```text ip-address # comment ip-address # comment ... ``` ''; }; }; } ================================================ FILE: shared/pleroma/default.nix ================================================ # [Pleroma][] is a fediverese server. # # Pleroma uses a containerised postgres database. # # **Backups:** the postgres database, uploaded files, and custom emojis. # # **Erase your darlings:** transparently stores data on the persistent volume. # # [Pleroma]: https://pleroma.social/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.pleroma; backend = config.nixfiles.oci-containers.backend; backendPkg = if backend == "docker" then pkgs.docker else pkgs.podman; dbSocketDir = "/run/pleroma-db"; pleromaUser = config.services.pleroma.user; pleromaGroup = config.services.pleroma.group; in { imports = [ ./erase-your-darlings.nix ./options.nix ]; config = mkIf cfg.enable { services.pleroma.enable = true; services.pleroma.configs = [ '' import Config config :pleroma, Pleroma.Web.Endpoint, url: [host: System.fetch_env!("DOMAIN"), scheme: "https", port: 443], http: [ip: {127, 0, 0, 1}, port: System.fetch_env!("PORT") |> String.to_integer] config :pleroma, :instance, name: System.fetch_env!("INSTANCE_NAME"), email: System.fetch_env!("ADMIN_EMAIL"), notify_email: System.fetch_env!("NOTIFY_EMAIL"), limit: 5000, registrations_open: System.fetch_env!("ALLOW_REGISTRATION") |> String.to_atom, healthcheck: true config :pleroma, Pleroma.Repo, adapter: Ecto.Adapters.Postgres, username: "pleroma", password: "pleroma", database: "pleroma", socket_dir: "${dbSocketDir}/", pool_size: 10 config :web_push_encryption, :vapid_details, subject: "mailto:#{System.fetch_env!("NOTIFY_EMAIL")}" config :pleroma, :database, rum_enabled: false config :pleroma, :instance, static_dir: "/var/lib/pleroma/static" config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads" config :os_mon, start_cpu_sup: false, start_disksup: false, start_memsup: false '' ]; services.pleroma.secretConfigFile = cfg.secretsFile; systemd.services.pleroma = { wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" "${backend}-pleroma-db.service" ]; wants = [ "network-online.target" ]; requires = [ "${backend}-pleroma-db.service" ]; environment = { DOMAIN = cfg.domain; PORT = toString cfg.port; INSTANCE_NAME = if cfg.instanceName == null then cfg.domain else cfg.instanceName; ADMIN_EMAIL = cfg.adminEmail; NOTIFY_EMAIL = if cfg.notifyEmail == null then cfg.adminEmail else cfg.notifyEmail; ALLOW_REGISTRATION = if cfg.allowRegistration then "true" else "false"; }; serviceConfig.BindPaths = [ "${toString (pkgs.copyPathToStore cfg.faviconPath)}:/var/lib/pleroma/static/favicon.png" ]; }; systemd.services.pleroma-migrations = { after = [ "network-online.target" "${backend}-pleroma-db.service" ]; environment = config.systemd.services.pleroma.environment; }; users.users."${pleromaUser}".uid = 989; users.groups."${pleromaGroup}".gid = 994; nixfiles.oci-containers.pods.pleroma.containers.db = { image = "mirror.gcr.io/postgres:${cfg.postgresTag}"; environment = { "POSTGRES_DB" = "pleroma"; "POSTGRES_USER" = "pleroma"; "POSTGRES_PASSWORD" = "pleroma"; }; extraOptions = [ "--shm-size=1g" ]; volumes = [ { name = "pgdata"; inner = "/var/lib/postgresql/data"; } { host = dbSocketDir; inner = "/var/run/postgresql"; } ]; }; systemd.tmpfiles.rules = [ "d ${dbSocketDir} 0700 ${pleromaUser} ${pleromaGroup}" ]; nixfiles.restic-backups.backups.pleroma = { prepareCommand = '' /run/wrappers/bin/sudo ${backendPkg}/bin/${backend} exec -i pleroma-db pg_dump -U pleroma --no-owner -Fc pleroma > postgres.dump ''; paths = [ config.users.users."${pleromaUser}".home "postgres.dump" ]; }; nixfiles.restic-backups.sudoRules = [ { command = "${backendPkg}/bin/${backend} exec -i pleroma-db pg_dump -U pleroma --no-owner -Fc pleroma"; } ]; }; } ================================================ FILE: shared/pleroma/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.pleroma; eyd = config.nixfiles.eraseYourDarlings; # systemd unit assumes files are accessible under "/var/lib/pleroma" pleromaHome = "${toString eyd.persistDir}/var/lib/pleroma"; in { config = mkIf (cfg.enable && eyd.enable) { users.users.pleroma.home = mkForce pleromaHome; systemd.services.pleroma.serviceConfig.BindPaths = [ "${pleromaHome}:/var/lib/pleroma" ]; }; } ================================================ FILE: shared/pleroma/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.pleroma = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [Pleroma](https://pleroma.social/) service. ''; }; port = mkOption { type = types.int; default = 46283; description = '' Port (on 127.0.0.1) to expose Pleroma on. ''; }; postgresTag = mkOption { type = types.str; default = "16"; description = '' Tag to use of the `postgres` container image. ''; }; domain = mkOption { type = types.str; example = "social.lainon.life"; description = '' Domain which Pleroma will be exposed on. ''; }; faviconPath = mkOption { type = types.nullOr types.path; default = null; description = '' File to use for the favicon. ''; }; instanceName = mkOption { type = types.nullOr types.str; default = null; description = '' Name of the instance, defaults to the `''${domain}` if not set. ''; }; adminEmail = mkOption { type = types.str; default = "mike@barrucadu.co.uk"; description = '' Email address used to contact the server operator. ''; }; notifyEmail = mkOption { type = types.nullOr types.str; default = null; description = '' Email address used for notification, defaults to the `''${adminEmail}` if not set. ''; }; allowRegistration = mkOption { type = types.bool; default = false; description = '' Allow new users to sign up. ''; }; secretsFile = mkOption { type = types.str; description = '' File containing secret configuration. See the Pleroma documentation for what this needs to contain. ''; }; }; } ================================================ FILE: shared/resolved/dashboard.json ================================================ { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 0, "y": 0 }, "id": 2, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_requests_total{job=\"$Job\"}", "interval": "", "legendFormat": "{{protocol}}", "refId": "A" } ], "title": "Total Requests", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "reqps" }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 6, "y": 0 }, "id": 4, "options": { "legend": { "calcs": [ "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(dns_requests_total{job=\"$Job\"}[$__interval])", "interval": "30s", "intervalFactor": 1, "legendFormat": "{{protocol}}", "refId": "A" } ], "title": "Requests per Second", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 12, "y": 0 }, "id": 10, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "sum(dns_responses_total{job=\"$Job\"}) by (rcode)", "interval": "", "legendFormat": "{{rcode}}", "refId": "A" } ], "title": "Total Responses", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ops" }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 0 }, "id": 11, "options": { "legend": { "calcs": [ "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "sum(rate(dns_responses_total{job=\"$Job\"}[$__interval])) by (rcode)", "interval": "30s", "intervalFactor": 1, "legendFormat": "{{rcode}}", "refId": "A" } ], "title": "Responses per Second", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 0, "y": 8 }, "id": 27, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "editorMode": "code", "exemplar": true, "expr": "sum(dns_requests_refused_total{job=\"$Job\"}) by(reason)", "interval": "", "legendFormat": "{{reason}}", "range": true, "refId": "A" } ], "title": "Refused", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 6, "y": 8 }, "id": 13, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "sum(dns_questions_total{job=\"$Job\"}) by(qclass, qtype)", "interval": "", "legendFormat": "{{qclass}} {{qtype}}", "refId": "A" } ], "title": "Questions", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 12, "y": 8 }, "id": 17, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_authoritative_hit_total{job=\"$Job\"}", "interval": "", "legendFormat": "Authoritatively", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_blocked_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Blocked", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_cache_hit_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Cached", "refId": "C" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_override_hit_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Overridden", "refId": "D" } ], "title": "Answered Locally", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byFrameRefID", "options": "C" }, "properties": [ { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.axisSoftMax", "value": 1 }, { "id": "unit", "value": "percentunit" } ] } ] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 8 }, "id": 18, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_nameserver_hit_total{job=\"$Job\"}", "interval": "", "legendFormat": "Hits", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_nameserver_miss_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Misses", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_nameserver_hit_total{job=\"$Job\"} / (dns_resolver_nameserver_hit_total{job=\"$Job\"} + dns_resolver_nameserver_miss_total{job=\"$Job\"})", "hide": false, "interval": "", "legendFormat": "Ratio", "refId": "C" } ], "title": "Upstream Nameserver Calls", "transparent": true, "type": "timeseries" }, { "collapsed": false, "datasource": { "type": "datasource", "uid": "grafana" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 16 }, "id": 6, "panels": [], "targets": [ { "datasource": { "type": "datasource", "uid": "grafana" }, "refId": "A" } ], "title": "Cache", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byFrameRefID", "options": "C" }, "properties": [ { "id": "custom.axisPlacement", "value": "right" }, { "id": "unit", "value": "percentunit" }, { "id": "custom.axisSoftMax", "value": 1 } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 17 }, "id": 15, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_cache_hit_total{job=\"$Job\"}", "interval": "", "legendFormat": "Cache Hits", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_cache_miss_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Cache Misses", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "dns_resolver_cache_hit_total{job=\"$Job\"} / (dns_resolver_cache_hit_total{job=\"$Job\"} + dns_resolver_cache_miss_total{job=\"$Job\"})", "hide": false, "interval": "", "legendFormat": "Ratio", "refId": "C" } ], "title": "Effectiveness", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ops" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 17 }, "id": 24, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(dns_resolver_cache_hit_total{job=\"$Job\"}[$__interval])", "interval": "30s", "legendFormat": "Cache Hits", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(dns_resolver_cache_miss_total{job=\"$Job\"}[$__interval])", "hide": false, "interval": "30s", "legendFormat": "Cache Misses", "refId": "B" } ], "title": "Activity per Second", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 25 }, "id": 8, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "cache_size{job=\"$Job\"}", "interval": "", "legendFormat": "Size", "refId": "A" } ], "title": "Size", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 12, "y": 25 }, "id": 9, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "cache_expired_total{job=\"$Job\"}", "interval": "", "legendFormat": "Expired", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "cache_pruned_total{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Pruned", "refId": "B" } ], "title": "Eviction", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ops" }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 25 }, "id": 26, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(cache_expired_total{job=\"$Job\"}[$__interval])", "interval": "30s", "legendFormat": "Expiration", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(cache_pruned_total{job=\"$Job\"}[$__interval])", "hide": false, "interval": "30s", "legendFormat": "Pruning", "refId": "B" } ], "title": "Evictions per Second", "transparent": true, "type": "timeseries" }, { "collapsed": false, "datasource": { "type": "datasource", "uid": "grafana" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 33 }, "id": 22, "panels": [], "targets": [ { "datasource": { "type": "datasource", "uid": "grafana" }, "refId": "A" } ], "title": "Process", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 34 }, "id": 20, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "process_resident_memory_bytes{job=\"$Job\"}", "interval": "", "legendFormat": "Resident", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "process_virtual_memory_bytes{job=\"$Job\"}", "hide": false, "interval": "", "legendFormat": "Virtual", "refId": "B" } ], "title": "Memory Usage", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 34 }, "id": 23, "options": { "legend": { "calcs": [ "mean", "lastNotNull" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "exemplar": true, "expr": "rate(process_cpu_seconds_total{job=\"$Job\"}[$__interval])", "interval": "30s", "legendFormat": "Resident", "refId": "A" } ], "title": "CPU Usage", "transparent": true, "type": "timeseries" } ], "refresh": "30s", "revision": 1, "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "nyarlathotep-resolved", "value": "nyarlathotep-resolved" }, "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "definition": "label_values(dns_requests_total, job)", "hide": 0, "includeAll": false, "multi": false, "name": "Job", "options": [], "query": { "query": "label_values(dns_requests_total, job)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "DNS Resolver", "uid": "h_opszynz", "version": 1, "weekStart": "" } ================================================ FILE: shared/resolved/default.nix ================================================ # [resolved][] is a recursive DNS server for LAN DNS. # # Provides a grafana dashboard. # # [resolved]: https://github.com/barrucadu/resolved { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.resolved; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { systemd.services.resolved = { description = "barrucadu/resolved nameserver"; wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; serviceConfig = { AmbientCapabilities = "CAP_NET_BIND_SERVICE"; ExecStart = concatStringsSep " " [ "${pkgs.nixfiles.resolved}/bin/resolved" "-i ${cfg.address}" "-s ${toString cfg.cacheSize}" "--metrics-address ${cfg.metricsAddress}" "--protocol-mode ${cfg.protocolMode}" (if cfg.authoritativeOnly then "--authoritative-only " else "") (if cfg.forwardAddress != null then "--forward-address ${cfg.forwardAddress} " else "") (if cfg.hostsDirs == [ ] then "" else "-A ${concatStringsSep " -A " cfg.hostsDirs}") (if cfg.useDefaultZones then "-Z ${pkgs.nixfiles.resolved}/etc/resolved/zones" else "") (if cfg.zonesDirs == [ ] then "" else "-Z ${concatStringsSep " -Z " cfg.zonesDirs}") ]; ExecReload = "${pkgs.coreutils}/bin/kill -USR1 $MAINPID"; DynamicUser = "true"; Restart = "on-failure"; }; environment = { RUST_LOG = cfg.logLevel; RUST_LOG_FORMAT = cfg.logFormat; }; }; networking.firewall.allowedTCPPorts = [ 53 ]; networking.firewall.allowedUDPPorts = [ 53 ]; services.prometheus.scrapeConfigs = [ { job_name = "${config.networking.hostName}-resolved"; static_configs = [{ targets = [ cfg.metricsAddress ]; }]; } ]; services.grafana.provision.dashboards.settings.providers = [ { name = "DNS Resolver"; folder = "Services"; options.path = ./dashboard.json; } ]; }; } ================================================ FILE: shared/resolved/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.resolved = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [resolved](https://github.com/barrucadu/resolved) service. ''; }; address = mkOption { type = types.str; default = "0.0.0.0:53"; description = '' Address to listen on. ''; }; metricsAddress = mkOption { type = types.str; default = "127.0.0.1:9420"; description = '' Address to listen on to serve Prometheus metrics. ''; }; authoritativeOnly = mkOption { type = types.bool; default = false; description = '' Only answer queries for which this server is authoritative: do not perform recursive or forwarding resolution. ''; }; protocolMode = mkOption { type = types.str; default = "only-v4"; description = '' How to choose between connecting to upstream nameservers over IPv4 or IPv6 when acting as a recursive resolver. ''; }; forwardAddress = mkOption { type = types.nullOr types.str; default = null; description = '' Act as a forwarding resolver, not a recursive resolver: forward queries which can't be answered from local state to this nameserver and cache the result. ''; }; cacheSize = mkOption { type = types.int; default = 512; description = '' How many records to hold in the cache. ''; }; hostsDirs = mkOption { type = types.listOf types.str; default = [ ]; description = '' List of directories to read hosts files from. ''; }; zonesDirs = mkOption { type = types.listOf types.str; default = [ ]; description = '' List of directories to read zone files from. ''; }; useDefaultZones = mkOption { type = types.bool; default = true; description = '' Include the default zone files. ''; }; logLevel = mkOption { type = types.str; default = "dns_resolver=info,resolved=info"; description = '' Verbosity of the log messages. ''; }; logFormat = mkOption { type = types.str; default = "json,no-time"; description = '' Format of the log messages. ''; }; }; } ================================================ FILE: shared/restic-backups/default.nix ================================================ # Manage regular incremental, compressed, and encrypted backups with [restic][]. # # Backups are uploaded to the `barrucadu-backups-a19c48` [B2][] bucket. # # List all the snapshots with: # # ```bash # nix run .#backups # all snapshots # nix run .#backups -- snapshots --host # for a specific host # nix run .#backups -- snapshots --tag # for a specific tag # ``` # # Restore a snapshot to `` with: # # ```bash # nix run .#backups restore [] # ``` # # If unspecified, the snapshot is restored to `/tmp/restic-restore-`. # # **Alerts:** # # - Creating or uploading a snapshot fails. # # [restic]: https://restic.net/ # [B2]: https://www.backblaze.com/ { config, lib, pkgs, ... }: with lib; let repo = "b2:barrucadu-backups-a19c48:nixfiles/restic"; cfg = config.nixfiles.restic-backups; mkSudoRule = rule: { users = [ config.users.users.backups.name ]; runAs = rule.runAs; commands = [{ command = rule.command; options = [ "NOPASSWD" ]; }]; }; mkBackup = name: options: let serviceName = "restic-backups-${name}"; filesFrom = "/run/${serviceName}/includes"; in nameValuePair serviceName { inherit (options) startAt; environment = { RESTIC_CACHE_DIR = "%C/${serviceName}"; RESTIC_REPOSITORY = repo; }; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.restic}/bin/restic backup --tag ${name} --files-from=${filesFrom}"; User = config.users.users.backups.name; CacheDirectory = serviceName; CacheDirectoryMode = "0700"; RuntimeDirectory = "${serviceName} ${serviceName}/generated-files"; WorkingDirectory = "/run/${serviceName}/generated-files"; PrivateTmp = true; EnvironmentFile = cfg.environmentFile; AmbientCapabilities = "CAP_DAC_READ_SEARCH"; }; preStart = '' cat ${pkgs.writeText "paths" (concatStringsSep "\n" options.paths)} > ${filesFrom} ${optionalString (options.prepareCommand != null) options.prepareCommand} ''; postStop = '' if [[ "$SERVICE_RESULT" != "success" ]]; then ${pkgs.awscli}/bin/aws sns publish \ --topic-arn "arn:aws:sns:eu-west-1:197544591260:host-notifications" \ --subject "Alert: ${config.networking.hostName}" \ --message "${name} backup failed: ''${SERVICE_RESULT}" fi ${pkgs.coreutils}/bin/rm ${filesFrom} ${optionalString (options.cleanupCommand != null) options.cleanupCommand} ''; }; checkService = let serviceName = "restic-check"; in { environment = { RESTIC_CACHE_DIR = "%C/${serviceName}"; RESTIC_REPOSITORY = repo; }; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; startAt = cfg.checkRepositoryAt; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.restic}/bin/restic check"; User = config.users.users.backups.name; RuntimeDirectory = serviceName; CacheDirectory = serviceName; CacheDirectoryMode = "0700"; PrivateTmp = true; EnvironmentFile = cfg.environmentFile; }; postStop = '' if [[ "$SERVICE_RESULT" != "success" ]]; then ${pkgs.awscli}/bin/aws sns publish \ --topic-arn "arn:aws:sns:eu-west-1:197544591260:host-notifications" \ --subject "Alert: ${config.networking.hostName}" \ --message "restic-check service failed: ''${SERVICE_RESULT}" fi ''; }; in { imports = [ ./options.nix ]; config = mkIf cfg.enable { users.users.backups = { uid = 999; description = "backup service user"; isSystemUser = true; group = "nogroup"; }; security.sudo.extraRules = map mkSudoRule cfg.sudoRules; systemd.services = mapAttrs' mkBackup cfg.backups // (if cfg.checkRepositoryAt == null then { } else { "restic-check" = checkService; }); }; } ================================================ FILE: shared/restic-backups/options.nix ================================================ { lib, ... }: with lib; let backupOptions = { paths = mkOption { type = types.listOf types.str; default = [ ]; description = '' List of paths to back up. ''; }; prepareCommand = mkOption { type = types.nullOr types.str; default = null; description = '' A script to run before beginning the backup. ''; }; cleanupCommand = mkOption { type = types.nullOr types.str; default = null; description = '' A script to run after taking the backup. ''; }; startAt = mkOption { type = types.str; default = "Mon, 04:00"; description = '' When to run the backup. ''; }; }; sudoRuleOptions = { command = mkOption { type = types.str; description = '' The command for which the rule applies. ''; }; runAs = mkOption { type = types.str; default = "ALL:ALL"; description = '' The user / group under which the command is allowed to run. A user can be specified using just the username: `"foo"`. It is also possible to specify a user/group combination using `"foo:bar"` or to only allow running as a specific group with `":bar"`. ''; }; }; in { options.nixfiles.restic-backups = { enable = mkOption { type = types.bool; default = false; description = '' Enable the backup service. ''; }; backups = mkOption { type = types.attrsOf (types.submodule { options = backupOptions; }); default = { }; description = '' Attrset of backup job definitions. ''; }; environmentFile = mkOption { type = types.nullOr types.str; description = '' Environment file to pass secrets into the service. This is of the form: ```text # Repository password RESTIC_PASSWORD="..." # B2 credentials B2_ACCOUNT_ID="..." B2_ACCOUNT_KEY="..." # AWS SNS credentials AWS_ACCESS_KEY="..." AWS_SECRET_ACCESS_KEY="..." AWS_DEFAULT_REGION="..." ``` If any of the backup jobs need secrets, those should be specified in this file as well. ''; }; sudoRules = mkOption { type = types.listOf (types.submodule { options = sudoRuleOptions; }); default = [ ]; description = '' List of additional sudo rules to grant the backup user. ''; }; checkRepositoryAt = mkOption { type = types.nullOr types.str; default = null; description = '' If not null, when to run `restic check` to validate the repository metadata. ''; }; }; } ================================================ FILE: shared/torrents/default.nix ================================================ # [Transmission][] is a bittorrent client. This module configures it along with # a web UI. # # This module does not include a backup script. Torrented files must be backed # up independently. # # **Erase your darlings:** transparently stores session data on the persistent # volume. # # [Transmission]: https://transmissionbt.com/ { config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.torrents; in { imports = [ ./erase-your-darlings.nix ./options.nix ]; config = mkIf cfg.enable { services.transmission = { enable = true; user = cfg.user; group = cfg.group; home = "${cfg.stateDir}/transmission"; openPeerPorts = cfg.openFirewall; webHome = pkgs.flood-for-transmission; package = pkgs.callPackage ./transmission_3 { }; settings = { # paths download-dir = cfg.downloadDir; watch-dir = cfg.watchDir; watch-dir-enabled = true; incomplete-dir-enabled = false; # optimise for private trackers (disable DHT and PEX, force encryption) encryption = 2; dht-enabled = false; pex-enabled = false; # peers peer-port = cfg.peerPort; peer-port-random-on-start = false; # rpc rpc-bind-address = "127.0.0.1"; rpc-port = cfg.rpcPort; rpc-host-whitelist-enabled = false; # misc message-level = cfg.logLevel; rename-partial-files = false; trash-can-enabled = false; trash-original-torrent-files = false; }; }; }; } ================================================ FILE: shared/torrents/erase-your-darlings.nix ================================================ { config, lib, ... }: with lib; let cfg = config.nixfiles.torrents; eyd = config.nixfiles.eraseYourDarlings; in { config = mkIf (cfg.enable && eyd.enable) { nixfiles.torrents.stateDir = "${toString eyd.persistDir}/var/lib/torrents"; }; } ================================================ FILE: shared/torrents/options.nix ================================================ { lib, ... }: with lib; { options.nixfiles.torrents = { enable = mkOption { type = types.bool; default = false; description = '' Enable the [Transmission](https://transmissionbt.com/) service. ''; }; downloadDir = mkOption { type = types.str; example = "/mnt/nas/torrents/files"; description = '' Directory to download torrented files to. ''; }; stateDir = mkOption { type = types.str; example = "/var/lib/torrents"; description = '' Directory to store service state in. ''; }; watchDir = mkOption { type = types.str; example = "/mnt/nas/torrents/watch"; description = '' Directory to monitor for new .torrent files. ''; }; user = mkOption { type = types.str; description = '' The user to run Transmission as. ''; }; group = mkOption { type = types.str; description = '' The group to run Transmission as. ''; }; logLevel = mkOption { type = types.ints.between 0 6; default = 2; description = '' Verbosity of the log messages. ''; }; openFirewall = mkOption { type = types.bool; default = true; description = '' Allow connections from TCP and UDP ports `''${portRange.from}` to `''${portRange.to}`. ''; }; peerPort = mkOption { type = types.port; default = 50000; description = '' Port to accept peer connections on. ''; }; rpcPort = mkOption { type = types.port; default = 49528; description = '' Port to accept RPC connections on. Bound on 127.0.0.1. ''; }; }; } ================================================ FILE: shared/torrents/transmission_3/default.nix ================================================ { stdenv, lib, fetchFromGitHub, cmake, pkg-config, openssl, curl, libevent, inotify-tools, systemd, zlib, pcre, libb64, libutp, miniupnpc, dht, libnatpmp, libiconv, # Build options enableGTK3 ? false, gtk3, xorg, wrapGAppsHook3, enableQt ? false, qt5, nixosTests, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, enableDaemon ? true, enableCli ? true, installLib ? false, apparmorRulesFromClosure, }: stdenv.mkDerivation (finalAttrs: { pname = "transmission"; version = "3.00"; src = fetchFromGitHub { owner = "transmission"; repo = "transmission"; tag = finalAttrs.version; hash = "sha256-n4iEDt9AstDZPZXN47p13brNLbNWS3BTB+A4UuoEjzE="; fetchSubmodules = true; }; patches = [ # fix build with openssl 3.0 ./transmission-3.00-openssl-3.patch # fix build with miniupnpc 2.2.8 ./transmission-3.00-miniupnpc-2.2.8.patch ]; # Compatibility with CMake < 3.5 has been removed from CMake. postPatch = '' substituteInPlace \ CMakeLists.txt \ --replace-fail \ "cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)" \ "cmake_minimum_required(VERSION 3.5)" ''; outputs = [ "out" "apparmor" ]; cmakeFlags = let mkFlag = opt: if opt then "ON" else "OFF"; in [ "-DENABLE_MAC=OFF" # requires xcodebuild "-DENABLE_GTK=${mkFlag enableGTK3}" "-DENABLE_QT=${mkFlag enableQt}" "-DENABLE_DAEMON=${mkFlag enableDaemon}" "-DENABLE_CLI=${mkFlag enableCli}" "-DINSTALL_LIB=${mkFlag installLib}" ]; nativeBuildInputs = [ pkg-config cmake ] ++ lib.optionals enableGTK3 [ wrapGAppsHook3 ] ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ]; buildInputs = [ openssl curl libevent zlib pcre libb64 libutp miniupnpc dht libnatpmp ] ++ lib.optionals enableQt [ qt5.qttools qt5.qtbase ] ++ lib.optionals enableGTK3 [ gtk3 xorg.libpthreadstubs ] ++ lib.optionals enableSystemd [ systemd ] ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; postInstall = '' mkdir $apparmor cat >$apparmor/bin.transmission-daemon < $out/bin/transmission-daemon { include include include include "${ apparmorRulesFromClosure { name = "transmission-daemon"; } ( [ curl libevent openssl pcre zlib libnatpmp miniupnpc ] ++ lib.optionals enableSystemd [ systemd ] ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ] ) }" r @{PROC}/sys/kernel/random/uuid, r @{PROC}/sys/vm/overcommit_memory, r @{PROC}/@{pid}/environ, r @{PROC}/@{pid}/mounts, rwk /tmp/tr_session_id_*, r $out/share/transmission/web/**, include } EOF ''; env = { # Fix GCC 14 build NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; }; passthru.tests = { apparmor = nixosTests.transmission_3; # starts the service with apparmor enabled smoke-test = nixosTests.bittorrent; }; meta = { description = "Fast, easy and free BitTorrent client (deprecated version 3)"; mainProgram = if enableQt then "transmission-qt" else if enableGTK3 then "transmission-gtk" else "transmission-cli"; longDescription = '' Transmission is a BitTorrent client which features a simple interface on top of a cross-platform back-end. Feature spotlight: * Uses fewer resources than other clients * Native Mac, GTK and Qt GUI clients * Daemon ideal for servers, embedded systems, and headless use * All these can be remote controlled by Web and Terminal clients * Bluetack (PeerGuardian) blocklists with automatic updates * Full encryption, DHT, and PEX support ''; homepage = "http://www.transmissionbt.com/"; license = lib.licenses.gpl2Plus; # parts are under MIT platforms = lib.platforms.unix; }; }) ================================================ FILE: shared/torrents/transmission_3/transmission-3.00-miniupnpc-2.2.8.patch ================================================ diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c index c9e248a379...c7b2580bcb 100644 --- a/libtransmission/upnp.c +++ b/libtransmission/upnp.c @@ -194,8 +194,13 @@ errno = 0; +#if (MINIUPNPC_API_VERSION >= 18) if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr, + sizeof(handle->lanaddr), NULL, 0) == UPNP_IGD_VALID_CONNECTED) +#else + if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr)) == UPNP_IGD_VALID_CONNECTED) +#endif { tr_logAddNamedInfo(getKey(), _("Found Internet Gateway Device \"%s\""), handle->urls.controlURL); tr_logAddNamedInfo(getKey(), _("Local Address is \"%s\""), handle->lanaddr); ================================================ FILE: shared/torrents/transmission_3/transmission-3.00-openssl-3.patch ================================================ From 6ee128b95bacaff20746538dc97c2b8e2b9fcc29 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sun, 15 May 2022 10:54:38 -0400 Subject: [PATCH] openssl: load "legacy" provider for RC4 --- libtransmission/crypto-utils-openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c index 45fd71913..14d680654 100644 --- a/libtransmission/crypto-utils-openssl.c +++ b/libtransmission/crypto-utils-openssl.c @@ -20,6 +20,9 @@ #include #include #include +#if OPENSSL_VERSION_MAJOR >= 3 +#include +#endif #include "transmission.h" #include "crypto-utils.h" @@ -184,6 +187,10 @@ static void openssl_evp_cipher_context_free(EVP_CIPHER_CTX* handle) tr_rc4_ctx_t tr_rc4_new(void) { +#if OPENSSL_VERSION_MAJOR >= 3 + OSSL_PROVIDER_load(NULL, "default"); + OSSL_PROVIDER_load(NULL, "legacy"); +#endif EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new(); if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1))) -- 2.35.1 ================================================ FILE: tools/provision-machine.sh ================================================ #!/usr/bin/env bash set -e # see https://nixfiles.docs.barrucadu.dev/runbooks/set-up-a-new-host.html MODE="$1" DEVICE="$2" if ! [ "$(id -u)" -eq 0 ]; then echo "please run as root" exit 1 fi if ! command -v git &>/dev/null; then echo "git not found in the PATH" exit 1 fi if ! command -v nixos-generate-config &>/dev/null; then echo "nixos-generate-config not found in the PATH" exit 1 fi if ! [ -e "$DEVICE" ]; then echo "${DEVICE} not found" exit 1 fi # create partitions case "$MODE" in "gpt") parted "$DEVICE" -- mklabel gpt parted "$DEVICE" -- mkpart ESP fat32 1MB 512MB parted "$DEVICE" -- mkpart root 512MB 100% parted "$DEVICE" -- set 1 esp on ;; "msdos") parted "$DEVICE" -- mklabel msdos parted "$DEVICE" -- mkpart primary 1MB 512MB parted "$DEVICE" -- mkpart primary 512MB 100% parted "$DEVICE" -- set 1 boot on ;; *) echo "${MODE} should be gpt or msdos" exit 1 ;; esac BOOTDEV="${DEVICE}1" ROOTDEV="${DEVICE}2" # create /boot filesystem mkfs.fat -F 32 -n boot "$BOOTDEV" # create zfs datasets & snapshot for erase-your-darlings zpool create -o autotrim=on local "$ROOTDEV" zfs create -o mountpoint=legacy local/volatile zfs create -o mountpoint=legacy local/volatile/root zfs create -o mountpoint=legacy local/persistent zfs create -o mountpoint=legacy -o com.sun:auto-snapshot=true local/persistent/home zfs create -o mountpoint=legacy -o com.sun:auto-snapshot=true local/persistent/nix zfs create -o mountpoint=legacy -o com.sun:auto-snapshot=true local/persistent/persist zfs create -o mountpoint=legacy -o com.sun:auto-snapshot=true -o xattr=sa -o acltype=posix local/persistent/var-log zfs snapshot local/volatile/root@blank # mount filesystems mount -t zfs local/volatile/root /mnt mkdir /mnt/boot mkdir /mnt/home mkdir /mnt/nix mkdir /mnt/persist mkdir -p /mnt/var/log mount -t vfat "$BOOTDEV" /mnt/boot mount -t zfs local/persistent/home /mnt/home mount -t zfs local/persistent/nix /mnt/nix mount -t zfs local/persistent/persist /mnt/persist mount -t zfs local/persistent/var-log /mnt/var/log # generate config mkdir /mnt/persist/etc pushd /mnt/persist/etc git clone https://github.com/barrucadu/nixfiles.git nixos popd mkdir /mnt/persist/etc/nixos/hosts/new cat < /mnt/persist/etc/nixos/hosts/new/header.nix # This is {...}. # # It runs {...}. # # **Alerting:** disabled # # **Backups:** disabled # # **Public hostname:** n/a # # **Role:** server { config, lib, pkgs, ... }: with lib; { networking.hostId = "$(head -c 4 /dev/urandom | xxd -p)"; boot.supportedFilesystems = { zfs = true; }; ############################################################################### ## GENERATED CONFIG BELOW THIS LINE ############################################################################### EOF nixos-generate-config --root /mnt cat /mnt/persist/etc/nixos/hosts/new/header.nix /mnt/etc/nixos/configuration.nix > /mnt/persist/etc/nixos/hosts/new/configuration.nix rm /mnt/persist/etc/nixos/hosts/new/header.nix rm /mnt/etc/nixos/configuration.nix mv /mnt/etc/nixos/hardware-configuration.nix /mnt/persist/etc/nixos/hosts/new/hardware.nix rmdir /mnt/etc/nixos nano /mnt/persist/etc/nixos/hosts/new/configuration.nix nano /mnt/persist/etc/nixos/hosts/new/hardware.nix echo "" echo "1. rename /mnt/persist/etc/nixos/hosts/new for new hostname" echo "2. add to /mnt/persist/etc/nixos/flake.nix" echo "3. add to git" echo "4. run nixos-install --flake /mnt/persist/etc/nixos#hostname" echo "5. reboot"