"rawSql":"select floor(extract(epoch from max(timestamp))) as time,\n count(*) as value, CASE WHEN mt_id = 2 THEN 'IPv6' ELSE 'IPv4' END as metric\nfrom v_ls_prefixes\nwhere local_node_hash_id = '$local_node_hash_id'\n and peer_hash_id = '$peer_hash'\ngroup by mt_id\n",
"refId":"A",
"select":[
[
{
"params":[
"value"
],
"type":"column"
}
]
],
"timeColumn":"time",
"where":[
{
"name":"$__timeFilter",
"params":[],
"type":"macro"
}
]
}
],
"title":"Prefixes Total by Type",
"type":"piechart"
},
{
"datasource":{
"type":"postgres",
"uid":"obmp_postgres"
},
"fieldConfig":{
"defaults":{
"color":{
"mode":"thresholds"
},
"custom":{
"align":"auto",
"displayMode":"auto",
"filterable":true,
"inspect":false
},
"decimals":0,
"displayName":"",
"mappings":[],
"thresholds":{
"mode":"absolute",
"steps":[
{
"color":"green",
"value":null
},
{
"color":"red",
"value":80
}
]
},
"unit":"none"
},
"overrides":[
{
"matcher":{
"id":"byName",
"options":"timestamp"
},
"properties":[
{
"id":"displayName",
"value":"Time"
},
{
"id":"unit",
"value":"time: YYYY-MM-DD HH:mm:ss.SSS"
},
{
"id":"custom.align"
}
]
},
{
"matcher":{
"id":"byName",
"options":"state"
},
"properties":[
{
"id":"custom.displayMode",
"value":"color-background-solid"
},
{
"id":"mappings",
"value":[
{
"options":{
"ACTIVE":{
"color":"semi-dark-green",
"index":0
},
"WITHDRAWN":{
"color":"semi-dark-red",
"index":1
}
},
"type":"value"
}
]
}
]
}
]
},
"gridPos":{
"h":22,
"w":23,
"x":0,
"y":7
},
"id":2,
"options":{
"footer":{
"fields":"",
"reducer":[
"sum"
],
"show":false
},
"showHeader":true
},
"pluginVersion":"8.5.4",
"targets":[
{
"datasource":{
"type":"postgres",
"uid":"obmp_postgres"
},
"format":"table",
"group":[],
"metricColumn":"none",
"rawQuery":true,
"rawSql":"SELECT state, mt_id, prefix, metric, protocol, timestamp\n FROM v_ls_prefixes\n WHERE local_node_hash_id = '$local_node_hash_id'\n AND peer_hash_id = '$peer_hash'",
"definition":"SELECT __text,__value FROM (\n select peername as __text, peer_hash_id as __value, count(*) as count\n from v_ls_nodes\n group by peername,peer_hash_id) d\nwhere count > 0",
"hide":0,
"includeAll":false,
"label":"BGP Peer",
"multi":false,
"name":"peer_hash",
"options":[],
"query":"SELECT __text,__value FROM (\n select peername as __text, peer_hash_id as __value, count(*) as count\n from v_ls_nodes\n group by peername,peer_hash_id) d\nwhere count > 0",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":1,
"tagValuesQuery":"",
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"current":{
"selected":false,
"text":"BLR03-WXBB-CRT01",
"value":"4275c83a-8d03-5361-d890-0b2bf4ad1b91"
},
"datasource":{
"type":"postgres",
"uid":"obmp_postgres"
},
"definition":"select name as __text, hash_id as __value from ls_nodes where peer_hash_id = '$peer_hash' AND not igp_router_id ~ '\\..[1-9A-F]00$'",
"hide":0,
"includeAll":false,
"label":"ISIS Node",
"multi":false,
"name":"local_node_hash_id",
"options":[],
"query":"select name as __text, hash_id as __value from ls_nodes where peer_hash_id = '$peer_hash' AND not igp_router_id ~ '\\..[1-9A-F]00$'",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":5,
"tagValuesQuery":"",
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"current":{
"selected":false,
"text":"BLR03-WXBB-CRT01",
"value":"BLR03-WXBB-CRT01"
},
"datasource":{
"type":"postgres",
"uid":"obmp_postgres"
},
"definition":"select name from ls_nodes where hash_id = '$local_node_hash_id' and peer_hash_id = '$peer_hash'",
"hide":2,
"includeAll":false,
"multi":false,
"name":"local_node_name",
"options":[],
"query":"select name from ls_nodes where hash_id = '$local_node_hash_id' and peer_hash_id = '$peer_hash'",