Monitoring pkg-version(8) and pkg-audit(8) with prometheus

Use this script to pipe metrics into /var/tmp/node_exporter, ideally in a cronjob or similar:

#!/bin/sh

PKG_VERSION="$(pkg version $@)"

echo "# HELP pkgng_packages_errored Current number of packages for which pkg version was unable to compare the version number of the installed package with the corresponding entry in the index"
echo "# TYPE pkgng_packages_errored gauge"
echo "pkgng_packages_errored " $(echo "$PKG_VERSION" | grep -e '!$' | wc -l)

echo "# HELP pkgng_packages_newer Current number of packages that are newer than in the repository"
echo "# TYPE pkgng_packages_newer gauge"
echo "pkgng_packages_newer " $(echo "$PKG_VERSION" | grep -e '>$' | wc -l)

echo "# HELP pkgng_packages_not_in_index Current number of packages that are not in the index"
echo "# TYPE pkgng_packages_not_in_index gauge"
echo "pkgng_packages_not_in_index " $(echo "$PKG_VERSION" | grep -e '?$' | wc -l)

echo "# HELP pkgng_packages_out_of_date Current number of packages that are out of date"
echo "# TYPE pkgng_packages_out_of_date gauge"
echo "pkgng_packages_out_of_date " $(echo "$PKG_VERSION" | grep -e '<$' | wc -l)

echo "# HELP pkgng_packages_up_to_date Current number of packages that are up to date"
echo "# TYPE pkgng_packages_up_to_date gauge"
echo "pkgng_packages_up_to_date " $(echo "$PKG_VERSION" | grep -e '=$' | wc -l)

echo "# HELP pkgng_vulnerabilities Current number of vulnerable packages"
echo "# TYPE pkgng_vulnerabilities gauge"
echo "pkgng_vulnerabilities " $(pkg audit | tail -n1 | cut -d' ' -f1)

FBSD_VERSION_KERNEL="$(freebsd-version -k)"
FBSD_VERSION_USERSPACE="$(freebsd-version -u)"

echo "# HELP freebsd_version FreeBSD version"
echo "# TYPE freebsd_version gauge"
echo "freebsd_version{level=\"major\", item=\"kernel\"} $(echo $FBSD_VERSION_KERNEL | cut -d- -f1 | cut -d. -f1)"
echo "freebsd_version{level=\"major\", item=\"userspace\"} $(echo $FBSD_VERSION_USERSPACE | cut -d- -f1 | cut -d. -f1)"
echo "freebsd_version{level=\"minor\", item=\"kernel\"} $(echo $FBSD_VERSION_KERNEL | cut -d- -f1 | cut -d. -f2)"
echo "freebsd_version{level=\"minor\", item=\"userspace\"} $(echo $FBSD_VERSION_USERSPACE | cut -d- -f1 | cut -d. -f2)"
echo "freebsd_version{level=\"patch\", item=\"kernel\"} $(echo $FBSD_VERSION_KERNEL | cut -d- -f3 | tr -d p)"
echo "freebsd_version{level=\"patch\", item=\"userspace\"} $(echo $FBSD_VERSION_USERSPACE | cut -d- -f3 | tr -d p)"

To compare to a specific repository, pass -r <REPONAME> as a parameter to the script.

Then add the following dashboard to your Grafana

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.2"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1535109976023,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "panels": [],
      "repeat": "instance",
      "title": "$instance",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "description": "",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 0,
        "y": 1
      },
      "id": 7,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#bf1b00",
        "full": false,
        "lineColor": "#890f02",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_vulnerabilities{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "1,1",
      "title": "Vulnerable",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "up to date",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 2,
        "y": 1
      },
      "id": 2,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#7eb26d",
        "full": false,
        "lineColor": "#3f6833",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_packages_up_to_date{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "0,0",
      "title": "Up To Date",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "up to date",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 4,
        "y": 1
      },
      "id": 4,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#f29191",
        "full": false,
        "lineColor": "#890f02",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_packages_out_of_date{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "1,5",
      "title": "Out of Date",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "up to date",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 6,
        "y": 1
      },
      "id": 3,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_packages_newer{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "1,5",
      "title": "Newer than in repository",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "up to date",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 8,
        "y": 1
      },
      "id": 5,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#58140c",
        "full": false,
        "lineColor": "#f29191",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_packages_not_in_index{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "1,1",
      "title": "Not in Index",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "up to date",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 10,
        "y": 1
      },
      "id": 6,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#890f02",
        "full": false,
        "lineColor": "#58140c",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(pkgng_packages_errored{instance=~\"$instance\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "1,1",
      "title": "Errored",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 12,
        "y": 1
      },
      "id": 17,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"major\", instance=~\"$instance\", item=\"kernel\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Kernel Major",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 14,
        "y": 1
      },
      "id": 18,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"minor\", instance=~\"$instance\", item=\"kernel\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Kernel Minor",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 16,
        "y": 1
      },
      "id": 19,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"patch\", instance=~\"$instance\", item=\"kernel\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Kernel Patchlevel",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 18,
        "y": 1
      },
      "id": 20,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"major\", instance=~\"$instance\", item=\"userspace\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Userspace Major",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 20,
        "y": 1
      },
      "id": 21,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"minor\", instance=~\"$instance\", item=\"userspace\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Userspace Minor",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 22,
        "y": 1
      },
      "id": 22,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "200%",
      "prefix": "",
      "prefixFontSize": "200%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "#5195ce",
        "full": false,
        "lineColor": "#1f78c1",
        "show": true
      },
      "tableColumn": "__name__",
      "targets": [
        {
          "expr": "freebsd_version{level=\"patch\", instance=~\"$instance\", item=\"userspace\"}",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": "12,11",
      "title": "Userspace Patchlevel",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "",
          "value": ""
        },
        {
          "op": "=",
          "text": "",
          "value": ""
        }
      ],
      "valueName": "current"
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "FreeBSD"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": true,
        "label": "Instance",
        "multi": true,
        "name": "instance",
        "options": [],
        "query": "pkgng_packages_up_to_date{}",
        "refresh": 2,
        "regex": "/instance=\"(.+)\",/",
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "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": "",
  "title": "FreeBSD Updates",
  "uid": "Bqks_SFmz",
  "version": 6
}
Use whatever you may find here at your own risk. This is my personal collection of things I feel may be useful to others but there are no guarantees, no warranties nor any form of support. See the FAQ for details.