Grafana dashboard: Ping Network Uptime
Description: Ping tests Dashboard with Telegraf.

Get an overview of the network latency of your configured URLs/IP addresses. Using the latest Grafana time-series graph.

Collecting ping latency results via Telegraf (and influxdb). The dashboard plot the ping min, max and average latency values (ms) into a single timeseries graph. Together with the percentage package loss (%) on the right axis.

You will need to install Telegraf and InfluxDB, which is out of scope of this guide.

Once you have Telegraf up and running with InfluxDB, you need to edit the Telegraf configuration file: `/etc/telegraf/telegraf.conf`:


```conf
[[inputs.ping]]
# Override default interval for ping testing
   interval = "60s"

#   ## Hosts to send ping packets to. Google, Google DNS and OpenDNS
   urls = ["google.com", "8.8.8.8", "208.67.222.222"]

#   ## Number of ping packets to send per interval.  Corresponds to the "-c"
#   ## option of the ping command.
    count = 3

#   ## If set, the time to wait for a ping response in seconds.  Operates like
#   ## the "-W" option of the ping command.
    timeout = 2.0
```

{
  "__inputs": [
    {
      "name": "DS_TELEGRAFINFLUXDB",
      "label": "TelegrafInfluxDB",
      "description": "Telegraf",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.3"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:26",
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Ping tests Dashboard with Telegraf.\r\n\r\nGet an overview of the network latency of your configured URLs/IP addresses. Using the latest Grafana time-series graph.",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 15225,
  "graphTooltip": 2,
  "id": null,
  "iteration": 1636509620465,
  "links": [],
  "liveNow": true,
  "panels": [
    {
      "datasource": null,
      "description": "Ping test towards $Host",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "Latency (ms)",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 4,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": 600000,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "package_loss"
            },
            "properties": [
              {
                "id": "custom.axisLabel",
                "value": "Package loss (%)"
              },
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "0": {
                        "color": "transparent",
                        "index": 0
                      }
                    },
                    "type": "value"
                  },
                  {
                    "options": {
                      "from": 1,
                      "result": {
                        "color": "red",
                        "index": 1
                      },
                      "to": 100
                    },
                    "type": "range"
                  }
                ]
              },
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "id": 7,
      "maxPerRow": 3,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi"
        }
      },
      "repeat": "Host",
      "repeatDirection": "h",
      "targets": [
        {
          "alias": "max",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "Max",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "maximum_response_ms"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "max"
              }
            ]
          ],
          "tags": [
            {
              "key": "url",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        },
        {
          "alias": "min",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "Min",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "minimum_response_ms"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "min"
              }
            ]
          ],
          "tags": [
            {
              "key": "url",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        },
        {
          "alias": "avg",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "Avg",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "average_response_ms"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "url",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        },
        {
          "alias": "package_loss",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "ping",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "Package loss",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "percent_packet_loss"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "url",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        }
      ],
      "title": "Ping $Host",
      "transformations": [],
      "type": "timeseries"
    }
  ],
  "refresh": "1m",
  "schemaVersion": 31,
  "style": "dark",
  "tags": [
    "linux",
    "ping",
    "telegraf",
    "network",
    "uptime"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_TELEGRAFINFLUXDB}",
        "definition": "SHOW TAG VALUES WITH KEY = \"url\"",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Host",
        "options": [],
        "query": "SHOW TAG VALUES WITH KEY = \"url\"",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Ping Network Uptime",
  "uid": "DWyOTpfZ",
  "version": 14
}