"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.",
"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.",
"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(string_to_array('${rr_loopbacks:csv}', ',')) THEN 'Route Reflector' ELSE 'Router' END AS detail__role,\n CASE WHEN host(MAX(vp.localbgpid)) = ANY(string_to_array('${rr_loopbacks:csv}', ',')) THEN 1 ELSE 0 END AS arc__rr,\n CASE WHEN host(MAX(vp.localbgpid)) = ANY(string_to_array('${rr_loopbacks:csv}', ',')) 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",
"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 DISTINCT\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 FROM v_peers vp\n JOIN rid rid2 ON rid2.bgpid = host(vp.peerbgpid)\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 MAX(kind) AS mainstat, MAX(kind) AS detail__session_type\nFROM sess GROUP BY a, b",
"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.",
"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))\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}