79 lines
5.9 KiB
JSON
Raw Permalink Normal View History

{
"annotations": {"list": [{"builtIn": 1,"datasource": {"type": "datasource","uid": "grafana"},"enable": true,"hide": true,"iconColor": "rgba(0, 211, 255, 1)","name": "Annotations & Alerts","type": "dashboard"}]},
"description": "BGP peering topology — every monitored router as a node, every BGP session as an edge. Route reflectors (set the RR Loopbacks variable) show a red ring. Sessions to non-monitored neighbours (e.g. the ExaBGP injector) are listed in the table below.",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [{"asDropdown": true,"icon": "external link","includeVars": true,"keepTime": true,"tags": ["obmp-nav"],"title": "OBMP Dashboards","type": "dashboards"}],
"liveNow": false,
"panels": [
{
"datasource": {"type": "postgres","uid": "obmp_postgres"},
"description": "Routers and their BGP sessions. Node ring: red = Route Reflector (per the RR Loopbacks variable), blue = standard router. Edge label shows iBGP vs eBGP.",
"fieldConfig": {
"defaults": {},
"overrides": [
{"matcher": {"id": "byName","options": "arc__rr"},"properties": [{"id": "color","value": {"fixedColor": "red","mode": "fixed"}},{"id": "displayName","value": "Route Reflector"}]},
{"matcher": {"id": "byName","options": "arc__std"},"properties": [{"id": "color","value": {"fixedColor": "blue","mode": "fixed"}},{"id": "displayName","value": "Router"}]}
]
},
"gridPos": {"h": 22,"w": 24,"x": 0,"y": 0},
"id": 1,
"options": {"nodes": {"mainStatUnit": "","secondaryStatUnit": ""}},
"targets": [
{
"datasource": {"type": "postgres","uid": "obmp_postgres"},
"format": "table",
"rawSql": "SELECT vp.router_hash_id::text AS id,\n MAX(vp.routername) AS title,\n 'AS ' || MAX(vp.localasn)::text AS mainstat,\n COUNT(DISTINCT vp.peerbgpid) FILTER (WHERE vp.peer_state = 'up')::text || ' peers up' AS secondarystat,\n host(MAX(vp.localbgpid)) AS detail__bgp_id,\n CASE WHEN host(MAX(vp.localbgpid)) = ANY(ARRAY[${rr_loopbacks:singlequote}]::text[]) THEN 'Route Reflector' ELSE 'Router' END AS detail__role,\n CASE WHEN host(MAX(vp.localbgpid)) = ANY(ARRAY[${rr_loopbacks:singlequote}]::text[]) THEN 1 ELSE 0 END AS arc__rr,\n CASE WHEN host(MAX(vp.localbgpid)) = ANY(ARRAY[${rr_loopbacks:singlequote}]::text[]) THEN 0 ELSE 1 END AS arc__std\nFROM v_peers vp\nWHERE vp.localbgpid IS NOT NULL\nGROUP BY vp.router_hash_id\nORDER BY title",
"refId": "nodes"
},
{
"datasource": {"type": "postgres","uid": "obmp_postgres"},
"format": "table",
"rawSql": "WITH rid AS (\n SELECT DISTINCT router_hash_id, host(localbgpid) AS bgpid\n FROM v_peers WHERE localbgpid IS NOT NULL\n),\nsess AS (\n SELECT\n LEAST(vp.router_hash_id, rid2.router_hash_id)::text AS a,\n GREATEST(vp.router_hash_id, rid2.router_hash_id)::text AS b,\n CASE WHEN vp.peerasn = vp.localasn THEN 'iBGP' ELSE 'eBGP' END AS kind,\n vp.peer_hash_id AS feed\n FROM v_peers vp\n JOIN rid rid2 ON rid2.bgpid = host(vp.peerbgpid) OR rid2.bgpid = host(vp.peerip)\n WHERE vp.peer_state = 'up' AND vp.router_hash_id <> rid2.router_hash_id\n)\nSELECT a || '-' || b AS id, a AS source, b AS target,\n COUNT(DISTINCT feed)::int AS mainstat,\n MAX(kind) AS secondarystat,\n MAX(kind) AS detail__session_type\nFROM sess GROUP BY a, b",
"refId": "edges"
}
],
"title": "BGP Peering Topology",
"type": "nodeGraph"
},
{
"datasource": {"type": "postgres","uid": "obmp_postgres"},
"description": "Up BGP sessions whose far end is not a monitored router (no node to draw an edge to) — e.g. eBGP sessions to the ExaBGP route injector or external peers.",
"fieldConfig": {
"defaults": {"custom": {"align": "auto","displayMode": "auto"}},
"overrides": [{"matcher": {"id": "byName","options": "Type"},"properties": [{"id": "custom.displayMode","value": "color-background"},{"id": "mappings","value": [{"options": {"eBGP": {"color": "orange","index": 0},"iBGP": {"color": "blue","index": 1}},"type": "value"}]}]}]
},
"gridPos": {"h": 8,"w": 24,"x": 0,"y": 22},
"id": 2,
"options": {"showHeader": true,"sortBy": [{"desc": false,"displayName": "Router"}]},
"targets": [
{
"datasource": {"type": "postgres","uid": "obmp_postgres"},
"format": "table",
"rawSql": "SELECT vp.routername AS \"Router\",\n host(vp.peerip) AS \"Peer\",\n vp.peerasn AS \"Peer AS\",\n CASE WHEN vp.peerasn = vp.localasn THEN 'iBGP' ELSE 'eBGP' END AS \"Type\",\n vp.peer_state AS \"State\"\nFROM v_peers vp\nWHERE vp.peer_state = 'up'\n AND NOT EXISTS (SELECT 1 FROM v_peers r WHERE host(r.localbgpid) = host(vp.peerbgpid) OR host(r.localbgpid) = host(vp.peerip))\nORDER BY vp.routername, vp.peerip",
"refId": "A"
}
],
"title": "Sessions to External / Non-Monitored Neighbours",
"type": "table"
}
],
"schemaVersion": 36,
"style": "dark",
"tags": ["obmp", "obmp-nav", "obmp-maps", "bgp"],
"templating": {
"list": [
{"name": "rr_loopbacks","type": "custom","label": "RR Loopbacks","description": "Loopback / BGP router-id addresses of your route reflectors. Edit this list for your environment.","query": "10.10.255.0,10.10.255.20,10.11.255.0,10.11.255.20","multi": true,"includeAll": true,"current": {"text": ["All"],"value": ["$__all"]},"options": [{"text": "All","value": "$__all","selected": true},{"text": "10.10.255.0","value": "10.10.255.0","selected": false},{"text": "10.10.255.20","value": "10.10.255.20","selected": false},{"text": "10.11.255.0","value": "10.11.255.0","selected": false},{"text": "10.11.255.20","value": "10.11.255.20","selected": false}],"hide": 0}
]
},
"time": {"from": "now-6h","to": "now"},
"timepicker": {},
"timezone": "",
"title": "BGP Peer Map",
"uid": "bgp-peer-map",
"version": 1,
"weekStart": ""
}