Grafana dashboard: RARE/freeRouter - Links State IGP peers and  neighbor count
Description: Display a global IGP view and neighbor count metrics

`scope:global` to freeRouter node

freeRouter Prometheus configuration: (copy & paste in freeRouter CLI)
* Create hardware and software sensor
```
sensor lsigp4int
path lsigp4int/peer/peer
prefix freertr-lsigp4int
key name lsigp4int/peer
command sho ipv4 ospf 1 interface
prepend lsigp4_iface_
name 0 proto="ospf1",ifc=
replace \. _
column 1 name neighbors
.
exit

sensor lsigp4peer
path lsigp4peer/peer/peer
prefix freertr-lsigp4peer
key name lsigp4peer/peer
command sho ipv4 ospf 1 topology 0 | inc reach
prepend lsigp4_peers_
name 0 proto="ospf1",node=
replace \. _
column 2 name reachable
column 2 replace false 0
column 2 replace true 1
column 3 name neighbors
.
exit

sensor lsigp4perf
path lsigp4perf/peer/peer
prefix freertr-lsigp4perf
key name lsigp4perf/peer
command sho ipv4 ospf 1 spf 0 | inc reachable|fill|calc|run
prepend lsigp4_perf_
labels proto="ospf1"
skip 0
column 1 name val
.
exit

sensor lsigp6int
path lsigp6int/peer/peer
prefix freertr-lsigp6int
key name lsigp6int/peer
command sho ipv6 ospf 1 interface
prepend lsigp6_iface_
name 0 proto="ospf1",ifc=
replace \. _
column 1 name neighbors
.
exit

sensor lsigp6peer
path lsigp6peer/peer/peer
prefix freertr-lsigp6peer
key name lsigp6peer/peer
command sho ipv6 ospf 1 topology 0 | inc reach
prepend lsigp6_peers_
name 0 proto="ospf1",node=
replace \. _
replace \/ _
column 2 name reachable
column 2 replace false 0
column 2 replace true 1
column 3 name neighbors
.
exit

sensor lsigp6perf
path lsigp6perf/peer/peer
prefix freertr-lsigp6perf
key name lsigp6perf/peer
command sho ipv6 ospf 1 spf 0 | inc reachable|fill|calc|run
prepend lsigp6_perf_
labels proto="ospf1"
skip 0
column 1 name val
.
exit

```
* freeRtr server Prometheus agent configuration

```
server prometheus pr
 sensor lsigp4int
 sensor lsigp4peer
 sensor lsigp4perf
 sensor lsigp6int
 sensor lsigp6peer
 sensor lsigp6perf
 vrf <PROMETHEUS_VRF>
 exit
```
* Prometheus server configuration (sample config with 2 nodes)
```
global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 30s
alerting:
  alertmanagers:
  - static_configs:
    - targets: []
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: router
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - <prometheus_agent_ip_1>:9001
    labels:
      node_name: <prometheus_agent_1_node_name>
  - targets:
    - <prometheus_agent_ip_2>:9001
    labels:
      node_name: <prometheus_agent_2_node_name>
```


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.2.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Display a global IGP view and neighbor count metrics",
  "editable": true,
  "gnetId": 13146,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1662383646404,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 5,
      "maxPerRow": 2,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.2.0",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "repeat": "igp_peer",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "${igp_type}_peers_neighbors{node_name=\"$node_name\",proto=\"$protocol\",node=\"$igp_peer\"}",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "${igp_peer}",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:343",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:344",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "5s",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "[scope:global]"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values({__name__=~\"^lsigp.*\"},node_name)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "node_name",
        "options": [],
        "query": "label_values({__name__=~\"^lsigp.*\"},node_name)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "lsigp4",
          "value": "lsigp4"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "igp_type",
        "options": [
          {
            "selected": true,
            "text": "lsigp4",
            "value": "lsigp4"
          },
          {
            "selected": false,
            "text": "lsigp6",
            "value": "lsigp6"
          }
        ],
        "query": "lsigp4,lsigp6",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(${igp_type}_peers_neighbors{node_name=\"$node_name\"},proto)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "protocol",
        "options": [],
        "query": "label_values(${igp_type}_peers_neighbors{node_name=\"$node_name\"},proto)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(${igp_type}_peers_neighbors{node_name=\"$node_name\"},node)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "igp_peer",
        "options": [],
        "query": "label_values(${igp_type}_peers_neighbors{node_name=\"$node_name\"},node)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "RARE/freeRouter - Links State IGP peers and  neighbor count",
  "uid": "FODuEMcGk",
  "version": 7
}