├── .gitignore ├── dashboards └── postgres │ ├── General │ ├── Home.json │ ├── Inventory.json │ ├── Looking Glass.json │ └── ASN View.json │ ├── Prefix History │ ├── Prefix History (by ASN).json │ ├── Prefix History (by Router).json │ ├── Prefix History (by Peer).json │ └── Prefix History (by Prefix).json │ ├── Security │ ├── BGP Sec_ RPKI & IRR.json │ ├── BGP Sec_ Hijack_Leak.json │ └── BGP Sec_ Hijack_Leak (by AS Name).json │ └── Top N │ └── Top by Prefixes.json ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | *.log 4 | *.pyc 5 | *.tgz 6 | *.gz 7 | -------------------------------------------------------------------------------- /dashboards/postgres/General/Home.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [], 3 | "__requires": [ 4 | { 5 | "type": "panel", 6 | "id": "dashlist", 7 | "name": "Dashboard list", 8 | "version": "5.0.0" 9 | }, 10 | { 11 | "type": "grafana", 12 | "id": "grafana", 13 | "name": "Grafana", 14 | "version": "5.2.2" 15 | }, 16 | { 17 | "type": "panel", 18 | "id": "text", 19 | "name": "Text", 20 | "version": "5.0.0" 21 | } 22 | ], 23 | "annotations": { 24 | "list": [ 25 | { 26 | "builtIn": 1, 27 | "datasource": "-- Grafana --", 28 | "enable": true, 29 | "hide": true, 30 | "iconColor": "rgba(0, 211, 255, 1)", 31 | "name": "Annotations & Alerts", 32 | "type": "dashboard" 33 | } 34 | ] 35 | }, 36 | "editable": true, 37 | "gnetId": null, 38 | "graphTooltip": 0, 39 | "id": null, 40 | "links": [], 41 | "panels": [ 42 | { 43 | "content": "# OpenBMP Unicast (IPv4 & IPv6) Routing Analytics\n\n*Select a dashboard* to visualize internet routing data from RouteViews", 44 | "gridPos": { 45 | "h": 3, 46 | "w": 24, 47 | "x": 0, 48 | "y": 0 49 | }, 50 | "id": 6, 51 | "links": [], 52 | "mode": "markdown", 53 | "title": "", 54 | "type": "text" 55 | }, 56 | { 57 | "folderId": 0, 58 | "gridPos": { 59 | "h": 10, 60 | "w": 8, 61 | "x": 0, 62 | "y": 3 63 | }, 64 | "headings": true, 65 | "id": 2, 66 | "limit": 41, 67 | "links": [], 68 | "query": "", 69 | "recent": false, 70 | "search": true, 71 | "starred": false, 72 | "tags": [], 73 | "title": "General", 74 | "type": "dashlist" 75 | }, 76 | { 77 | "folderId": 31, 78 | "gridPos": { 79 | "h": 10, 80 | "w": 8, 81 | "x": 8, 82 | "y": 3 83 | }, 84 | "headings": true, 85 | "id": 3, 86 | "limit": 41, 87 | "links": [], 88 | "query": "", 89 | "recent": false, 90 | "search": true, 91 | "starred": false, 92 | "tags": [], 93 | "title": "Security", 94 | "type": "dashlist" 95 | }, 96 | { 97 | "folderId": 30, 98 | "gridPos": { 99 | "h": 10, 100 | "w": 8, 101 | "x": 16, 102 | "y": 3 103 | }, 104 | "headings": true, 105 | "id": 4, 106 | "limit": 41, 107 | "links": [], 108 | "query": "", 109 | "recent": false, 110 | "search": true, 111 | "starred": false, 112 | "tags": [], 113 | "title": "Prefix History", 114 | "type": "dashlist" 115 | } 116 | ], 117 | "schemaVersion": 16, 118 | "style": "dark", 119 | "tags": [], 120 | "templating": { 121 | "list": [] 122 | }, 123 | "time": { 124 | "from": "now-6h", 125 | "to": "now" 126 | }, 127 | "timepicker": { 128 | "refresh_intervals": [ 129 | "5s", 130 | "10s", 131 | "30s", 132 | "1m", 133 | "5m", 134 | "15m", 135 | "30m", 136 | "1h", 137 | "2h", 138 | "1d" 139 | ], 140 | "time_options": [ 141 | "5m", 142 | "15m", 143 | "1h", 144 | "6h", 145 | "12h", 146 | "24h", 147 | "2d", 148 | "7d", 149 | "30d" 150 | ] 151 | }, 152 | "timezone": "", 153 | "title": "Home", 154 | "uid": "SDsNb3Fiz", 155 | "version": 4 156 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OpenBMP Grafana Integration 2 | =========================== 3 | 4 | [![Join the chat at https://gitter.im/OpenBMP/obmp-grafana](https://badges.gitter.im/OpenBMP/obmp-grafana.svg)](https://gitter.im/OpenBMP/obmp-grafana?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | Grafana can be used with the OpenBMP backend to visualize BGP data and statistics. 7 | 8 | This repository contains various dashboards that can be used against the 9 | backends. 10 | 11 | > **Postgres** is the preferred database system at the moment. 12 | 13 | 14 | (1) Install Grafana 15 | ------------------- 16 | Below is how you can use Grafana via Docker. 17 | 18 | ### Install Docker 19 | 20 | Install [Docker CE](https://docs.docker.com/install/) per docker instructions. 21 | 22 | ### Run Grafana 23 | 24 | ```docker run``` only needs to be called when first creating the container and when 25 | upgrading the container. Below is an example of how to install/run the 26 | container. 27 | 28 | ``` 29 | docker run -d -p 3000:3000 \ 30 | -e "GF_SECURITY_ADMIN_PASSWORD=Snas123" \ 31 | --name grafana -h grafana \ 32 | grafana/grafana:latest 33 | ``` 34 | 35 | > ##### NOTE: 36 | > There are numerous environment variables you can set. See [Docker Grafana](http://docs.grafana.org/installation/docker/) 37 | > for more details. 38 | 39 | 40 | (2) Install Grafana Plugins 41 | ---------------------------- 42 | You will need various plugins. We recommend installing at least the following: 43 | 44 | - Bubble Chart 45 | - Pie Chart 46 | - Datatable Panel 47 | - Status Panel 48 | 49 | You can install these as follows: 50 | 51 | ``` 52 | docker exec -it grafana bash 53 | grafana-cli plugins install digrich-bubblechart-panel 54 | grafana-cli plugins install grafana-piechart-panel 55 | grafana-cli plugins install briangann-datatable-panel 56 | grafana-cli plugins install vonage-status-panel 57 | exit 58 | docker restart grafana 59 | ``` 60 | 61 | 62 | (3) Add PostgreSQL data source 63 | --------------------------------- 64 | Follow the data source [Postgres Install](http://docs.grafana.org/features/datasources/postgres/) 65 | instructions. 66 | 67 | > #### NOTE: 68 | > A default **user** has been created already, so you can use that. 69 | > 70 | > The credentials for the user are username: 'admin' and password: 'Snas123' 71 | 72 | > **IMPORTANT** 73 | > - By default SSL is enabled for Postgres, but it's using a self-signed cert. 74 | > - When adding the data source, set the SSL mode to "require" if using the default container. 75 | > - If you need to use your own certificate and key, add them to the /var/openbmp/config directory with the names postgres_cert.pem and postgres_cert.key 76 | 77 | - **username:** openbmp 78 | - **password:** openbmp 79 | - **database:** openbmp 80 | - **host:** If running on the same server, use the public IP or **docker0** 172.17.0.1:5432. 81 | **localhost** will not work. 82 | 83 | (4) Import Dashboards 84 | --------------------- 85 | 86 | Download the dashboards you want to import to grafana on your local machine. 87 | 88 | > #### NOTE: 89 | > You do not have to be on the same machine where Grafana is running. You can 90 | > import dashboards from your laptop/desktop via the browser. 91 | 92 | You can get them all using **git**: 93 | 94 | ``` 95 | git clone https://github.com/OpenBMP/obmp-grafana.git 96 | ``` 97 | 98 | Dashbaords will be under ```obmp-grafana/dashboards``` 99 | 100 | Now you can import them by following the [Grafana Import](http://docs.grafana.org/reference/export_import/#importing-a-dashboard) instructions. 101 | 102 | The **Home** dashboard will need to be updated based on your ```Folders```. 103 | -------------------------------------------------------------------------------- /dashboards/postgres/Prefix History/Prefix History (by ASN).json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | }, 11 | { 12 | "name": "VAR_ORIGIN_AS", 13 | "type": "constant", 14 | "label": "Origin ASN", 15 | "value": "16509", 16 | "description": "" 17 | } 18 | ], 19 | "__requires": [ 20 | { 21 | "type": "panel", 22 | "id": "briangann-datatable-panel", 23 | "name": "Datatable Panel", 24 | "version": "0.0.6" 25 | }, 26 | { 27 | "type": "grafana", 28 | "id": "grafana", 29 | "name": "Grafana", 30 | "version": "5.2.2" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "graph", 35 | "name": "Graph", 36 | "version": "5.0.0" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "postgres", 41 | "name": "PostgreSQL", 42 | "version": "5.0.0" 43 | } 44 | ], 45 | "annotations": { 46 | "list": [ 47 | { 48 | "builtIn": 1, 49 | "datasource": "-- Grafana --", 50 | "enable": true, 51 | "hide": true, 52 | "iconColor": "rgba(0, 211, 255, 1)", 53 | "name": "Annotations & Alerts", 54 | "type": "dashboard" 55 | } 56 | ] 57 | }, 58 | "editable": true, 59 | "gnetId": null, 60 | "graphTooltip": 0, 61 | "id": null, 62 | "iteration": 1534274133371, 63 | "links": [], 64 | "panels": [ 65 | { 66 | "aliasColors": {}, 67 | "bars": false, 68 | "dashLength": 10, 69 | "dashes": false, 70 | "datasource": "${DS_PSQL}", 71 | "decimals": 0, 72 | "fill": 1, 73 | "gridPos": { 74 | "h": 7, 75 | "w": 11, 76 | "x": 0, 77 | "y": 0 78 | }, 79 | "id": 1, 80 | "legend": { 81 | "alignAsTable": true, 82 | "avg": true, 83 | "current": false, 84 | "max": true, 85 | "min": false, 86 | "show": true, 87 | "sort": null, 88 | "sortDesc": null, 89 | "total": true, 90 | "values": true 91 | }, 92 | "lines": true, 93 | "linewidth": 1, 94 | "links": [], 95 | "nullPointMode": "null", 96 | "percentage": false, 97 | "pointradius": 5, 98 | "points": false, 99 | "renderer": "flot", 100 | "seriesOverrides": [], 101 | "spaceLength": 10, 102 | "stack": false, 103 | "steppedLine": false, 104 | "targets": [ 105 | { 106 | "alias": "", 107 | "format": "time_series", 108 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) as updates, sum(withdraws) as withdraws\nFROM stats_chg_byasn s\nWHERE $__timeFilter(interval_time)\n AND s.origin_as = [[origin_as]]\n\ngroup by interval_time\nORDER BY interval_time ASC\n", 109 | "refId": "A" 110 | } 111 | ], 112 | "thresholds": [], 113 | "timeFrom": null, 114 | "timeShift": null, 115 | "title": "Prefix Advertisements & Withdrawals", 116 | "tooltip": { 117 | "shared": true, 118 | "sort": 0, 119 | "value_type": "individual" 120 | }, 121 | "transparent": false, 122 | "type": "graph", 123 | "xaxis": { 124 | "buckets": null, 125 | "mode": "time", 126 | "name": null, 127 | "show": true, 128 | "values": [] 129 | }, 130 | "yaxes": [ 131 | { 132 | "format": "none", 133 | "label": null, 134 | "logBase": 1, 135 | "max": null, 136 | "min": null, 137 | "show": true 138 | }, 139 | { 140 | "format": "short", 141 | "label": null, 142 | "logBase": 1, 143 | "max": null, 144 | "min": null, 145 | "show": false 146 | } 147 | ], 148 | "yaxis": { 149 | "align": false, 150 | "alignLevel": null 151 | } 152 | }, 153 | { 154 | "aliasColors": {}, 155 | "bars": false, 156 | "dashLength": 10, 157 | "dashes": false, 158 | "datasource": "${DS_PSQL}", 159 | "decimals": 0, 160 | "fill": 1, 161 | "gridPos": { 162 | "h": 7, 163 | "w": 13, 164 | "x": 11, 165 | "y": 0 166 | }, 167 | "id": 2, 168 | "legend": { 169 | "alignAsTable": true, 170 | "avg": true, 171 | "current": false, 172 | "max": true, 173 | "min": false, 174 | "rightSide": true, 175 | "show": true, 176 | "sort": "total", 177 | "sortDesc": true, 178 | "total": true, 179 | "values": true 180 | }, 181 | "lines": true, 182 | "linewidth": 1, 183 | "links": [], 184 | "nullPointMode": "null", 185 | "percentage": false, 186 | "pointradius": 5, 187 | "points": false, 188 | "renderer": "flot", 189 | "seriesOverrides": [], 190 | "spaceLength": 10, 191 | "stack": false, 192 | "steppedLine": false, 193 | "targets": [ 194 | { 195 | "alias": "", 196 | "format": "time_series", 197 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) + sum(withdraws) as value,\n left(PeerName,32) as metric\nFROM stats_chg_byasn l\n JOIN v_peers p ON (l.peer_hash_id = p.peer_hash_id)\nWHERE $__timeFilter(interval_time)\n AND l.origin_as = [[origin_as]]\nGROUP BY l.interval_time,peername\nORDER BY interval_time ASC\n\n", 198 | "refId": "A" 199 | } 200 | ], 201 | "thresholds": [], 202 | "timeFrom": null, 203 | "timeShift": null, 204 | "title": "Changes by Peer", 205 | "tooltip": { 206 | "shared": true, 207 | "sort": 0, 208 | "value_type": "individual" 209 | }, 210 | "type": "graph", 211 | "xaxis": { 212 | "buckets": null, 213 | "mode": "time", 214 | "name": null, 215 | "show": true, 216 | "values": [] 217 | }, 218 | "yaxes": [ 219 | { 220 | "decimals": 0, 221 | "format": "none", 222 | "label": "", 223 | "logBase": 1, 224 | "max": null, 225 | "min": null, 226 | "show": true 227 | }, 228 | { 229 | "format": "short", 230 | "label": null, 231 | "logBase": 1, 232 | "max": null, 233 | "min": null, 234 | "show": false 235 | } 236 | ], 237 | "yaxis": { 238 | "align": false, 239 | "alignLevel": null 240 | } 241 | }, 242 | { 243 | "columns": [], 244 | "compactRowsEnabled": false, 245 | "datasource": "${DS_PSQL}", 246 | "datatablePagingType": "simple_numbers", 247 | "datatableTheme": "basic_theme", 248 | "emptyData": false, 249 | "fontSize": "100%", 250 | "gridPos": { 251 | "h": 20, 252 | "w": 24, 253 | "x": 0, 254 | "y": 7 255 | }, 256 | "hoverEnabled": true, 257 | "id": 3, 258 | "infoEnabled": true, 259 | "lengthChangeEnabled": false, 260 | "links": [], 261 | "orderColumnEnabled": true, 262 | "pagingTypes": [ 263 | { 264 | "text": "Page number buttons only", 265 | "value": "numbers" 266 | }, 267 | { 268 | "text": "'Previous' and 'Next' buttons only", 269 | "value": "simple" 270 | }, 271 | { 272 | "text": "'Previous' and 'Next' buttons, plus page numbers", 273 | "value": "simple_numbers" 274 | }, 275 | { 276 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 277 | "value": "full" 278 | }, 279 | { 280 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 281 | "value": "full_numbers" 282 | }, 283 | { 284 | "text": "'First' and 'Last' buttons, plus page numbers", 285 | "value": "first_last_numbers" 286 | } 287 | ], 288 | "panelHeight": 761, 289 | "rowNumbersEnabled": false, 290 | "rowsPerPage": 10, 291 | "scroll": true, 292 | "scrollHeight": "default", 293 | "searchEnabled": true, 294 | "showCellBorders": false, 295 | "showHeader": true, 296 | "showRowBorders": true, 297 | "sort": { 298 | "col": 0, 299 | "desc": true 300 | }, 301 | "stripedRowsEnabled": true, 302 | "styles": [ 303 | { 304 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 305 | "pattern": "Time", 306 | "type": "date" 307 | }, 308 | { 309 | "colorMode": null, 310 | "colors": [ 311 | "rgba(245, 54, 54, 0.9)", 312 | "rgba(237, 129, 40, 0.89)", 313 | "rgba(50, 172, 45, 0.97)" 314 | ], 315 | "decimals": 0, 316 | "pattern": "/.*/", 317 | "thresholds": [], 318 | "type": "string", 319 | "unit": "none" 320 | } 321 | ], 322 | "targets": [ 323 | { 324 | "alias": "", 325 | "format": "table", 326 | "hide": false, 327 | "rawSql": " select lastmodified,event,routername,peername,prefix,\n origin_as,as_path,communities \n from v_ip_routes_history \n where $__timeFilter(lastmodified)\n AND origin_as = [[origin_as]]\n \n order by lastmodified desc,id desc\n limit 1000;", 328 | "refId": "A" 329 | } 330 | ], 331 | "themeOptions": { 332 | "dark": "./css/datatable-dark.css", 333 | "light": "./css/datatable-light.css" 334 | }, 335 | "themes": [ 336 | { 337 | "disabled": false, 338 | "text": "Basic", 339 | "value": "basic_theme" 340 | }, 341 | { 342 | "disabled": true, 343 | "text": "Bootstrap", 344 | "value": "bootstrap_theme" 345 | }, 346 | { 347 | "disabled": true, 348 | "text": "Foundation", 349 | "value": "foundation_theme" 350 | }, 351 | { 352 | "disabled": true, 353 | "text": "ThemeRoller", 354 | "value": "themeroller_theme" 355 | } 356 | ], 357 | "title": "Prefix History", 358 | "transform": "table", 359 | "type": "briangann-datatable-panel" 360 | } 361 | ], 362 | "schemaVersion": 16, 363 | "style": "dark", 364 | "tags": [], 365 | "templating": { 366 | "list": [ 367 | { 368 | "current": { 369 | "value": "${VAR_ORIGIN_AS}", 370 | "text": "${VAR_ORIGIN_AS}" 371 | }, 372 | "hide": 0, 373 | "label": "Origin ASN", 374 | "name": "origin_as", 375 | "options": [ 376 | { 377 | "value": "${VAR_ORIGIN_AS}", 378 | "text": "${VAR_ORIGIN_AS}" 379 | } 380 | ], 381 | "query": "${VAR_ORIGIN_AS}", 382 | "type": "constant" 383 | } 384 | ] 385 | }, 386 | "time": { 387 | "from": "now-1h", 388 | "to": "now" 389 | }, 390 | "timepicker": { 391 | "refresh_intervals": [ 392 | "5s", 393 | "10s", 394 | "30s", 395 | "1m", 396 | "5m", 397 | "15m", 398 | "30m", 399 | "1h", 400 | "2h", 401 | "1d" 402 | ], 403 | "time_options": [ 404 | "5m", 405 | "15m", 406 | "1h", 407 | "6h", 408 | "12h", 409 | "24h", 410 | "2d", 411 | "7d", 412 | "30d" 413 | ] 414 | }, 415 | "timezone": "", 416 | "title": "Prefix History (by ASN)", 417 | "uid": "lfGwISKiz", 418 | "version": 4 419 | } -------------------------------------------------------------------------------- /dashboards/postgres/Prefix History/Prefix History (by Router).json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "briangann-datatable-panel", 16 | "name": "Datatable Panel", 17 | "version": "0.0.6" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "5.2.2" 24 | }, 25 | { 26 | "type": "panel", 27 | "id": "graph", 28 | "name": "Graph", 29 | "version": "5.0.0" 30 | }, 31 | { 32 | "type": "datasource", 33 | "id": "postgres", 34 | "name": "PostgreSQL", 35 | "version": "5.0.0" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [ 40 | { 41 | "builtIn": 1, 42 | "datasource": "-- Grafana --", 43 | "enable": true, 44 | "hide": true, 45 | "iconColor": "rgba(0, 211, 255, 1)", 46 | "name": "Annotations & Alerts", 47 | "type": "dashboard" 48 | } 49 | ] 50 | }, 51 | "editable": true, 52 | "gnetId": null, 53 | "graphTooltip": 0, 54 | "id": null, 55 | "iteration": 1534274161103, 56 | "links": [], 57 | "panels": [ 58 | { 59 | "aliasColors": {}, 60 | "bars": false, 61 | "dashLength": 10, 62 | "dashes": false, 63 | "datasource": "${DS_PSQL}", 64 | "decimals": 0, 65 | "fill": 1, 66 | "gridPos": { 67 | "h": 7, 68 | "w": 11, 69 | "x": 0, 70 | "y": 0 71 | }, 72 | "id": 1, 73 | "legend": { 74 | "alignAsTable": true, 75 | "avg": true, 76 | "current": false, 77 | "max": true, 78 | "min": false, 79 | "show": true, 80 | "sort": null, 81 | "sortDesc": null, 82 | "total": true, 83 | "values": true 84 | }, 85 | "lines": true, 86 | "linewidth": 1, 87 | "links": [], 88 | "nullPointMode": "null", 89 | "percentage": false, 90 | "pointradius": 5, 91 | "points": false, 92 | "renderer": "flot", 93 | "seriesOverrides": [], 94 | "spaceLength": 10, 95 | "stack": false, 96 | "steppedLine": false, 97 | "targets": [ 98 | { 99 | "alias": "", 100 | "format": "time_series", 101 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) as updates, sum(withdraws) as withdraws\nFROM stats_chg_bypeer s\nWHERE $__timeFilter(interval_time)\n AND s.peer_hash_id IN (SELECT peer_hash_id\n from v_peers\n where routername = '$router')\n\ngroup by interval_time\nORDER BY interval_time ASC\n", 102 | "refId": "A" 103 | } 104 | ], 105 | "thresholds": [], 106 | "timeFrom": null, 107 | "timeShift": null, 108 | "title": "Prefix Advertisements & Withdrawals", 109 | "tooltip": { 110 | "shared": true, 111 | "sort": 0, 112 | "value_type": "individual" 113 | }, 114 | "transparent": false, 115 | "type": "graph", 116 | "xaxis": { 117 | "buckets": null, 118 | "mode": "time", 119 | "name": null, 120 | "show": true, 121 | "values": [] 122 | }, 123 | "yaxes": [ 124 | { 125 | "format": "none", 126 | "label": null, 127 | "logBase": 1, 128 | "max": null, 129 | "min": null, 130 | "show": true 131 | }, 132 | { 133 | "format": "short", 134 | "label": null, 135 | "logBase": 1, 136 | "max": null, 137 | "min": null, 138 | "show": false 139 | } 140 | ], 141 | "yaxis": { 142 | "align": false, 143 | "alignLevel": null 144 | } 145 | }, 146 | { 147 | "aliasColors": {}, 148 | "bars": false, 149 | "dashLength": 10, 150 | "dashes": false, 151 | "datasource": "${DS_PSQL}", 152 | "decimals": 0, 153 | "fill": 1, 154 | "gridPos": { 155 | "h": 7, 156 | "w": 13, 157 | "x": 11, 158 | "y": 0 159 | }, 160 | "id": 2, 161 | "legend": { 162 | "alignAsTable": true, 163 | "avg": true, 164 | "current": false, 165 | "max": true, 166 | "min": false, 167 | "rightSide": true, 168 | "show": true, 169 | "sort": "max", 170 | "sortDesc": true, 171 | "total": true, 172 | "values": true 173 | }, 174 | "lines": true, 175 | "linewidth": 1, 176 | "links": [], 177 | "nullPointMode": "null", 178 | "percentage": false, 179 | "pointradius": 5, 180 | "points": false, 181 | "renderer": "flot", 182 | "seriesOverrides": [], 183 | "spaceLength": 10, 184 | "stack": false, 185 | "steppedLine": false, 186 | "targets": [ 187 | { 188 | "alias": "", 189 | "format": "time_series", 190 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) + sum(withdraws) as value,\n left(PeerName,32) as metric\nFROM stats_chg_bypeer l\n JOIN v_peers p ON (l.peer_hash_id = p.peer_hash_id)\nWHERE $__timeFilter(interval_time)\n AND p.routername = '$router'\nGROUP BY l.interval_time,peername\nORDER BY interval_time ASC\n\n", 191 | "refId": "A" 192 | } 193 | ], 194 | "thresholds": [], 195 | "timeFrom": null, 196 | "timeShift": null, 197 | "title": "Changes by Peer", 198 | "tooltip": { 199 | "shared": true, 200 | "sort": 0, 201 | "value_type": "individual" 202 | }, 203 | "type": "graph", 204 | "xaxis": { 205 | "buckets": null, 206 | "mode": "time", 207 | "name": null, 208 | "show": true, 209 | "values": [] 210 | }, 211 | "yaxes": [ 212 | { 213 | "decimals": 0, 214 | "format": "none", 215 | "label": "", 216 | "logBase": 1, 217 | "max": null, 218 | "min": null, 219 | "show": true 220 | }, 221 | { 222 | "format": "short", 223 | "label": null, 224 | "logBase": 1, 225 | "max": null, 226 | "min": null, 227 | "show": false 228 | } 229 | ], 230 | "yaxis": { 231 | "align": false, 232 | "alignLevel": null 233 | } 234 | }, 235 | { 236 | "columns": [], 237 | "compactRowsEnabled": false, 238 | "datasource": "${DS_PSQL}", 239 | "datatablePagingType": "simple_numbers", 240 | "datatableTheme": "basic_theme", 241 | "emptyData": false, 242 | "fontSize": "100%", 243 | "gridPos": { 244 | "h": 20, 245 | "w": 24, 246 | "x": 0, 247 | "y": 7 248 | }, 249 | "hoverEnabled": true, 250 | "id": 3, 251 | "infoEnabled": true, 252 | "lengthChangeEnabled": false, 253 | "links": [], 254 | "orderColumnEnabled": true, 255 | "pagingTypes": [ 256 | { 257 | "text": "Page number buttons only", 258 | "value": "numbers" 259 | }, 260 | { 261 | "text": "'Previous' and 'Next' buttons only", 262 | "value": "simple" 263 | }, 264 | { 265 | "text": "'Previous' and 'Next' buttons, plus page numbers", 266 | "value": "simple_numbers" 267 | }, 268 | { 269 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 270 | "value": "full" 271 | }, 272 | { 273 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 274 | "value": "full_numbers" 275 | }, 276 | { 277 | "text": "'First' and 'Last' buttons, plus page numbers", 278 | "value": "first_last_numbers" 279 | } 280 | ], 281 | "panelHeight": 761, 282 | "rowNumbersEnabled": false, 283 | "rowsPerPage": 10, 284 | "scroll": true, 285 | "scrollHeight": "default", 286 | "searchEnabled": true, 287 | "showCellBorders": false, 288 | "showHeader": true, 289 | "showRowBorders": true, 290 | "sort": { 291 | "col": 0, 292 | "desc": true 293 | }, 294 | "stripedRowsEnabled": true, 295 | "styles": [ 296 | { 297 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 298 | "pattern": "Time", 299 | "type": "date" 300 | }, 301 | { 302 | "colorMode": null, 303 | "colors": [ 304 | "rgba(245, 54, 54, 0.9)", 305 | "rgba(237, 129, 40, 0.89)", 306 | "rgba(50, 172, 45, 0.97)" 307 | ], 308 | "decimals": 0, 309 | "pattern": "/.*/", 310 | "thresholds": [], 311 | "type": "string", 312 | "unit": "none" 313 | } 314 | ], 315 | "targets": [ 316 | { 317 | "alias": "", 318 | "format": "table", 319 | "hide": false, 320 | "rawSql": " select lastmodified,event,peername,prefix,\n origin_as,as_path,communities \n from v_ip_routes_history \n where $__timeFilter(lastmodified)\n AND routername = '[[router]]'\n order by lastmodified desc,id desc\n limit 1000;", 321 | "refId": "A" 322 | } 323 | ], 324 | "themeOptions": { 325 | "dark": "./css/datatable-dark.css", 326 | "light": "./css/datatable-light.css" 327 | }, 328 | "themes": [ 329 | { 330 | "disabled": false, 331 | "text": "Basic", 332 | "value": "basic_theme" 333 | }, 334 | { 335 | "disabled": true, 336 | "text": "Bootstrap", 337 | "value": "bootstrap_theme" 338 | }, 339 | { 340 | "disabled": true, 341 | "text": "Foundation", 342 | "value": "foundation_theme" 343 | }, 344 | { 345 | "disabled": true, 346 | "text": "ThemeRoller", 347 | "value": "themeroller_theme" 348 | } 349 | ], 350 | "title": "Prefix History", 351 | "transform": "table", 352 | "type": "briangann-datatable-panel" 353 | } 354 | ], 355 | "schemaVersion": 16, 356 | "style": "dark", 357 | "tags": [], 358 | "templating": { 359 | "list": [ 360 | { 361 | "allValue": null, 362 | "current": {}, 363 | "datasource": "${DS_PSQL}", 364 | "hide": 0, 365 | "includeAll": false, 366 | "label": "Router", 367 | "multi": false, 368 | "name": "router", 369 | "options": [], 370 | "query": "select name from routers", 371 | "refresh": 1, 372 | "regex": "", 373 | "sort": 1, 374 | "tagValuesQuery": "", 375 | "tags": [], 376 | "tagsQuery": "", 377 | "type": "query", 378 | "useTags": false 379 | } 380 | ] 381 | }, 382 | "time": { 383 | "from": "now-1h", 384 | "to": "now" 385 | }, 386 | "timepicker": { 387 | "refresh_intervals": [ 388 | "5s", 389 | "10s", 390 | "30s", 391 | "1m", 392 | "5m", 393 | "15m", 394 | "30m", 395 | "1h", 396 | "2h", 397 | "1d" 398 | ], 399 | "time_options": [ 400 | "5m", 401 | "15m", 402 | "1h", 403 | "6h", 404 | "12h", 405 | "24h", 406 | "2d", 407 | "7d", 408 | "30d" 409 | ] 410 | }, 411 | "timezone": "", 412 | "title": "Prefix History (by Router)", 413 | "uid": "75_Cyedmk", 414 | "version": 5 415 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 1.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC 4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM 5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial code and documentation 12 | distributed under this Agreement, and 13 | b) in the case of each subsequent Contributor: 14 | i) changes to the Program, and 15 | ii) additions to the Program; 16 | 17 | where such changes and/or additions to the Program originate from and are 18 | distributed by that particular Contributor. A Contribution 'originates' 19 | from a Contributor if it was added to the Program by such Contributor 20 | itself or anyone acting on such Contributor's behalf. Contributions do not 21 | include additions to the Program which: (i) are separate modules of 22 | software distributed in conjunction with the Program under their own 23 | license agreement, and (ii) are not derivative works of the Program. 24 | 25 | "Contributor" means any person or entity that distributes the Program. 26 | 27 | "Licensed Patents" mean patent claims licensable by a Contributor which are 28 | necessarily infringed by the use or sale of its Contribution alone or when 29 | combined with the Program. 30 | 31 | "Program" means the Contributions distributed in accordance with this 32 | Agreement. 33 | 34 | "Recipient" means anyone who receives the Program under this Agreement, 35 | including all Contributors. 36 | 37 | 2. GRANT OF RIGHTS 38 | a) Subject to the terms of this Agreement, each Contributor hereby grants 39 | Recipient a non-exclusive, worldwide, royalty-free copyright license to 40 | reproduce, prepare derivative works of, publicly display, publicly 41 | perform, distribute and sublicense the Contribution of such Contributor, 42 | if any, and such derivative works, in source code and object code form. 43 | b) Subject to the terms of this Agreement, each Contributor hereby grants 44 | Recipient a non-exclusive, worldwide, royalty-free patent license under 45 | Licensed Patents to make, use, sell, offer to sell, import and otherwise 46 | transfer the Contribution of such Contributor, if any, in source code and 47 | object code form. This patent license shall apply to the combination of 48 | the Contribution and the Program if, at the time the Contribution is 49 | added by the Contributor, such addition of the Contribution causes such 50 | combination to be covered by the Licensed Patents. The patent license 51 | shall not apply to any other combinations which include the Contribution. 52 | No hardware per se is licensed hereunder. 53 | c) Recipient understands that although each Contributor grants the licenses 54 | to its Contributions set forth herein, no assurances are provided by any 55 | Contributor that the Program does not infringe the patent or other 56 | intellectual property rights of any other entity. Each Contributor 57 | disclaims any liability to Recipient for claims brought by any other 58 | entity based on infringement of intellectual property rights or 59 | otherwise. As a condition to exercising the rights and licenses granted 60 | hereunder, each Recipient hereby assumes sole responsibility to secure 61 | any other intellectual property rights needed, if any. For example, if a 62 | third party patent license is required to allow Recipient to distribute 63 | the Program, it is Recipient's responsibility to acquire that license 64 | before distributing the Program. 65 | d) Each Contributor represents that to its knowledge it has sufficient 66 | copyright rights in its Contribution, if any, to grant the copyright 67 | license set forth in this Agreement. 68 | 69 | 3. REQUIREMENTS 70 | 71 | A Contributor may choose to distribute the Program in object code form under 72 | its own license agreement, provided that: 73 | 74 | a) it complies with the terms and conditions of this Agreement; and 75 | b) its license agreement: 76 | i) effectively disclaims on behalf of all Contributors all warranties 77 | and conditions, express and implied, including warranties or 78 | conditions of title and non-infringement, and implied warranties or 79 | conditions of merchantability and fitness for a particular purpose; 80 | ii) effectively excludes on behalf of all Contributors all liability for 81 | damages, including direct, indirect, special, incidental and 82 | consequential damages, such as lost profits; 83 | iii) states that any provisions which differ from this Agreement are 84 | offered by that Contributor alone and not by any other party; and 85 | iv) states that source code for the Program is available from such 86 | Contributor, and informs licensees how to obtain it in a reasonable 87 | manner on or through a medium customarily used for software exchange. 88 | 89 | When the Program is made available in source code form: 90 | 91 | a) it must be made available under this Agreement; and 92 | b) a copy of this Agreement must be included with each copy of the Program. 93 | Contributors may not remove or alter any copyright notices contained 94 | within the Program. 95 | 96 | Each Contributor must identify itself as the originator of its Contribution, 97 | if 98 | any, in a manner that reasonably allows subsequent Recipients to identify the 99 | originator of the Contribution. 100 | 101 | 4. COMMERCIAL DISTRIBUTION 102 | 103 | Commercial distributors of software may accept certain responsibilities with 104 | respect to end users, business partners and the like. While this license is 105 | intended to facilitate the commercial use of the Program, the Contributor who 106 | includes the Program in a commercial product offering should do so in a manner 107 | which does not create potential liability for other Contributors. Therefore, 108 | if a Contributor includes the Program in a commercial product offering, such 109 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify 110 | every other Contributor ("Indemnified Contributor") against any losses, 111 | damages and costs (collectively "Losses") arising from claims, lawsuits and 112 | other legal actions brought by a third party against the Indemnified 113 | Contributor to the extent caused by the acts or omissions of such Commercial 114 | Contributor in connection with its distribution of the Program in a commercial 115 | product offering. The obligations in this section do not apply to any claims 116 | or Losses relating to any actual or alleged intellectual property 117 | infringement. In order to qualify, an Indemnified Contributor must: 118 | a) promptly notify the Commercial Contributor in writing of such claim, and 119 | b) allow the Commercial Contributor to control, and cooperate with the 120 | Commercial Contributor in, the defense and any related settlement 121 | negotiations. The Indemnified Contributor may participate in any such claim at 122 | its own expense. 123 | 124 | For example, a Contributor might include the Program in a commercial product 125 | offering, Product X. That Contributor is then a Commercial Contributor. If 126 | that Commercial Contributor then makes performance claims, or offers 127 | warranties related to Product X, those performance claims and warranties are 128 | such Commercial Contributor's responsibility alone. Under this section, the 129 | Commercial Contributor would have to defend claims against the other 130 | Contributors related to those performance claims and warranties, and if a 131 | court requires any other Contributor to pay any damages as a result, the 132 | Commercial Contributor must pay those damages. 133 | 134 | 5. NO WARRANTY 135 | 136 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN 137 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 138 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, 139 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each 140 | Recipient is solely responsible for determining the appropriateness of using 141 | and distributing the Program and assumes all risks associated with its 142 | exercise of rights under this Agreement , including but not limited to the 143 | risks and costs of program errors, compliance with applicable laws, damage to 144 | or loss of data, programs or equipment, and unavailability or interruption of 145 | operations. 146 | 147 | 6. DISCLAIMER OF LIABILITY 148 | 149 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY 150 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, 151 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION 152 | LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 153 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 154 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE 155 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY 156 | OF SUCH DAMAGES. 157 | 158 | 7. GENERAL 159 | 160 | If any provision of this Agreement is invalid or unenforceable under 161 | applicable law, it shall not affect the validity or enforceability of the 162 | remainder of the terms of this Agreement, and without further action by the 163 | parties hereto, such provision shall be reformed to the minimum extent 164 | necessary to make such provision valid and enforceable. 165 | 166 | If Recipient institutes patent litigation against any entity (including a 167 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself 168 | (excluding combinations of the Program with other software or hardware) 169 | infringes such Recipient's patent(s), then such Recipient's rights granted 170 | under Section 2(b) shall terminate as of the date such litigation is filed. 171 | 172 | All Recipient's rights under this Agreement shall terminate if it fails to 173 | comply with any of the material terms or conditions of this Agreement and does 174 | not cure such failure in a reasonable period of time after becoming aware of 175 | such noncompliance. If all Recipient's rights under this Agreement terminate, 176 | Recipient agrees to cease use and distribution of the Program as soon as 177 | reasonably practicable. However, Recipient's obligations under this Agreement 178 | and any licenses granted by Recipient relating to the Program shall continue 179 | and survive. 180 | 181 | Everyone is permitted to copy and distribute copies of this Agreement, but in 182 | order to avoid inconsistency the Agreement is copyrighted and may only be 183 | modified in the following manner. The Agreement Steward reserves the right to 184 | publish new versions (including revisions) of this Agreement from time to 185 | time. No one other than the Agreement Steward has the right to modify this 186 | Agreement. The Eclipse Foundation is the initial Agreement Steward. The 187 | Eclipse Foundation may assign the responsibility to serve as the Agreement 188 | Steward to a suitable separate entity. Each new version of the Agreement will 189 | be given a distinguishing version number. The Program (including 190 | Contributions) may always be distributed subject to the version of the 191 | Agreement under which it was received. In addition, after a new version of the 192 | Agreement is published, Contributor may elect to distribute the Program 193 | (including its Contributions) under the new version. Except as expressly 194 | stated in Sections 2(a) and 2(b) above, Recipient receives no rights or 195 | licenses to the intellectual property of any Contributor under this Agreement, 196 | whether expressly, by implication, estoppel or otherwise. All rights in the 197 | Program not expressly granted under this Agreement are reserved. 198 | 199 | This Agreement is governed by the laws of the State of New York and the 200 | intellectual property laws of the United States of America. No party to this 201 | Agreement will bring a legal action under this Agreement more than one year 202 | after the cause of action arose. Each party waives its rights to a jury trial in 203 | any resulting litigation. 204 | 205 | -------------------------------------------------------------------------------- /dashboards/postgres/Prefix History/Prefix History (by Peer).json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "briangann-datatable-panel", 16 | "name": "Datatable Panel", 17 | "version": "0.0.6" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "5.2.4" 24 | }, 25 | { 26 | "type": "panel", 27 | "id": "graph", 28 | "name": "Graph", 29 | "version": "5.0.0" 30 | }, 31 | { 32 | "type": "datasource", 33 | "id": "postgres", 34 | "name": "PostgreSQL", 35 | "version": "5.0.0" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [ 40 | { 41 | "builtIn": 1, 42 | "datasource": "-- Grafana --", 43 | "enable": true, 44 | "hide": true, 45 | "iconColor": "rgba(0, 211, 255, 1)", 46 | "name": "Annotations & Alerts", 47 | "type": "dashboard" 48 | } 49 | ] 50 | }, 51 | "editable": true, 52 | "gnetId": null, 53 | "graphTooltip": 0, 54 | "id": null, 55 | "iteration": 1539360007626, 56 | "links": [], 57 | "panels": [ 58 | { 59 | "aliasColors": {}, 60 | "bars": false, 61 | "dashLength": 10, 62 | "dashes": false, 63 | "datasource": "${DS_PSQL}", 64 | "decimals": 0, 65 | "fill": 1, 66 | "gridPos": { 67 | "h": 7, 68 | "w": 11, 69 | "x": 0, 70 | "y": 0 71 | }, 72 | "id": 1, 73 | "legend": { 74 | "alignAsTable": true, 75 | "avg": true, 76 | "current": false, 77 | "max": true, 78 | "min": false, 79 | "show": true, 80 | "sort": null, 81 | "sortDesc": null, 82 | "total": true, 83 | "values": true 84 | }, 85 | "lines": true, 86 | "linewidth": 1, 87 | "links": [], 88 | "nullPointMode": "null", 89 | "percentage": false, 90 | "pointradius": 5, 91 | "points": false, 92 | "renderer": "flot", 93 | "seriesOverrides": [], 94 | "spaceLength": 10, 95 | "stack": false, 96 | "steppedLine": false, 97 | "targets": [ 98 | { 99 | "alias": "", 100 | "format": "time_series", 101 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) as updates, sum(withdraws) as withdraws\nFROM stats_chg_bypeer s\nWHERE $__timeFilter(interval_time)\n AND s.peer_hash_id IN (SELECT peer_hash_id\n from v_peers\n where peername = '$peer_name')\n\ngroup by interval_time\nORDER BY interval_time ASC\n", 102 | "refId": "A" 103 | } 104 | ], 105 | "thresholds": [], 106 | "timeFrom": null, 107 | "timeShift": null, 108 | "title": "Prefix Advertisements & Withdrawals", 109 | "tooltip": { 110 | "shared": true, 111 | "sort": 0, 112 | "value_type": "individual" 113 | }, 114 | "transparent": false, 115 | "type": "graph", 116 | "xaxis": { 117 | "buckets": null, 118 | "mode": "time", 119 | "name": null, 120 | "show": true, 121 | "values": [] 122 | }, 123 | "yaxes": [ 124 | { 125 | "format": "none", 126 | "label": null, 127 | "logBase": 1, 128 | "max": null, 129 | "min": null, 130 | "show": true 131 | }, 132 | { 133 | "format": "short", 134 | "label": null, 135 | "logBase": 1, 136 | "max": null, 137 | "min": null, 138 | "show": false 139 | } 140 | ], 141 | "yaxis": { 142 | "align": false, 143 | "alignLevel": null 144 | } 145 | }, 146 | { 147 | "aliasColors": {}, 148 | "bars": false, 149 | "dashLength": 10, 150 | "dashes": false, 151 | "datasource": "${DS_PSQL}", 152 | "decimals": 0, 153 | "fill": 1, 154 | "gridPos": { 155 | "h": 7, 156 | "w": 13, 157 | "x": 11, 158 | "y": 0 159 | }, 160 | "id": 2, 161 | "legend": { 162 | "alignAsTable": true, 163 | "avg": true, 164 | "current": false, 165 | "max": true, 166 | "min": false, 167 | "rightSide": true, 168 | "show": true, 169 | "sort": "max", 170 | "sortDesc": true, 171 | "total": true, 172 | "values": true 173 | }, 174 | "lines": true, 175 | "linewidth": 1, 176 | "links": [], 177 | "nullPointMode": "null", 178 | "percentage": false, 179 | "pointradius": 5, 180 | "points": false, 181 | "renderer": "flot", 182 | "seriesOverrides": [], 183 | "spaceLength": 10, 184 | "stack": false, 185 | "steppedLine": false, 186 | "targets": [ 187 | { 188 | "alias": "", 189 | "format": "time_series", 190 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) + sum(withdraws) as value,\n left(PeerName,32) as metric\nFROM stats_chg_bypeer l\n JOIN v_peers p ON (l.peer_hash_id = p.peer_hash_id)\nWHERE $__timeFilter(interval_time)\n AND p.peername = '$peer_name'\nGROUP BY l.interval_time,peername\nORDER BY interval_time ASC\n\n", 191 | "refId": "A" 192 | } 193 | ], 194 | "thresholds": [], 195 | "timeFrom": null, 196 | "timeShift": null, 197 | "title": "Changes by Peer", 198 | "tooltip": { 199 | "shared": true, 200 | "sort": 0, 201 | "value_type": "individual" 202 | }, 203 | "type": "graph", 204 | "xaxis": { 205 | "buckets": null, 206 | "mode": "time", 207 | "name": null, 208 | "show": true, 209 | "values": [] 210 | }, 211 | "yaxes": [ 212 | { 213 | "decimals": 0, 214 | "format": "none", 215 | "label": "", 216 | "logBase": 1, 217 | "max": null, 218 | "min": null, 219 | "show": true 220 | }, 221 | { 222 | "format": "short", 223 | "label": null, 224 | "logBase": 1, 225 | "max": null, 226 | "min": null, 227 | "show": false 228 | } 229 | ], 230 | "yaxis": { 231 | "align": false, 232 | "alignLevel": null 233 | } 234 | }, 235 | { 236 | "columns": [], 237 | "compactRowsEnabled": false, 238 | "datasource": "${DS_PSQL}", 239 | "datatablePagingType": "simple_numbers", 240 | "datatableTheme": "basic_theme", 241 | "emptyData": true, 242 | "fontSize": "100%", 243 | "gridPos": { 244 | "h": 20, 245 | "w": 24, 246 | "x": 0, 247 | "y": 7 248 | }, 249 | "hoverEnabled": true, 250 | "id": 3, 251 | "infoEnabled": true, 252 | "lengthChangeEnabled": false, 253 | "links": [], 254 | "orderColumnEnabled": true, 255 | "pagingTypes": [ 256 | { 257 | "text": "Page number buttons only", 258 | "value": "numbers" 259 | }, 260 | { 261 | "text": "'Previous' and 'Next' buttons only", 262 | "value": "simple" 263 | }, 264 | { 265 | "text": "'Previous' and 'Next' buttons, plus page numbers", 266 | "value": "simple_numbers" 267 | }, 268 | { 269 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 270 | "value": "full" 271 | }, 272 | { 273 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 274 | "value": "full_numbers" 275 | }, 276 | { 277 | "text": "'First' and 'Last' buttons, plus page numbers", 278 | "value": "first_last_numbers" 279 | } 280 | ], 281 | "panelHeight": 761, 282 | "rowNumbersEnabled": false, 283 | "rowsPerPage": 10, 284 | "scroll": true, 285 | "scrollHeight": "default", 286 | "searchEnabled": true, 287 | "showCellBorders": false, 288 | "showHeader": true, 289 | "showRowBorders": true, 290 | "sort": { 291 | "col": 0, 292 | "desc": true 293 | }, 294 | "stripedRowsEnabled": true, 295 | "styles": [ 296 | { 297 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 298 | "pattern": "Time", 299 | "type": "date" 300 | }, 301 | { 302 | "colorMode": null, 303 | "colors": [ 304 | "rgba(245, 54, 54, 0.9)", 305 | "rgba(237, 129, 40, 0.89)", 306 | "rgba(50, 172, 45, 0.97)" 307 | ], 308 | "decimals": 0, 309 | "pattern": "/.*/", 310 | "thresholds": [], 311 | "type": "string", 312 | "unit": "none" 313 | } 314 | ], 315 | "targets": [ 316 | { 317 | "alias": "", 318 | "format": "table", 319 | "hide": false, 320 | "rawSql": " select lastmodified,event,routername,peername,prefix,\n origin_as,as_path,communities \n from v_ip_routes_history \n where $__timeFilter(lastmodified)\n AND peername = '$peer_name'\n order by lastmodified desc,id desc\n limit 1000;", 321 | "refId": "A" 322 | } 323 | ], 324 | "themeOptions": { 325 | "dark": "./css/datatable-dark.css", 326 | "light": "./css/datatable-light.css" 327 | }, 328 | "themes": [ 329 | { 330 | "disabled": false, 331 | "text": "Basic", 332 | "value": "basic_theme" 333 | }, 334 | { 335 | "disabled": true, 336 | "text": "Bootstrap", 337 | "value": "bootstrap_theme" 338 | }, 339 | { 340 | "disabled": true, 341 | "text": "Foundation", 342 | "value": "foundation_theme" 343 | }, 344 | { 345 | "disabled": true, 346 | "text": "ThemeRoller", 347 | "value": "themeroller_theme" 348 | } 349 | ], 350 | "title": "Prefix History", 351 | "transform": "table", 352 | "type": "briangann-datatable-panel" 353 | } 354 | ], 355 | "schemaVersion": 16, 356 | "style": "dark", 357 | "tags": [], 358 | "templating": { 359 | "list": [ 360 | { 361 | "allValue": null, 362 | "current": {}, 363 | "datasource": "${DS_PSQL}", 364 | "hide": 0, 365 | "includeAll": false, 366 | "label": "Router", 367 | "multi": false, 368 | "name": "router_name", 369 | "options": [], 370 | "query": "select distinct routername from v_peers", 371 | "refresh": 1, 372 | "regex": "", 373 | "sort": 0, 374 | "tagValuesQuery": "", 375 | "tags": [], 376 | "tagsQuery": "", 377 | "type": "query", 378 | "useTags": false 379 | }, 380 | { 381 | "allValue": null, 382 | "current": {}, 383 | "datasource": "${DS_PSQL}", 384 | "hide": 0, 385 | "includeAll": false, 386 | "label": "Peer", 387 | "multi": false, 388 | "name": "peer_name", 389 | "options": [], 390 | "query": "select peername from v_peers where routername = '[[router_name]]'", 391 | "refresh": 1, 392 | "regex": "", 393 | "sort": 1, 394 | "tagValuesQuery": "", 395 | "tags": [], 396 | "tagsQuery": "select concat(routername, ' ', peername) from v_peers", 397 | "type": "query", 398 | "useTags": false 399 | } 400 | ] 401 | }, 402 | "time": { 403 | "from": "now-1h", 404 | "to": "now" 405 | }, 406 | "timepicker": { 407 | "refresh_intervals": [ 408 | "5s", 409 | "10s", 410 | "30s", 411 | "1m", 412 | "5m", 413 | "15m", 414 | "30m", 415 | "1h", 416 | "2h", 417 | "1d" 418 | ], 419 | "time_options": [ 420 | "5m", 421 | "15m", 422 | "1h", 423 | "6h", 424 | "12h", 425 | "24h", 426 | "2d", 427 | "7d", 428 | "30d" 429 | ] 430 | }, 431 | "timezone": "", 432 | "title": "Prefix History (by Peer)", 433 | "uid": "T1BOSIKmk", 434 | "version": 2 435 | } -------------------------------------------------------------------------------- /dashboards/postgres/Prefix History/Prefix History (by Prefix).json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | }, 11 | { 12 | "name": "VAR_PREFIX", 13 | "type": "constant", 14 | "label": "Prefix", 15 | "value": "93.181.224.0/20", 16 | "description": "" 17 | } 18 | ], 19 | "__requires": [ 20 | { 21 | "type": "panel", 22 | "id": "briangann-datatable-panel", 23 | "name": "Datatable Panel", 24 | "version": "0.0.6" 25 | }, 26 | { 27 | "type": "grafana", 28 | "id": "grafana", 29 | "name": "Grafana", 30 | "version": "5.2.2" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "graph", 35 | "name": "Graph", 36 | "version": "5.0.0" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "postgres", 41 | "name": "PostgreSQL", 42 | "version": "5.0.0" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "text", 47 | "name": "Text", 48 | "version": "5.0.0" 49 | } 50 | ], 51 | "annotations": { 52 | "list": [ 53 | { 54 | "builtIn": 1, 55 | "datasource": "-- Grafana --", 56 | "enable": true, 57 | "hide": true, 58 | "iconColor": "rgba(0, 211, 255, 1)", 59 | "name": "Annotations & Alerts", 60 | "type": "dashboard" 61 | } 62 | ] 63 | }, 64 | "editable": true, 65 | "gnetId": null, 66 | "graphTooltip": 0, 67 | "id": null, 68 | "iteration": 1534274154692, 69 | "links": [], 70 | "panels": [ 71 | { 72 | "content": "> An empty list could mean that the prefix is new. New prefixes are in the active RIB but not the log/history table since it has no changing history. A prefix is in the log when it has history, such as advertisements verses withdraws and with attribute changes. ", 73 | "gridPos": { 74 | "h": 2, 75 | "w": 24, 76 | "x": 0, 77 | "y": 0 78 | }, 79 | "id": 5, 80 | "links": [], 81 | "mode": "markdown", 82 | "title": "", 83 | "type": "text" 84 | }, 85 | { 86 | "aliasColors": {}, 87 | "bars": false, 88 | "dashLength": 10, 89 | "dashes": false, 90 | "datasource": "${DS_PSQL}", 91 | "decimals": 0, 92 | "fill": 1, 93 | "gridPos": { 94 | "h": 7, 95 | "w": 11, 96 | "x": 0, 97 | "y": 2 98 | }, 99 | "id": 1, 100 | "legend": { 101 | "alignAsTable": true, 102 | "avg": true, 103 | "current": false, 104 | "max": true, 105 | "min": false, 106 | "show": true, 107 | "sort": null, 108 | "sortDesc": null, 109 | "total": true, 110 | "values": true 111 | }, 112 | "lines": true, 113 | "linewidth": 1, 114 | "links": [], 115 | "nullPointMode": "null", 116 | "percentage": false, 117 | "pointradius": 5, 118 | "points": false, 119 | "renderer": "flot", 120 | "seriesOverrides": [], 121 | "spaceLength": 10, 122 | "stack": false, 123 | "steppedLine": false, 124 | "targets": [ 125 | { 126 | "alias": "", 127 | "format": "time_series", 128 | "hide": false, 129 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) as updates, sum(withdraws) as withdraws\nFROM stats_chg_byprefix s\nWHERE $__timeFilter(interval_time)\n AND s.prefix = '[[prefix]]'\n\ngroup by interval_time\nORDER BY interval_time ASC\n", 130 | "refId": "A" 131 | } 132 | ], 133 | "thresholds": [], 134 | "timeFrom": null, 135 | "timeShift": null, 136 | "title": "Prefix Advertisements & Withdrawals", 137 | "tooltip": { 138 | "shared": true, 139 | "sort": 0, 140 | "value_type": "individual" 141 | }, 142 | "transparent": false, 143 | "type": "graph", 144 | "xaxis": { 145 | "buckets": null, 146 | "mode": "time", 147 | "name": null, 148 | "show": true, 149 | "values": [] 150 | }, 151 | "yaxes": [ 152 | { 153 | "format": "none", 154 | "label": null, 155 | "logBase": 1, 156 | "max": null, 157 | "min": null, 158 | "show": true 159 | }, 160 | { 161 | "format": "short", 162 | "label": null, 163 | "logBase": 1, 164 | "max": null, 165 | "min": null, 166 | "show": false 167 | } 168 | ], 169 | "yaxis": { 170 | "align": false, 171 | "alignLevel": null 172 | } 173 | }, 174 | { 175 | "aliasColors": {}, 176 | "bars": false, 177 | "dashLength": 10, 178 | "dashes": false, 179 | "datasource": "${DS_PSQL}", 180 | "decimals": 0, 181 | "fill": 1, 182 | "gridPos": { 183 | "h": 7, 184 | "w": 13, 185 | "x": 11, 186 | "y": 2 187 | }, 188 | "id": 2, 189 | "legend": { 190 | "alignAsTable": true, 191 | "avg": true, 192 | "current": false, 193 | "max": true, 194 | "min": false, 195 | "rightSide": true, 196 | "show": true, 197 | "sort": "total", 198 | "sortDesc": true, 199 | "total": true, 200 | "values": true 201 | }, 202 | "lines": true, 203 | "linewidth": 1, 204 | "links": [], 205 | "nullPointMode": "null", 206 | "percentage": false, 207 | "pointradius": 5, 208 | "points": false, 209 | "renderer": "flot", 210 | "seriesOverrides": [], 211 | "spaceLength": 10, 212 | "stack": false, 213 | "steppedLine": false, 214 | "targets": [ 215 | { 216 | "alias": "", 217 | "format": "time_series", 218 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) + sum(withdraws) as value,\n left(PeerName,32) as metric\nFROM stats_chg_byprefix s\n JOIN v_peers p ON (s.peer_hash_id = p.peer_hash_id)\nWHERE $__timeFilter(interval_time)\n AND s.prefix = '[[prefix]]'\nGROUP BY s.interval_time,peername\nORDER BY interval_time ASC\n\n", 219 | "refId": "A" 220 | } 221 | ], 222 | "thresholds": [], 223 | "timeFrom": null, 224 | "timeShift": null, 225 | "title": "Changes by Peer", 226 | "tooltip": { 227 | "shared": true, 228 | "sort": 0, 229 | "value_type": "individual" 230 | }, 231 | "type": "graph", 232 | "xaxis": { 233 | "buckets": null, 234 | "mode": "time", 235 | "name": null, 236 | "show": true, 237 | "values": [] 238 | }, 239 | "yaxes": [ 240 | { 241 | "decimals": 0, 242 | "format": "none", 243 | "label": "", 244 | "logBase": 1, 245 | "max": null, 246 | "min": null, 247 | "show": true 248 | }, 249 | { 250 | "format": "short", 251 | "label": null, 252 | "logBase": 1, 253 | "max": null, 254 | "min": null, 255 | "show": false 256 | } 257 | ], 258 | "yaxis": { 259 | "align": false, 260 | "alignLevel": null 261 | } 262 | }, 263 | { 264 | "columns": [], 265 | "compactRowsEnabled": false, 266 | "datasource": "${DS_PSQL}", 267 | "datatablePagingType": "simple_numbers", 268 | "datatableTheme": "basic_theme", 269 | "emptyData": true, 270 | "fontSize": "100%", 271 | "gridPos": { 272 | "h": 20, 273 | "w": 24, 274 | "x": 0, 275 | "y": 9 276 | }, 277 | "hoverEnabled": true, 278 | "id": 3, 279 | "infoEnabled": true, 280 | "lengthChangeEnabled": false, 281 | "links": [], 282 | "orderColumnEnabled": true, 283 | "pagingTypes": [ 284 | { 285 | "text": "Page number buttons only", 286 | "value": "numbers" 287 | }, 288 | { 289 | "text": "'Previous' and 'Next' buttons only", 290 | "value": "simple" 291 | }, 292 | { 293 | "text": "'Previous' and 'Next' buttons, plus page numbers", 294 | "value": "simple_numbers" 295 | }, 296 | { 297 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 298 | "value": "full" 299 | }, 300 | { 301 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 302 | "value": "full_numbers" 303 | }, 304 | { 305 | "text": "'First' and 'Last' buttons, plus page numbers", 306 | "value": "first_last_numbers" 307 | } 308 | ], 309 | "panelHeight": 761, 310 | "rowNumbersEnabled": false, 311 | "rowsPerPage": 10, 312 | "scroll": true, 313 | "scrollHeight": "default", 314 | "searchEnabled": true, 315 | "showCellBorders": false, 316 | "showHeader": true, 317 | "showRowBorders": true, 318 | "sort": { 319 | "col": 0, 320 | "desc": true 321 | }, 322 | "stripedRowsEnabled": true, 323 | "styles": [ 324 | { 325 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 326 | "pattern": "Time", 327 | "type": "date" 328 | }, 329 | { 330 | "colorMode": null, 331 | "colors": [ 332 | "rgba(245, 54, 54, 0.9)", 333 | "rgba(237, 129, 40, 0.89)", 334 | "rgba(50, 172, 45, 0.97)" 335 | ], 336 | "decimals": 0, 337 | "pattern": "/.*/", 338 | "thresholds": [], 339 | "type": "string", 340 | "unit": "none" 341 | } 342 | ], 343 | "targets": [ 344 | { 345 | "alias": "", 346 | "format": "table", 347 | "hide": false, 348 | "rawSql": " select lastmodified,event,routername,peername,prefix,\n origin_as,as_path,communities \n from v_ip_routes_history \n where $__timeFilter(lastmodified)\n AND prefix = '[[prefix]]'\n \n order by lastmodified desc,id desc\n limit 1000;", 349 | "refId": "A" 350 | } 351 | ], 352 | "themeOptions": { 353 | "dark": "./css/datatable-dark.css", 354 | "light": "./css/datatable-light.css" 355 | }, 356 | "themes": [ 357 | { 358 | "disabled": false, 359 | "text": "Basic", 360 | "value": "basic_theme" 361 | }, 362 | { 363 | "disabled": true, 364 | "text": "Bootstrap", 365 | "value": "bootstrap_theme" 366 | }, 367 | { 368 | "disabled": true, 369 | "text": "Foundation", 370 | "value": "foundation_theme" 371 | }, 372 | { 373 | "disabled": true, 374 | "text": "ThemeRoller", 375 | "value": "themeroller_theme" 376 | } 377 | ], 378 | "title": "Prefix History", 379 | "transform": "table", 380 | "type": "briangann-datatable-panel" 381 | } 382 | ], 383 | "schemaVersion": 16, 384 | "style": "dark", 385 | "tags": [], 386 | "templating": { 387 | "list": [ 388 | { 389 | "current": { 390 | "value": "${VAR_PREFIX}", 391 | "text": "${VAR_PREFIX}" 392 | }, 393 | "hide": 0, 394 | "label": "Prefix", 395 | "name": "prefix", 396 | "options": [ 397 | { 398 | "value": "${VAR_PREFIX}", 399 | "text": "${VAR_PREFIX}" 400 | } 401 | ], 402 | "query": "${VAR_PREFIX}", 403 | "type": "constant" 404 | } 405 | ] 406 | }, 407 | "time": { 408 | "from": "now-1h", 409 | "to": "now" 410 | }, 411 | "timepicker": { 412 | "refresh_intervals": [ 413 | "5s", 414 | "10s", 415 | "30s", 416 | "1m", 417 | "5m", 418 | "15m", 419 | "30m", 420 | "1h", 421 | "2h", 422 | "1d" 423 | ], 424 | "time_options": [ 425 | "5m", 426 | "15m", 427 | "1h", 428 | "6h", 429 | "12h", 430 | "24h", 431 | "2d", 432 | "7d", 433 | "30d" 434 | ] 435 | }, 436 | "timezone": "", 437 | "title": "Prefix History (by Prefix)", 438 | "uid": "vCRvHSFiz", 439 | "version": 6 440 | } -------------------------------------------------------------------------------- /dashboards/postgres/General/Inventory.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "briangann-datatable-panel", 16 | "name": "Datatable Panel", 17 | "version": "0.0.6" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "5.2.2" 24 | }, 25 | { 26 | "type": "panel", 27 | "id": "grafana-piechart-panel", 28 | "name": "Pie Chart", 29 | "version": "1.3.3" 30 | }, 31 | { 32 | "type": "datasource", 33 | "id": "postgres", 34 | "name": "PostgreSQL", 35 | "version": "5.0.0" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [ 40 | { 41 | "builtIn": 1, 42 | "datasource": "-- Grafana --", 43 | "enable": true, 44 | "hide": true, 45 | "iconColor": "rgba(0, 211, 255, 1)", 46 | "name": "Annotations & Alerts", 47 | "type": "dashboard" 48 | } 49 | ] 50 | }, 51 | "editable": true, 52 | "gnetId": null, 53 | "graphTooltip": 0, 54 | "id": null, 55 | "links": [], 56 | "panels": [ 57 | { 58 | "aliasColors": {}, 59 | "breakPoint": "50%", 60 | "cacheTimeout": null, 61 | "combine": { 62 | "label": "Others", 63 | "threshold": 0 64 | }, 65 | "datasource": "${DS_PSQL}", 66 | "fontSize": "80%", 67 | "format": "none", 68 | "gridPos": { 69 | "h": 11, 70 | "w": 4, 71 | "x": 0, 72 | "y": 0 73 | }, 74 | "id": 3, 75 | "interval": null, 76 | "legend": { 77 | "percentage": true, 78 | "show": true, 79 | "sortDesc": true, 80 | "values": true 81 | }, 82 | "legendType": "Under graph", 83 | "links": [], 84 | "maxDataPoints": 3, 85 | "nullPointMode": "connected", 86 | "pieType": "pie", 87 | "strokeWidth": 1, 88 | "targets": [ 89 | { 90 | "alias": "", 91 | "format": "time_series", 92 | "hide": false, 93 | "rawSql": "SELECT\n floor(extract(epoch from max(r.timestamp))) as time,\n count(distinct router_hash_id) as value,\n r.state as metric\nFROM routers r\n JOIN bgp_peers p on (r.hash_id = p.router_hash_id)\n group by r.state\n", 94 | "refId": "A" 95 | } 96 | ], 97 | "title": "Router Status", 98 | "type": "grafana-piechart-panel", 99 | "valueName": "current" 100 | }, 101 | { 102 | "columns": [], 103 | "compactRowsEnabled": false, 104 | "datasource": "${DS_PSQL}", 105 | "datatablePagingType": "simple_numbers", 106 | "datatableTheme": "basic_theme", 107 | "emptyData": false, 108 | "fontSize": "100%", 109 | "gridPos": { 110 | "h": 11, 111 | "w": 20, 112 | "x": 4, 113 | "y": 0 114 | }, 115 | "hoverEnabled": true, 116 | "id": 1, 117 | "infoEnabled": true, 118 | "lengthChangeEnabled": true, 119 | "links": [], 120 | "orderColumnEnabled": true, 121 | "pagingTypes": [ 122 | { 123 | "text": "Page number buttons only", 124 | "value": "numbers" 125 | }, 126 | { 127 | "text": "'Previous' and 'Next' buttons only", 128 | "value": "simple" 129 | }, 130 | { 131 | "text": "'Previous' and 'Next' buttons, plus page numbers", 132 | "value": "simple_numbers" 133 | }, 134 | { 135 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 136 | "value": "full" 137 | }, 138 | { 139 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 140 | "value": "full_numbers" 141 | }, 142 | { 143 | "text": "'First' and 'Last' buttons, plus page numbers", 144 | "value": "first_last_numbers" 145 | } 146 | ], 147 | "panelHeight": 401, 148 | "rowNumbersEnabled": false, 149 | "rowsPerPage": 5, 150 | "scroll": false, 151 | "scrollHeight": "default", 152 | "searchEnabled": true, 153 | "showCellBorders": false, 154 | "showHeader": true, 155 | "showRowBorders": true, 156 | "sort": { 157 | "col": 0, 158 | "desc": true 159 | }, 160 | "stripedRowsEnabled": true, 161 | "styles": [ 162 | { 163 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 164 | "pattern": "Time", 165 | "type": "date" 166 | }, 167 | { 168 | "colorMode": "row", 169 | "colors": [ 170 | "rgba(245, 54, 54, 0.9)", 171 | "rgba(231, 26, 26, 0.89)", 172 | "rgba(50, 172, 45, 0.7)" 173 | ], 174 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 175 | "decimals": 0, 176 | "link": false, 177 | "pattern": "statebool", 178 | "sanitize": false, 179 | "thresholds": [ 180 | "0", 181 | "1" 182 | ], 183 | "type": "number", 184 | "unit": "none" 185 | }, 186 | { 187 | "colorMode": null, 188 | "colors": [ 189 | "rgba(245, 54, 54, 0.9)", 190 | "rgba(237, 129, 40, 0.89)", 191 | "rgba(50, 172, 45, 0.97)" 192 | ], 193 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 194 | "decimals": 0, 195 | "pattern": "/.*/", 196 | "thresholds": [], 197 | "type": "string", 198 | "unit": "none" 199 | } 200 | ], 201 | "targets": [ 202 | { 203 | "alias": "", 204 | "format": "table", 205 | "hide": false, 206 | "rawSql": "select max(r.timestamp) as timestamp,r.name,max(ip_address) as ip_address,max(r.state) as state,\n count(*) as peers,max(description) as description, CASE WHEN max(r.state) = 'up' THEN 1 ELSE 0 END as stateBool\n from routers r\n JOIN bgp_peers p on (r.hash_id = p.router_hash_id)\n GROUP BY r.name;", 207 | "refId": "A" 208 | } 209 | ], 210 | "themeOptions": { 211 | "dark": "./css/datatable-dark.css", 212 | "light": "./css/datatable-light.css" 213 | }, 214 | "themes": [ 215 | { 216 | "disabled": false, 217 | "text": "Basic", 218 | "value": "basic_theme" 219 | }, 220 | { 221 | "disabled": true, 222 | "text": "Bootstrap", 223 | "value": "bootstrap_theme" 224 | }, 225 | { 226 | "disabled": true, 227 | "text": "Foundation", 228 | "value": "foundation_theme" 229 | }, 230 | { 231 | "disabled": true, 232 | "text": "ThemeRoller", 233 | "value": "themeroller_theme" 234 | } 235 | ], 236 | "title": "Routers", 237 | "transform": "table", 238 | "type": "briangann-datatable-panel" 239 | }, 240 | { 241 | "aliasColors": {}, 242 | "breakPoint": "50%", 243 | "cacheTimeout": null, 244 | "combine": { 245 | "label": "Others", 246 | "threshold": 0 247 | }, 248 | "datasource": "${DS_PSQL}", 249 | "fontSize": "80%", 250 | "format": "none", 251 | "gridPos": { 252 | "h": 7, 253 | "w": 4, 254 | "x": 0, 255 | "y": 11 256 | }, 257 | "id": 4, 258 | "interval": null, 259 | "legend": { 260 | "percentage": true, 261 | "show": true, 262 | "sortDesc": true, 263 | "values": true 264 | }, 265 | "legendType": "Under graph", 266 | "links": [], 267 | "maxDataPoints": 3, 268 | "nullPointMode": "connected", 269 | "pieType": "pie", 270 | "strokeWidth": 1, 271 | "targets": [ 272 | { 273 | "alias": "", 274 | "format": "time_series", 275 | "hide": false, 276 | "rawSql": "SELECT\n floor(extract(epoch from max(timestamp))) as time,\n count(*) as value,\n state as metric\nFROM bgp_peers\n group by metric", 277 | "refId": "A" 278 | } 279 | ], 280 | "title": "Peer Status", 281 | "type": "grafana-piechart-panel", 282 | "valueName": "current" 283 | }, 284 | { 285 | "columns": [], 286 | "compactRowsEnabled": false, 287 | "datasource": "${DS_PSQL}", 288 | "datatablePagingType": "simple_numbers", 289 | "datatableTheme": "basic_theme", 290 | "emptyData": false, 291 | "fontSize": "100%", 292 | "gridPos": { 293 | "h": 14, 294 | "w": 20, 295 | "x": 4, 296 | "y": 11 297 | }, 298 | "hoverEnabled": true, 299 | "id": 2, 300 | "infoEnabled": true, 301 | "lengthChangeEnabled": true, 302 | "links": [], 303 | "orderColumnEnabled": true, 304 | "pagingTypes": [ 305 | { 306 | "text": "Page number buttons only", 307 | "value": "numbers" 308 | }, 309 | { 310 | "text": "'Previous' and 'Next' buttons only", 311 | "value": "simple" 312 | }, 313 | { 314 | "text": "'Previous' and 'Next' buttons, plus page numbers", 315 | "value": "simple_numbers" 316 | }, 317 | { 318 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 319 | "value": "full" 320 | }, 321 | { 322 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 323 | "value": "full_numbers" 324 | }, 325 | { 326 | "text": "'First' and 'Last' buttons, plus page numbers", 327 | "value": "first_last_numbers" 328 | } 329 | ], 330 | "panelHeight": 521, 331 | "rowNumbersEnabled": false, 332 | "rowsPerPage": 5, 333 | "scroll": false, 334 | "scrollHeight": "default", 335 | "searchEnabled": true, 336 | "showCellBorders": false, 337 | "showHeader": true, 338 | "showRowBorders": true, 339 | "sort": { 340 | "col": 0, 341 | "desc": true 342 | }, 343 | "stripedRowsEnabled": true, 344 | "styles": [ 345 | { 346 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 347 | "pattern": "Time", 348 | "type": "date" 349 | }, 350 | { 351 | "colorMode": "row", 352 | "colors": [ 353 | "rgba(245, 170, 54, 0.9)", 354 | "rgba(235, 35, 2, 0.67)", 355 | "rgba(50, 172, 45, 0.72)" 356 | ], 357 | "decimals": 0, 358 | "pattern": "statebool", 359 | "thresholds": [ 360 | "0", 361 | "1" 362 | ], 363 | "type": "number", 364 | "unit": "none" 365 | }, 366 | { 367 | "colorMode": null, 368 | "colors": [ 369 | "rgba(245, 54, 54, 0.9)", 370 | "rgba(237, 129, 40, 0.89)", 371 | "rgba(50, 172, 45, 0.97)" 372 | ], 373 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 374 | "decimals": 0, 375 | "pattern": "/.*/", 376 | "thresholds": [], 377 | "type": "string", 378 | "unit": "none" 379 | } 380 | ], 381 | "targets": [ 382 | { 383 | "alias": "", 384 | "format": "table", 385 | "rawSql": " SELECT\n max(RouterName) as \"RouterName\",\n max(PeerName) as \"PeerName\",\n max(PeerIP) as \"PeerIP\",\n max(PeerASN) as \"PeerASN\",\n max(peer_state) as \"State\",\n max(LastModified) as \"LastModified\",\n max(v4_prefixes) as \"IPv4 Prefixes\",\n max(v6_prefixes) as \"IPv6 Prefixes\",\n CASE WHEN max(peer_state) = 'up' THEN 1 ELSE 0 END as stateBool\nFROM v_peers p\n LEFT JOIN stats_peer_rib s ON (p.peer_hash_id = s.peer_hash_id\n AND s.interval_time >= now() - interval '20 minutes')\nGROUP BY p.peer_hash_id;\n", 386 | "refId": "A" 387 | } 388 | ], 389 | "themeOptions": { 390 | "dark": "./css/datatable-dark.css", 391 | "light": "./css/datatable-light.css" 392 | }, 393 | "themes": [ 394 | { 395 | "disabled": false, 396 | "text": "Basic", 397 | "value": "basic_theme" 398 | }, 399 | { 400 | "disabled": true, 401 | "text": "Bootstrap", 402 | "value": "bootstrap_theme" 403 | }, 404 | { 405 | "disabled": true, 406 | "text": "Foundation", 407 | "value": "foundation_theme" 408 | }, 409 | { 410 | "disabled": true, 411 | "text": "ThemeRoller", 412 | "value": "themeroller_theme" 413 | } 414 | ], 415 | "title": "Peers", 416 | "transform": "table", 417 | "type": "briangann-datatable-panel" 418 | } 419 | ], 420 | "schemaVersion": 16, 421 | "style": "dark", 422 | "tags": [], 423 | "templating": { 424 | "list": [] 425 | }, 426 | "time": { 427 | "from": "now-1h", 428 | "to": "now" 429 | }, 430 | "timepicker": { 431 | "refresh_intervals": [ 432 | "5s", 433 | "10s", 434 | "30s", 435 | "1m", 436 | "5m", 437 | "15m", 438 | "30m", 439 | "1h", 440 | "2h", 441 | "1d" 442 | ], 443 | "time_options": [ 444 | "5m", 445 | "15m", 446 | "1h", 447 | "6h", 448 | "12h", 449 | "24h", 450 | "2d", 451 | "7d", 452 | "30d" 453 | ] 454 | }, 455 | "timezone": "utc", 456 | "title": "Inventory", 457 | "uid": "000000011", 458 | "version": 4 459 | } -------------------------------------------------------------------------------- /dashboards/postgres/General/Looking Glass.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | }, 11 | { 12 | "name": "VAR_PREFIX", 13 | "type": "constant", 14 | "label": "Prefix", 15 | "value": "93.181.224.0/20", 16 | "description": "" 17 | } 18 | ], 19 | "__requires": [ 20 | { 21 | "type": "panel", 22 | "id": "briangann-datatable-panel", 23 | "name": "Datatable Panel", 24 | "version": "0.0.6" 25 | }, 26 | { 27 | "type": "grafana", 28 | "id": "grafana", 29 | "name": "Grafana", 30 | "version": "5.2.2" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "grafana-piechart-panel", 35 | "name": "Pie Chart", 36 | "version": "1.3.3" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "postgres", 41 | "name": "PostgreSQL", 42 | "version": "5.0.0" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "table", 47 | "name": "Table", 48 | "version": "5.0.0" 49 | }, 50 | { 51 | "type": "panel", 52 | "id": "text", 53 | "name": "Text", 54 | "version": "5.0.0" 55 | } 56 | ], 57 | "annotations": { 58 | "list": [ 59 | { 60 | "builtIn": 1, 61 | "datasource": "-- Grafana --", 62 | "enable": true, 63 | "hide": true, 64 | "iconColor": "rgba(0, 211, 255, 1)", 65 | "name": "Annotations & Alerts", 66 | "type": "dashboard" 67 | } 68 | ] 69 | }, 70 | "editable": true, 71 | "gnetId": null, 72 | "graphTooltip": 0, 73 | "id": null, 74 | "iteration": 1534274083214, 75 | "links": [], 76 | "panels": [ 77 | { 78 | "content": "# Looking Glass\n\n> Enter an IP address with or without bit length. The longest matched prefix will be used. Specify the length to find exact match or best aggregate.", 79 | "gridPos": { 80 | "h": 3, 81 | "w": 24, 82 | "x": 0, 83 | "y": 0 84 | }, 85 | "id": 15, 86 | "links": [], 87 | "mode": "markdown", 88 | "title": "", 89 | "type": "text" 90 | }, 91 | { 92 | "aliasColors": {}, 93 | "breakPoint": "50%", 94 | "cacheTimeout": null, 95 | "combine": { 96 | "label": "Others", 97 | "threshold": 0 98 | }, 99 | "datasource": "${DS_PSQL}", 100 | "description": "Prefix found in router's RIB.", 101 | "fontSize": "80%", 102 | "format": "none", 103 | "gridPos": { 104 | "h": 6, 105 | "w": 12, 106 | "x": 0, 107 | "y": 3 108 | }, 109 | "id": 9, 110 | "interval": null, 111 | "legend": { 112 | "percentage": true, 113 | "show": true, 114 | "values": true 115 | }, 116 | "legendType": "Right side", 117 | "links": [], 118 | "maxDataPoints": 3, 119 | "nullPointMode": "connected", 120 | "pieType": "pie", 121 | "strokeWidth": 1, 122 | "targets": [ 123 | { 124 | "alias": "", 125 | "format": "time_series", 126 | "hide": false, 127 | "rawSql": "SELECT\n floor(extract(epoch from max(r.timestamp))) as time,\n CASE WHEN v.router_hash_id is null THEN 'Not in Router RIB' ELSE 'In Router Rib' END as metric,\n 1 as value\nFROM routers r\n left join (select distinct router_hash_id\n from v_ip_routes \n where prefix = (select prefix from ip_rib where prefix >>= '[[prefix]]' order by prefix_len desc limit 1)\n and iswithdrawn = false group by router_hash_id) v \n on (r.hash_id = v.router_hash_id)\nWHERE r.state = 'up'\nGROUP BY r.hash_id,v.router_hash_id\n\n", 128 | "refId": "A" 129 | } 130 | ], 131 | "title": "Router Visibility", 132 | "type": "grafana-piechart-panel", 133 | "valueName": "total" 134 | }, 135 | { 136 | "aliasColors": {}, 137 | "breakPoint": "50%", 138 | "cacheTimeout": null, 139 | "combine": { 140 | "label": "Others", 141 | "threshold": 0 142 | }, 143 | "datasource": "${DS_PSQL}", 144 | "description": "Prefix found in peer RIB's", 145 | "fontSize": "80%", 146 | "format": "none", 147 | "gridPos": { 148 | "h": 6, 149 | "w": 12, 150 | "x": 12, 151 | "y": 3 152 | }, 153 | "id": 10, 154 | "interval": null, 155 | "legend": { 156 | "percentage": true, 157 | "show": true, 158 | "values": true 159 | }, 160 | "legendType": "Right side", 161 | "links": [], 162 | "maxDataPoints": 3, 163 | "nullPointMode": "connected", 164 | "pieType": "pie", 165 | "strokeWidth": 1, 166 | "targets": [ 167 | { 168 | "alias": "", 169 | "format": "time_series", 170 | "hide": false, 171 | "rawSql": "SELECT\n floor(extract(epoch from max(p.timestamp))) as time,\n CASE WHEN v.peer_hash_id is null THEN 'Not in Peers RIB' ELSE 'In Peer RIB' END as metric,\n 1 as value\nFROM bgp_peers p\n left join (select peer_hash_id,isipv4\n from v_ip_routes \n where prefix = (select prefix from ip_rib where prefix >>= '[[prefix]]' order by prefix_len desc limit 1)\n and iswithdrawn = false group by peer_hash_id,isipv4) v \n on (p.hash_id = v.peer_hash_id)\nWHERE p.isipv4 = CASE WHEN family('[[prefix]]') = 4 THEN true ELSE false END\n AND p.state = 'up'\nGROUP BY p.hash_id,v.peer_hash_id,p.isipv4\n\n", 172 | "refId": "A" 173 | } 174 | ], 175 | "title": "Peer Visibility", 176 | "type": "grafana-piechart-panel", 177 | "valueName": "total" 178 | }, 179 | { 180 | "columns": [], 181 | "datasource": "${DS_PSQL}", 182 | "fontSize": "100%", 183 | "gridPos": { 184 | "h": 6, 185 | "w": 24, 186 | "x": 0, 187 | "y": 9 188 | }, 189 | "id": 12, 190 | "links": [], 191 | "pageSize": null, 192 | "scroll": true, 193 | "showHeader": true, 194 | "sort": { 195 | "col": 0, 196 | "desc": true 197 | }, 198 | "styles": [ 199 | { 200 | "alias": "Time", 201 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 202 | "pattern": "Time", 203 | "type": "date" 204 | }, 205 | { 206 | "alias": "", 207 | "colorMode": null, 208 | "colors": [ 209 | "rgba(245, 54, 54, 0.9)", 210 | "rgba(237, 129, 40, 0.89)", 211 | "rgba(50, 172, 45, 0.97)" 212 | ], 213 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 214 | "decimals": 2, 215 | "mappingType": 1, 216 | "pattern": "raw_output", 217 | "preserveFormat": true, 218 | "sanitize": false, 219 | "thresholds": [], 220 | "type": "string", 221 | "unit": "short" 222 | }, 223 | { 224 | "alias": "", 225 | "colorMode": null, 226 | "colors": [ 227 | "rgba(245, 54, 54, 0.9)", 228 | "rgba(237, 129, 40, 0.89)", 229 | "rgba(50, 172, 45, 0.97)" 230 | ], 231 | "decimals": 2, 232 | "pattern": "/.*/", 233 | "thresholds": [], 234 | "type": "string", 235 | "unit": "short" 236 | } 237 | ], 238 | "targets": [ 239 | { 240 | "alias": "", 241 | "format": "table", 242 | "rawSql": "select distinct origin_as,i.as_name,org_id,org_name,remarks,address,city,state_prov,country,raw_output,source\n from ip_rib r LEFT JOIN info_asn i ON (i.asn = r.origin_as)\n where r.prefix = (select prefix from ip_rib where prefix >>= '[[prefix]]' order by prefix desc limit 1) \n and origin_as > 0\n", 243 | "refId": "A" 244 | } 245 | ], 246 | "title": "ASN Info", 247 | "transform": "table", 248 | "type": "table" 249 | }, 250 | { 251 | "columns": [], 252 | "datasource": "${DS_PSQL}", 253 | "fontSize": "100%", 254 | "gridPos": { 255 | "h": 4, 256 | "w": 24, 257 | "x": 0, 258 | "y": 15 259 | }, 260 | "id": 13, 261 | "links": [], 262 | "pageSize": null, 263 | "scroll": true, 264 | "showHeader": true, 265 | "sort": { 266 | "col": 0, 267 | "desc": true 268 | }, 269 | "styles": [ 270 | { 271 | "alias": "Time", 272 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 273 | "pattern": "Time", 274 | "type": "date" 275 | }, 276 | { 277 | "alias": "", 278 | "colorMode": "cell", 279 | "colors": [ 280 | "#cca300", 281 | "#e24d42", 282 | "#9ac48a" 283 | ], 284 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 285 | "decimals": 0, 286 | "mappingType": 1, 287 | "pattern": "irr_origin_as", 288 | "thresholds": [ 289 | "0", 290 | "1" 291 | ], 292 | "type": "number", 293 | "unit": "none" 294 | }, 295 | { 296 | "alias": "", 297 | "colorMode": "cell", 298 | "colors": [ 299 | "#cca300", 300 | "#e24d42", 301 | "#9ac48a" 302 | ], 303 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 304 | "decimals": 0, 305 | "mappingType": 1, 306 | "pattern": "rpki_origin_as", 307 | "thresholds": [ 308 | "0", 309 | "1" 310 | ], 311 | "type": "number", 312 | "unit": "none" 313 | }, 314 | { 315 | "alias": "", 316 | "colorMode": null, 317 | "colors": [ 318 | "rgba(245, 54, 54, 0.9)", 319 | "rgba(237, 129, 40, 0.89)", 320 | "rgba(50, 172, 45, 0.97)" 321 | ], 322 | "decimals": 2, 323 | "pattern": "/.*/", 324 | "thresholds": [], 325 | "type": "string", 326 | "unit": "short" 327 | } 328 | ], 329 | "targets": [ 330 | { 331 | "alias": "", 332 | "format": "table", 333 | "rawSql": "select distinct r.origin_as as recv_origin_as,\n CASE WHEN g.rpki_origin_as is null THEN 0 ELSE g.rpki_origin_as END as rpki_origin_as,\n CASE WHEN i.origin_as is null THEN 0 ELSE i.origin_as END as irr_origin_as,\n i.descr,i.source\n from ip_rib r \n LEFT JOIN info_route i ON (i.prefix = r.prefix)\n LEFT JOIN global_ip_rib g ON (g.prefix = r.prefix)\n where r.prefix = (select prefix from ip_rib where prefix >>= '[[prefix]]' order by prefix desc limit 1)\n and r.origin_as > 0\n", 334 | "refId": "A" 335 | } 336 | ], 337 | "title": "Prefix Info", 338 | "transform": "table", 339 | "type": "table" 340 | }, 341 | { 342 | "columns": [], 343 | "compactRowsEnabled": false, 344 | "datasource": "${DS_PSQL}", 345 | "datatablePagingType": "simple_numbers", 346 | "datatableTheme": "basic_theme", 347 | "emptyData": true, 348 | "fontSize": "100%", 349 | "gridPos": { 350 | "h": 23, 351 | "w": 24, 352 | "x": 0, 353 | "y": 19 354 | }, 355 | "hoverEnabled": false, 356 | "id": 3, 357 | "infoEnabled": true, 358 | "lengthChangeEnabled": true, 359 | "links": [ 360 | { 361 | "dashUri": "db/prefix-history-by-prefix", 362 | "dashboard": "Prefix History (by Prefix)", 363 | "includeVars": true, 364 | "keepTime": false, 365 | "title": "Prefix History (by Prefix)", 366 | "type": "dashboard" 367 | } 368 | ], 369 | "orderColumnEnabled": false, 370 | "pagingTypes": [ 371 | { 372 | "text": "Page number buttons only", 373 | "value": "numbers" 374 | }, 375 | { 376 | "text": "'Previous' and 'Next' buttons only", 377 | "value": "simple" 378 | }, 379 | { 380 | "text": "'Previous' and 'Next' buttons, plus page numbers", 381 | "value": "simple_numbers" 382 | }, 383 | { 384 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 385 | "value": "full" 386 | }, 387 | { 388 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 389 | "value": "full_numbers" 390 | }, 391 | { 392 | "text": "'First' and 'Last' buttons, plus page numbers", 393 | "value": "first_last_numbers" 394 | } 395 | ], 396 | "panelHeight": 881, 397 | "rowNumbersEnabled": true, 398 | "rowsPerPage": 7, 399 | "scroll": true, 400 | "scrollHeight": "default", 401 | "searchEnabled": true, 402 | "showCellBorders": false, 403 | "showHeader": true, 404 | "showRowBorders": false, 405 | "sort": { 406 | "col": 0, 407 | "desc": true 408 | }, 409 | "stripedRowsEnabled": true, 410 | "styles": [ 411 | { 412 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 413 | "pattern": "Time", 414 | "type": "date" 415 | }, 416 | { 417 | "colorMode": null, 418 | "colors": [ 419 | "rgba(245, 54, 54, 0.9)", 420 | "rgba(237, 129, 40, 0.89)", 421 | "rgba(50, 172, 45, 0.97)" 422 | ], 423 | "decimals": 0, 424 | "pattern": "/.*/", 425 | "thresholds": [], 426 | "type": "string", 427 | "unit": "none" 428 | } 429 | ], 430 | "targets": [ 431 | { 432 | "alias": "", 433 | "format": "table", 434 | "hide": false, 435 | "rawSql": " select lastmodified,routername,peername,prefix,prefixlen,\n origin_as,med,localpref,as_path,communities \n from v_ip_routes \n where prefix = (select prefix from ip_rib where prefix >>= '[[prefix]]' order by prefix_len desc limit 1)\n AND iswithdrawn = false\n \n order by routername,peername \n limit 2000;", 436 | "refId": "A" 437 | } 438 | ], 439 | "themeOptions": { 440 | "dark": "./css/datatable-dark.css", 441 | "light": "./css/datatable-light.css" 442 | }, 443 | "themes": [ 444 | { 445 | "disabled": false, 446 | "text": "Basic", 447 | "value": "basic_theme" 448 | }, 449 | { 450 | "disabled": true, 451 | "text": "Bootstrap", 452 | "value": "bootstrap_theme" 453 | }, 454 | { 455 | "disabled": true, 456 | "text": "Foundation", 457 | "value": "foundation_theme" 458 | }, 459 | { 460 | "disabled": true, 461 | "text": "ThemeRoller", 462 | "value": "themeroller_theme" 463 | } 464 | ], 465 | "title": "Looking Glass", 466 | "transform": "table", 467 | "type": "briangann-datatable-panel" 468 | } 469 | ], 470 | "schemaVersion": 16, 471 | "style": "dark", 472 | "tags": [], 473 | "templating": { 474 | "list": [ 475 | { 476 | "current": { 477 | "value": "${VAR_PREFIX}", 478 | "text": "${VAR_PREFIX}" 479 | }, 480 | "hide": 0, 481 | "label": "Prefix", 482 | "name": "prefix", 483 | "options": [ 484 | { 485 | "value": "${VAR_PREFIX}", 486 | "text": "${VAR_PREFIX}" 487 | } 488 | ], 489 | "query": "${VAR_PREFIX}", 490 | "type": "constant" 491 | } 492 | ] 493 | }, 494 | "time": { 495 | "from": "now-1h", 496 | "to": "now" 497 | }, 498 | "timepicker": { 499 | "refresh_intervals": [ 500 | "5s", 501 | "10s", 502 | "30s", 503 | "1m", 504 | "5m", 505 | "15m", 506 | "30m", 507 | "1h", 508 | "2h", 509 | "1d" 510 | ], 511 | "time_options": [ 512 | "5m", 513 | "15m", 514 | "1h", 515 | "6h", 516 | "12h", 517 | "24h", 518 | "2d", 519 | "7d", 520 | "30d" 521 | ] 522 | }, 523 | "timezone": "", 524 | "title": "Looking Glass", 525 | "uid": "u8FgTcFik", 526 | "version": 21 527 | } -------------------------------------------------------------------------------- /dashboards/postgres/Security/BGP Sec_ RPKI & IRR.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "briangann-datatable-panel", 16 | "name": "Datatable Panel", 17 | "version": "0.0.6" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "5.2.2" 24 | }, 25 | { 26 | "type": "panel", 27 | "id": "grafana-piechart-panel", 28 | "name": "Pie Chart", 29 | "version": "1.3.3" 30 | }, 31 | { 32 | "type": "datasource", 33 | "id": "postgres", 34 | "name": "PostgreSQL", 35 | "version": "5.0.0" 36 | }, 37 | { 38 | "type": "panel", 39 | "id": "singlestat", 40 | "name": "Singlestat", 41 | "version": "5.0.0" 42 | } 43 | ], 44 | "annotations": { 45 | "list": [ 46 | { 47 | "builtIn": 1, 48 | "datasource": "-- Grafana --", 49 | "enable": true, 50 | "hide": true, 51 | "iconColor": "rgba(0, 211, 255, 1)", 52 | "name": "Annotations & Alerts", 53 | "type": "dashboard" 54 | } 55 | ] 56 | }, 57 | "editable": true, 58 | "gnetId": null, 59 | "graphTooltip": 0, 60 | "id": null, 61 | "links": [], 62 | "panels": [ 63 | { 64 | "aliasColors": {}, 65 | "breakPoint": "50%", 66 | "cacheTimeout": null, 67 | "combine": { 68 | "label": "Others", 69 | "threshold": 0 70 | }, 71 | "datasource": "${DS_PSQL}", 72 | "fontSize": "80%", 73 | "format": "none", 74 | "gridPos": { 75 | "h": 8, 76 | "w": 9, 77 | "x": 0, 78 | "y": 0 79 | }, 80 | "id": 16, 81 | "interval": null, 82 | "legend": { 83 | "percentage": true, 84 | "show": true, 85 | "values": true 86 | }, 87 | "legendType": "Right side", 88 | "links": [], 89 | "maxDataPoints": 3, 90 | "nullPointMode": "connected", 91 | "pieType": "pie", 92 | "strokeWidth": 1, 93 | "targets": [ 94 | { 95 | "alias": "", 96 | "format": "time_series", 97 | "hide": false, 98 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as mismatches\n FROM global_ip_rib\n WHERE rpki_origin_as > 0 and rpki_origin_as != recv_origin_as\n", 99 | "refId": "A" 100 | }, 101 | { 102 | "alias": "", 103 | "format": "time_series", 104 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as matches\n FROM global_ip_rib\n WHERE rpki_origin_as > 0 and rpki_origin_as = recv_origin_as\n\n", 105 | "refId": "B" 106 | } 107 | ], 108 | "title": "RPKI Prefixes in Violations", 109 | "type": "grafana-piechart-panel", 110 | "valueName": "current" 111 | }, 112 | { 113 | "aliasColors": {}, 114 | "breakPoint": "50%", 115 | "cacheTimeout": null, 116 | "combine": { 117 | "label": "Others", 118 | "threshold": 0 119 | }, 120 | "datasource": "${DS_PSQL}", 121 | "fontSize": "80%", 122 | "format": "none", 123 | "gridPos": { 124 | "h": 8, 125 | "w": 9, 126 | "x": 9, 127 | "y": 0 128 | }, 129 | "id": 21, 130 | "interval": null, 131 | "legend": { 132 | "percentage": true, 133 | "show": true, 134 | "values": true 135 | }, 136 | "legendType": "Right side", 137 | "links": [], 138 | "maxDataPoints": 3, 139 | "nullPointMode": "connected", 140 | "pieType": "pie", 141 | "strokeWidth": 1, 142 | "targets": [ 143 | { 144 | "alias": "", 145 | "format": "time_series", 146 | "hide": false, 147 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as mismatches\n FROM global_ip_rib\n WHERE irr_origin_as > 0 and irr_origin_as != recv_origin_as\n\n\n", 148 | "refId": "A" 149 | }, 150 | { 151 | "alias": "", 152 | "format": "time_series", 153 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as matches\n FROM global_ip_rib\n WHERE irr_origin_as > 0 and irr_origin_as = recv_origin_as\n", 154 | "refId": "B" 155 | } 156 | ], 157 | "title": "IRR Prefixes in Violations", 158 | "type": "grafana-piechart-panel", 159 | "valueName": "current" 160 | }, 161 | { 162 | "cacheTimeout": null, 163 | "colorBackground": true, 164 | "colorValue": false, 165 | "colors": [ 166 | "#299c46", 167 | "#f9ba8f", 168 | "#d44a3a" 169 | ], 170 | "datasource": "${DS_PSQL}", 171 | "format": "locale", 172 | "gauge": { 173 | "maxValue": 100, 174 | "minValue": 0, 175 | "show": false, 176 | "thresholdLabels": false, 177 | "thresholdMarkers": true 178 | }, 179 | "gridPos": { 180 | "h": 4, 181 | "w": 6, 182 | "x": 18, 183 | "y": 0 184 | }, 185 | "id": 23, 186 | "interval": null, 187 | "links": [], 188 | "mappingType": 1, 189 | "mappingTypes": [ 190 | { 191 | "name": "value to text", 192 | "value": 1 193 | }, 194 | { 195 | "name": "range to text", 196 | "value": 2 197 | } 198 | ], 199 | "maxDataPoints": 100, 200 | "nullPointMode": "connected", 201 | "nullText": null, 202 | "postfix": "", 203 | "postfixFontSize": "50%", 204 | "prefix": "", 205 | "prefixFontSize": "50%", 206 | "rangeMaps": [ 207 | { 208 | "from": "null", 209 | "text": "N/A", 210 | "to": "null" 211 | } 212 | ], 213 | "sparkline": { 214 | "fillColor": "rgba(31, 118, 189, 0.18)", 215 | "full": false, 216 | "lineColor": "rgb(31, 120, 193)", 217 | "show": false 218 | }, 219 | "tableColumn": "count", 220 | "targets": [ 221 | { 222 | "alias": "", 223 | "format": "table", 224 | "rawSql": "select count(*) from rpki_validator\n", 225 | "refId": "A" 226 | } 227 | ], 228 | "thresholds": "", 229 | "title": "RPKI ROAS", 230 | "type": "singlestat", 231 | "valueFontSize": "80%", 232 | "valueMaps": [ 233 | { 234 | "op": "=", 235 | "text": "N/A", 236 | "value": "null" 237 | } 238 | ], 239 | "valueName": "avg" 240 | }, 241 | { 242 | "cacheTimeout": null, 243 | "colorBackground": true, 244 | "colorValue": false, 245 | "colors": [ 246 | "#299c46", 247 | "#badff4", 248 | "#d44a3a" 249 | ], 250 | "datasource": "${DS_PSQL}", 251 | "format": "locale", 252 | "gauge": { 253 | "maxValue": 100, 254 | "minValue": 0, 255 | "show": false, 256 | "thresholdLabels": false, 257 | "thresholdMarkers": true 258 | }, 259 | "gridPos": { 260 | "h": 4, 261 | "w": 6, 262 | "x": 18, 263 | "y": 4 264 | }, 265 | "id": 25, 266 | "interval": null, 267 | "links": [], 268 | "mappingType": 1, 269 | "mappingTypes": [ 270 | { 271 | "name": "value to text", 272 | "value": 1 273 | }, 274 | { 275 | "name": "range to text", 276 | "value": 2 277 | } 278 | ], 279 | "maxDataPoints": 100, 280 | "nullPointMode": "connected", 281 | "nullText": null, 282 | "postfix": "", 283 | "postfixFontSize": "50%", 284 | "prefix": "", 285 | "prefixFontSize": "50%", 286 | "rangeMaps": [ 287 | { 288 | "from": "null", 289 | "text": "N/A", 290 | "to": "null" 291 | } 292 | ], 293 | "sparkline": { 294 | "fillColor": "rgba(31, 118, 189, 0.18)", 295 | "full": false, 296 | "lineColor": "rgb(31, 120, 193)", 297 | "show": false 298 | }, 299 | "tableColumn": "count", 300 | "targets": [ 301 | { 302 | "alias": "", 303 | "format": "table", 304 | "rawSql": "select count(*) from info_route\n", 305 | "refId": "A" 306 | } 307 | ], 308 | "thresholds": "", 309 | "title": "IRR Entries", 310 | "type": "singlestat", 311 | "valueFontSize": "80%", 312 | "valueMaps": [ 313 | { 314 | "op": "=", 315 | "text": "N/A", 316 | "value": "null" 317 | } 318 | ], 319 | "valueName": "avg" 320 | }, 321 | { 322 | "columns": [], 323 | "compactRowsEnabled": true, 324 | "datasource": "${DS_PSQL}", 325 | "datatablePagingType": "simple_numbers", 326 | "datatableTheme": "basic_theme", 327 | "emptyData": false, 328 | "fontSize": "100%", 329 | "gridPos": { 330 | "h": 11, 331 | "w": 13, 332 | "x": 0, 333 | "y": 8 334 | }, 335 | "hoverEnabled": true, 336 | "id": 19, 337 | "infoEnabled": true, 338 | "lengthChangeEnabled": true, 339 | "links": [], 340 | "orderColumnEnabled": true, 341 | "pagingTypes": [ 342 | { 343 | "text": "Page number buttons only", 344 | "value": "numbers" 345 | }, 346 | { 347 | "text": "'Previous' and 'Next' buttons only", 348 | "value": "simple" 349 | }, 350 | { 351 | "text": "'Previous' and 'Next' buttons, plus page numbers", 352 | "value": "simple_numbers" 353 | }, 354 | { 355 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 356 | "value": "full" 357 | }, 358 | { 359 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 360 | "value": "full_numbers" 361 | }, 362 | { 363 | "text": "'First' and 'Last' buttons, plus page numbers", 364 | "value": "first_last_numbers" 365 | } 366 | ], 367 | "panelHeight": 401, 368 | "rowNumbersEnabled": false, 369 | "rowsPerPage": 5, 370 | "scroll": true, 371 | "scrollHeight": "default", 372 | "searchEnabled": true, 373 | "showCellBorders": false, 374 | "showHeader": true, 375 | "showRowBorders": true, 376 | "sort": { 377 | "col": 0, 378 | "desc": true 379 | }, 380 | "stripedRowsEnabled": true, 381 | "styles": [ 382 | { 383 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 384 | "pattern": "Time", 385 | "type": "date" 386 | }, 387 | { 388 | "colorMode": null, 389 | "colors": [ 390 | "rgba(245, 54, 54, 0.9)", 391 | "rgba(237, 129, 40, 0.89)", 392 | "rgba(50, 172, 45, 0.97)" 393 | ], 394 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 395 | "decimals": 0, 396 | "pattern": "/.*/", 397 | "thresholds": [], 398 | "type": "number", 399 | "unit": "none" 400 | } 401 | ], 402 | "targets": [ 403 | { 404 | "alias": "", 405 | "format": "table", 406 | "hide": false, 407 | "rawSql": "select\n timestamp,\n prefix as \"Prefix\",\n recv_origin_as as \"Received Origin\",\n irr_origin_as as \"Expected Origin\",\n irr_source as \"IRR Source\"\n FROM global_ip_rib\n WHERE $__timeFilter(timestamp)\n and recv_origin_as > 0 AND irr_origin_as > 0 and recv_origin_as != irr_origin_as\n limit 1000", 408 | "refId": "A" 409 | } 410 | ], 411 | "themeOptions": { 412 | "dark": "./css/datatable-dark.css", 413 | "light": "./css/datatable-light.css" 414 | }, 415 | "themes": [ 416 | { 417 | "disabled": false, 418 | "text": "Basic", 419 | "value": "basic_theme" 420 | }, 421 | { 422 | "disabled": true, 423 | "text": "Bootstrap", 424 | "value": "bootstrap_theme" 425 | }, 426 | { 427 | "disabled": true, 428 | "text": "Foundation", 429 | "value": "foundation_theme" 430 | }, 431 | { 432 | "disabled": true, 433 | "text": "ThemeRoller", 434 | "value": "themeroller_theme" 435 | } 436 | ], 437 | "title": "Prefixes in Violation of IRR", 438 | "transform": "table", 439 | "type": "briangann-datatable-panel" 440 | }, 441 | { 442 | "columns": [], 443 | "compactRowsEnabled": true, 444 | "datasource": "${DS_PSQL}", 445 | "datatablePagingType": "simple_numbers", 446 | "datatableTheme": "basic_theme", 447 | "emptyData": false, 448 | "fontSize": "100%", 449 | "gridPos": { 450 | "h": 11, 451 | "w": 11, 452 | "x": 13, 453 | "y": 8 454 | }, 455 | "hoverEnabled": true, 456 | "id": 15, 457 | "infoEnabled": true, 458 | "lengthChangeEnabled": true, 459 | "links": [], 460 | "orderColumnEnabled": true, 461 | "pagingTypes": [ 462 | { 463 | "text": "Page number buttons only", 464 | "value": "numbers" 465 | }, 466 | { 467 | "text": "'Previous' and 'Next' buttons only", 468 | "value": "simple" 469 | }, 470 | { 471 | "text": "'Previous' and 'Next' buttons, plus page numbers", 472 | "value": "simple_numbers" 473 | }, 474 | { 475 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 476 | "value": "full" 477 | }, 478 | { 479 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 480 | "value": "full_numbers" 481 | }, 482 | { 483 | "text": "'First' and 'Last' buttons, plus page numbers", 484 | "value": "first_last_numbers" 485 | } 486 | ], 487 | "panelHeight": 401, 488 | "rowNumbersEnabled": false, 489 | "rowsPerPage": 5, 490 | "scroll": true, 491 | "scrollHeight": "default", 492 | "searchEnabled": true, 493 | "showCellBorders": false, 494 | "showHeader": true, 495 | "showRowBorders": true, 496 | "sort": { 497 | "col": 0, 498 | "desc": true 499 | }, 500 | "stripedRowsEnabled": true, 501 | "styles": [ 502 | { 503 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 504 | "pattern": "Time", 505 | "type": "date" 506 | }, 507 | { 508 | "colorMode": null, 509 | "colors": [ 510 | "rgba(245, 54, 54, 0.9)", 511 | "rgba(237, 129, 40, 0.89)", 512 | "rgba(50, 172, 45, 0.97)" 513 | ], 514 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 515 | "decimals": 0, 516 | "pattern": "/.*/", 517 | "thresholds": [], 518 | "type": "number", 519 | "unit": "none" 520 | } 521 | ], 522 | "targets": [ 523 | { 524 | "alias": "", 525 | "format": "table", 526 | "hide": false, 527 | "rawSql": "select\n timestamp,\n prefix as \"Prefix\",\n recv_origin_as as \"Received Origin\",\n rpki_origin_as as \"Expected Origin\"\n FROM global_ip_rib\n WHERE $__timeFilter(timestamp)\n and recv_origin_as > 0 AND rpki_origin_as > 0 and recv_origin_as != rpki_origin_as\n limit 1000", 528 | "refId": "A" 529 | } 530 | ], 531 | "themeOptions": { 532 | "dark": "./css/datatable-dark.css", 533 | "light": "./css/datatable-light.css" 534 | }, 535 | "themes": [ 536 | { 537 | "disabled": false, 538 | "text": "Basic", 539 | "value": "basic_theme" 540 | }, 541 | { 542 | "disabled": true, 543 | "text": "Bootstrap", 544 | "value": "bootstrap_theme" 545 | }, 546 | { 547 | "disabled": true, 548 | "text": "Foundation", 549 | "value": "foundation_theme" 550 | }, 551 | { 552 | "disabled": true, 553 | "text": "ThemeRoller", 554 | "value": "themeroller_theme" 555 | } 556 | ], 557 | "title": "Prefixes in Violation of RPKI", 558 | "transform": "table", 559 | "type": "briangann-datatable-panel" 560 | } 561 | ], 562 | "refresh": false, 563 | "schemaVersion": 16, 564 | "style": "dark", 565 | "tags": [], 566 | "templating": { 567 | "list": [] 568 | }, 569 | "time": { 570 | "from": "now-3h", 571 | "to": "now" 572 | }, 573 | "timepicker": { 574 | "refresh_intervals": [ 575 | "5s", 576 | "10s", 577 | "30s", 578 | "1m", 579 | "5m", 580 | "15m", 581 | "30m", 582 | "1h", 583 | "2h", 584 | "1d" 585 | ], 586 | "time_options": [ 587 | "5m", 588 | "15m", 589 | "1h", 590 | "6h", 591 | "12h", 592 | "24h", 593 | "2d", 594 | "7d", 595 | "30d" 596 | ] 597 | }, 598 | "timezone": "utc", 599 | "title": "BGP Sec: RPKI & IRR", 600 | "uid": "000000013", 601 | "version": 20 602 | } -------------------------------------------------------------------------------- /dashboards/postgres/Top N/Top by Prefixes.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "5.2.2" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "5.0.0" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "postgres", 28 | "name": "PostgreSQL", 29 | "version": "5.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [ 34 | { 35 | "builtIn": 1, 36 | "datasource": "-- Grafana --", 37 | "enable": true, 38 | "hide": true, 39 | "iconColor": "rgba(0, 211, 255, 1)", 40 | "name": "Annotations & Alerts", 41 | "type": "dashboard" 42 | } 43 | ] 44 | }, 45 | "editable": true, 46 | "gnetId": null, 47 | "graphTooltip": 0, 48 | "id": null, 49 | "iteration": 1534274091160, 50 | "links": [], 51 | "panels": [ 52 | { 53 | "aliasColors": {}, 54 | "bars": false, 55 | "dashLength": 10, 56 | "dashes": false, 57 | "datasource": "${DS_PSQL}", 58 | "decimals": 0, 59 | "fill": 1, 60 | "gridPos": { 61 | "h": 6, 62 | "w": 24, 63 | "x": 0, 64 | "y": 0 65 | }, 66 | "id": 8, 67 | "legend": { 68 | "alignAsTable": true, 69 | "avg": true, 70 | "current": false, 71 | "max": true, 72 | "min": false, 73 | "show": true, 74 | "total": false, 75 | "values": true 76 | }, 77 | "lines": true, 78 | "linewidth": 1, 79 | "links": [], 80 | "nullPointMode": "null", 81 | "percentage": false, 82 | "pointradius": 5, 83 | "points": false, 84 | "renderer": "flot", 85 | "seriesOverrides": [], 86 | "spaceLength": 10, 87 | "stack": false, 88 | "steppedLine": false, 89 | "targets": [ 90 | { 91 | "alias": "", 92 | "format": "time_series", 93 | "hide": false, 94 | "rawSql": "SELECT\n interval_time as time,\n sum(updates) as updates,sum(withdraws) as withdraws\nFROM stats_chg_bypeer s\n JOIN v_peers p ON (s.peer_hash_id = p.peer_hash_id)\nWHERE $__timeFilter(interval_time)\n AND routername in ($router_name)\nGROUP BY interval_time\nORDER BY interval_time ASC\n\n", 95 | "refId": "A" 96 | } 97 | ], 98 | "thresholds": [], 99 | "timeFrom": null, 100 | "timeShift": null, 101 | "title": "Advertisements & Withdrawals", 102 | "tooltip": { 103 | "shared": true, 104 | "sort": 0, 105 | "value_type": "individual" 106 | }, 107 | "type": "graph", 108 | "xaxis": { 109 | "buckets": null, 110 | "mode": "time", 111 | "name": null, 112 | "show": true, 113 | "values": [] 114 | }, 115 | "yaxes": [ 116 | { 117 | "decimals": 0, 118 | "format": "none", 119 | "label": null, 120 | "logBase": 1, 121 | "max": null, 122 | "min": null, 123 | "show": true 124 | }, 125 | { 126 | "format": "short", 127 | "label": null, 128 | "logBase": 1, 129 | "max": null, 130 | "min": null, 131 | "show": false 132 | } 133 | ], 134 | "yaxis": { 135 | "align": false, 136 | "alignLevel": null 137 | } 138 | }, 139 | { 140 | "aliasColors": {}, 141 | "bars": false, 142 | "dashLength": 10, 143 | "dashes": false, 144 | "datasource": "${DS_PSQL}", 145 | "decimals": 0, 146 | "fill": 1, 147 | "gridPos": { 148 | "h": 7, 149 | "w": 12, 150 | "x": 0, 151 | "y": 6 152 | }, 153 | "id": 6, 154 | "legend": { 155 | "alignAsTable": true, 156 | "avg": true, 157 | "current": false, 158 | "max": true, 159 | "min": false, 160 | "rightSide": true, 161 | "show": true, 162 | "sort": "max", 163 | "sortDesc": true, 164 | "total": false, 165 | "values": true 166 | }, 167 | "lines": true, 168 | "linewidth": 1, 169 | "links": [], 170 | "nullPointMode": "null", 171 | "percentage": false, 172 | "pointradius": 5, 173 | "points": false, 174 | "renderer": "flot", 175 | "seriesOverrides": [], 176 | "spaceLength": 10, 177 | "stack": false, 178 | "steppedLine": false, 179 | "targets": [ 180 | { 181 | "alias": "", 182 | "format": "time_series", 183 | "hide": false, 184 | "rawSql": "SELECT\n interval_time as time,\n updates as updates,\n p.RouterName as metric\n FROM stats_chg_bypeer l\n JOIN v_peers p ON (p.peer_hash_id = l.peer_hash_id)\n WHERE $__timeFilter(interval_time)\n AND p.routername IN ($router_name)\n order by interval_time asc\n\n", 185 | "refId": "A" 186 | } 187 | ], 188 | "thresholds": [], 189 | "timeFrom": null, 190 | "timeShift": null, 191 | "title": "Advertisements By Router", 192 | "tooltip": { 193 | "shared": true, 194 | "sort": 0, 195 | "value_type": "individual" 196 | }, 197 | "type": "graph", 198 | "xaxis": { 199 | "buckets": null, 200 | "mode": "time", 201 | "name": null, 202 | "show": true, 203 | "values": [] 204 | }, 205 | "yaxes": [ 206 | { 207 | "format": "none", 208 | "label": "Updates", 209 | "logBase": 1, 210 | "max": null, 211 | "min": null, 212 | "show": true 213 | }, 214 | { 215 | "format": "short", 216 | "label": null, 217 | "logBase": 1, 218 | "max": null, 219 | "min": null, 220 | "show": false 221 | } 222 | ], 223 | "yaxis": { 224 | "align": false, 225 | "alignLevel": null 226 | } 227 | }, 228 | { 229 | "aliasColors": {}, 230 | "bars": false, 231 | "dashLength": 10, 232 | "dashes": false, 233 | "datasource": "${DS_PSQL}", 234 | "decimals": 0, 235 | "fill": 1, 236 | "gridPos": { 237 | "h": 7, 238 | "w": 12, 239 | "x": 12, 240 | "y": 6 241 | }, 242 | "id": 7, 243 | "legend": { 244 | "alignAsTable": true, 245 | "avg": true, 246 | "current": false, 247 | "max": true, 248 | "min": false, 249 | "rightSide": true, 250 | "show": true, 251 | "sort": "max", 252 | "sortDesc": true, 253 | "total": false, 254 | "values": true 255 | }, 256 | "lines": true, 257 | "linewidth": 1, 258 | "links": [], 259 | "nullPointMode": "null", 260 | "percentage": false, 261 | "pointradius": 5, 262 | "points": false, 263 | "renderer": "flot", 264 | "seriesOverrides": [], 265 | "spaceLength": 10, 266 | "stack": false, 267 | "steppedLine": false, 268 | "targets": [ 269 | { 270 | "alias": "", 271 | "format": "time_series", 272 | "rawSql": "SELECT\n interval_time as time,\n withdraws,\n p.RouterName as metric\n FROM stats_chg_bypeer l\n JOIN v_peers p ON (p.peer_hash_id = l.peer_hash_id)\n WHERE $__timeFilter(interval_time)\n AND p.routername IN ($router_name)\n order by interval_time asc\n\n", 273 | "refId": "A" 274 | } 275 | ], 276 | "thresholds": [], 277 | "timeFrom": null, 278 | "timeShift": null, 279 | "title": "Withdraws By Router", 280 | "tooltip": { 281 | "shared": true, 282 | "sort": 0, 283 | "value_type": "individual" 284 | }, 285 | "type": "graph", 286 | "xaxis": { 287 | "buckets": null, 288 | "mode": "time", 289 | "name": null, 290 | "show": true, 291 | "values": [] 292 | }, 293 | "yaxes": [ 294 | { 295 | "format": "none", 296 | "label": "Withdraws", 297 | "logBase": 1, 298 | "max": null, 299 | "min": null, 300 | "show": true 301 | }, 302 | { 303 | "format": "short", 304 | "label": null, 305 | "logBase": 1, 306 | "max": null, 307 | "min": null, 308 | "show": false 309 | } 310 | ], 311 | "yaxis": { 312 | "align": false, 313 | "alignLevel": null 314 | } 315 | }, 316 | { 317 | "aliasColors": {}, 318 | "bars": false, 319 | "dashLength": 10, 320 | "dashes": false, 321 | "datasource": "${DS_PSQL}", 322 | "fill": 1, 323 | "gridPos": { 324 | "h": 7, 325 | "w": 12, 326 | "x": 0, 327 | "y": 13 328 | }, 329 | "id": 4, 330 | "legend": { 331 | "alignAsTable": true, 332 | "avg": true, 333 | "current": false, 334 | "max": true, 335 | "min": false, 336 | "rightSide": true, 337 | "show": true, 338 | "sort": "max", 339 | "sortDesc": true, 340 | "total": false, 341 | "values": true 342 | }, 343 | "lines": true, 344 | "linewidth": 1, 345 | "links": [], 346 | "nullPointMode": "null", 347 | "percentage": false, 348 | "pointradius": 5, 349 | "points": false, 350 | "renderer": "flot", 351 | "seriesOverrides": [], 352 | "spaceLength": 10, 353 | "stack": false, 354 | "steppedLine": false, 355 | "targets": [ 356 | { 357 | "alias": "", 358 | "format": "time_series", 359 | "hide": false, 360 | "rawSql": "SELECT\n interval_time as time,\n updates,\n p.PeerName as metric\n FROM stats_chg_bypeer l\n JOIN v_peers p ON (p.peer_hash_id = l.peer_hash_id)\n WHERE $__timeFilter(interval_time)\n AND p.routername IN ($router_name)\n order by interval_time asc\n", 361 | "refId": "A" 362 | } 363 | ], 364 | "thresholds": [], 365 | "timeFrom": null, 366 | "timeShift": null, 367 | "title": "Updates by Peer", 368 | "tooltip": { 369 | "shared": false, 370 | "sort": 0, 371 | "value_type": "individual" 372 | }, 373 | "type": "graph", 374 | "xaxis": { 375 | "buckets": null, 376 | "mode": "time", 377 | "name": null, 378 | "show": true, 379 | "values": [] 380 | }, 381 | "yaxes": [ 382 | { 383 | "format": "none", 384 | "label": "Count of Updates", 385 | "logBase": 1, 386 | "max": null, 387 | "min": null, 388 | "show": true 389 | }, 390 | { 391 | "format": "short", 392 | "label": null, 393 | "logBase": 1, 394 | "max": null, 395 | "min": null, 396 | "show": false 397 | } 398 | ], 399 | "yaxis": { 400 | "align": false, 401 | "alignLevel": null 402 | } 403 | }, 404 | { 405 | "aliasColors": {}, 406 | "bars": false, 407 | "dashLength": 10, 408 | "dashes": false, 409 | "datasource": "${DS_PSQL}", 410 | "fill": 1, 411 | "gridPos": { 412 | "h": 7, 413 | "w": 12, 414 | "x": 12, 415 | "y": 13 416 | }, 417 | "id": 5, 418 | "legend": { 419 | "alignAsTable": true, 420 | "avg": true, 421 | "current": false, 422 | "max": true, 423 | "min": false, 424 | "rightSide": true, 425 | "show": true, 426 | "sort": "max", 427 | "sortDesc": true, 428 | "total": false, 429 | "values": true 430 | }, 431 | "lines": true, 432 | "linewidth": 1, 433 | "links": [], 434 | "nullPointMode": "null", 435 | "percentage": false, 436 | "pointradius": 5, 437 | "points": false, 438 | "renderer": "flot", 439 | "seriesOverrides": [], 440 | "spaceLength": 10, 441 | "stack": false, 442 | "steppedLine": false, 443 | "targets": [ 444 | { 445 | "alias": "", 446 | "format": "time_series", 447 | "hide": false, 448 | "rawSql": "SELECT\n interval_time as time,\n withdraws,\n p.PeerName as metric\n FROM stats_chg_bypeer l\n JOIN v_peers p ON (p.peer_hash_id = l.peer_hash_id)\n WHERE $__timeFilter(interval_time)\n AND p.routername IN ($router_name)\n order by interval_time asc\n", 449 | "refId": "A" 450 | } 451 | ], 452 | "thresholds": [], 453 | "timeFrom": null, 454 | "timeShift": null, 455 | "title": "Withdraws by Peer", 456 | "tooltip": { 457 | "shared": false, 458 | "sort": 0, 459 | "value_type": "individual" 460 | }, 461 | "type": "graph", 462 | "xaxis": { 463 | "buckets": null, 464 | "mode": "time", 465 | "name": null, 466 | "show": true, 467 | "values": [] 468 | }, 469 | "yaxes": [ 470 | { 471 | "format": "none", 472 | "label": "Count of Updates", 473 | "logBase": 1, 474 | "max": null, 475 | "min": null, 476 | "show": true 477 | }, 478 | { 479 | "format": "short", 480 | "label": null, 481 | "logBase": 1, 482 | "max": null, 483 | "min": null, 484 | "show": false 485 | } 486 | ], 487 | "yaxis": { 488 | "align": false, 489 | "alignLevel": null 490 | } 491 | }, 492 | { 493 | "aliasColors": {}, 494 | "bars": true, 495 | "dashLength": 10, 496 | "dashes": false, 497 | "datasource": "${DS_PSQL}", 498 | "decimals": 0, 499 | "fill": 1, 500 | "gridPos": { 501 | "h": 7, 502 | "w": 12, 503 | "x": 0, 504 | "y": 20 505 | }, 506 | "id": 2, 507 | "legend": { 508 | "alignAsTable": true, 509 | "avg": false, 510 | "current": false, 511 | "max": true, 512 | "min": false, 513 | "rightSide": true, 514 | "show": true, 515 | "sort": "max", 516 | "sortDesc": true, 517 | "total": false, 518 | "values": true 519 | }, 520 | "lines": false, 521 | "linewidth": 1, 522 | "links": [], 523 | "nullPointMode": "null", 524 | "percentage": false, 525 | "pointradius": 5, 526 | "points": false, 527 | "renderer": "flot", 528 | "seriesOverrides": [], 529 | "spaceLength": 10, 530 | "stack": false, 531 | "steppedLine": false, 532 | "targets": [ 533 | { 534 | "alias": "", 535 | "format": "time_series", 536 | "hide": false, 537 | "rawSql": "SELECT\n max(interval_time) as time,\n sum(updates) as value,\n prefix as metric\n FROM stats_chg_byprefix l\n WHERE $__timeFilter(interval_time)\n AND peer_hash_id in (SELECT peer_hash_id from v_peers where routername in ($router_name))\n GROUP BY prefix\n order by value desc\nLIMIT 20", 538 | "refId": "A" 539 | } 540 | ], 541 | "thresholds": [], 542 | "timeFrom": null, 543 | "timeShift": null, 544 | "title": "Top Updates by Prefix", 545 | "tooltip": { 546 | "shared": false, 547 | "sort": 0, 548 | "value_type": "individual" 549 | }, 550 | "type": "graph", 551 | "xaxis": { 552 | "buckets": null, 553 | "mode": "series", 554 | "name": null, 555 | "show": false, 556 | "values": [ 557 | "total" 558 | ] 559 | }, 560 | "yaxes": [ 561 | { 562 | "format": "none", 563 | "label": "Updates", 564 | "logBase": 1, 565 | "max": null, 566 | "min": null, 567 | "show": true 568 | }, 569 | { 570 | "format": "short", 571 | "label": null, 572 | "logBase": 1, 573 | "max": null, 574 | "min": null, 575 | "show": false 576 | } 577 | ], 578 | "yaxis": { 579 | "align": false, 580 | "alignLevel": null 581 | } 582 | }, 583 | { 584 | "aliasColors": {}, 585 | "bars": true, 586 | "dashLength": 10, 587 | "dashes": false, 588 | "datasource": "${DS_PSQL}", 589 | "fill": 1, 590 | "gridPos": { 591 | "h": 7, 592 | "w": 12, 593 | "x": 12, 594 | "y": 20 595 | }, 596 | "id": 3, 597 | "legend": { 598 | "alignAsTable": true, 599 | "avg": false, 600 | "current": false, 601 | "max": true, 602 | "min": false, 603 | "rightSide": true, 604 | "show": true, 605 | "sort": "max", 606 | "sortDesc": true, 607 | "total": false, 608 | "values": true 609 | }, 610 | "lines": false, 611 | "linewidth": 1, 612 | "links": [], 613 | "nullPointMode": "null", 614 | "percentage": false, 615 | "pointradius": 5, 616 | "points": false, 617 | "renderer": "flot", 618 | "seriesOverrides": [], 619 | "spaceLength": 10, 620 | "stack": false, 621 | "steppedLine": false, 622 | "targets": [ 623 | { 624 | "alias": "", 625 | "format": "time_series", 626 | "hide": false, 627 | "rawSql": "SELECT\n max(interval_time) as time,\n sum(withdraws) as value,\n prefix as metric\n FROM stats_chg_byprefix\n WHERE $__timeFilter(interval_time)\n AND peer_hash_id in (SELECT peer_hash_id from v_peers where routername in ($router_name))\n GROUP BY prefix\n order by value desc\nLIMIT 20;\n", 628 | "refId": "A" 629 | } 630 | ], 631 | "thresholds": [], 632 | "timeFrom": null, 633 | "timeShift": null, 634 | "title": "Top Withdraws by Prefix", 635 | "tooltip": { 636 | "shared": false, 637 | "sort": 0, 638 | "value_type": "individual" 639 | }, 640 | "type": "graph", 641 | "xaxis": { 642 | "buckets": null, 643 | "mode": "series", 644 | "name": null, 645 | "show": false, 646 | "values": [ 647 | "total" 648 | ] 649 | }, 650 | "yaxes": [ 651 | { 652 | "format": "none", 653 | "label": "Withdraws", 654 | "logBase": 1, 655 | "max": null, 656 | "min": null, 657 | "show": true 658 | }, 659 | { 660 | "format": "short", 661 | "label": null, 662 | "logBase": 1, 663 | "max": null, 664 | "min": null, 665 | "show": false 666 | } 667 | ], 668 | "yaxis": { 669 | "align": false, 670 | "alignLevel": null 671 | } 672 | } 673 | ], 674 | "refresh": false, 675 | "schemaVersion": 16, 676 | "style": "dark", 677 | "tags": [], 678 | "templating": { 679 | "list": [ 680 | { 681 | "allValue": "", 682 | "current": {}, 683 | "datasource": "${DS_PSQL}", 684 | "hide": 0, 685 | "includeAll": true, 686 | "label": "Filter by Router", 687 | "multi": true, 688 | "name": "router_name", 689 | "options": [], 690 | "query": "select routername from v_peers group by routername", 691 | "refresh": 1, 692 | "regex": "", 693 | "sort": 1, 694 | "tagValuesQuery": "", 695 | "tags": [], 696 | "tagsQuery": "", 697 | "type": "query", 698 | "useTags": false 699 | } 700 | ] 701 | }, 702 | "time": { 703 | "from": "now-1h", 704 | "to": "now" 705 | }, 706 | "timepicker": { 707 | "refresh_intervals": [ 708 | "5s", 709 | "10s", 710 | "30s", 711 | "1m", 712 | "5m", 713 | "15m", 714 | "30m", 715 | "1h", 716 | "2h", 717 | "1d" 718 | ], 719 | "time_options": [ 720 | "5m", 721 | "15m", 722 | "1h", 723 | "6h", 724 | "12h", 725 | "24h", 726 | "2d", 727 | "7d", 728 | "30d" 729 | ] 730 | }, 731 | "timezone": "utc", 732 | "title": "Top by Prefixes", 733 | "uid": "000000007", 734 | "version": 9 735 | } -------------------------------------------------------------------------------- /dashboards/postgres/General/ASN View.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "briangann-datatable-panel", 16 | "name": "Datatable Panel", 17 | "version": "0.0.6" 18 | }, 19 | { 20 | "type": "grafana", 21 | "id": "grafana", 22 | "name": "Grafana", 23 | "version": "5.2.2" 24 | }, 25 | { 26 | "type": "panel", 27 | "id": "grafana-piechart-panel", 28 | "name": "Pie Chart", 29 | "version": "1.3.3" 30 | }, 31 | { 32 | "type": "panel", 33 | "id": "graph", 34 | "name": "Graph", 35 | "version": "5.0.0" 36 | }, 37 | { 38 | "type": "datasource", 39 | "id": "postgres", 40 | "name": "PostgreSQL", 41 | "version": "5.0.0" 42 | }, 43 | { 44 | "type": "panel", 45 | "id": "singlestat", 46 | "name": "Singlestat", 47 | "version": "5.0.0" 48 | }, 49 | { 50 | "type": "panel", 51 | "id": "table", 52 | "name": "Table", 53 | "version": "5.0.0" 54 | } 55 | ], 56 | "annotations": { 57 | "list": [ 58 | { 59 | "builtIn": 1, 60 | "datasource": "-- Grafana --", 61 | "enable": true, 62 | "hide": true, 63 | "iconColor": "rgba(0, 211, 255, 1)", 64 | "name": "Annotations & Alerts", 65 | "type": "dashboard" 66 | } 67 | ] 68 | }, 69 | "editable": true, 70 | "gnetId": null, 71 | "graphTooltip": 0, 72 | "id": null, 73 | "iteration": 1534355461375, 74 | "links": [], 75 | "panels": [ 76 | { 77 | "aliasColors": {}, 78 | "breakPoint": "50%", 79 | "cacheTimeout": null, 80 | "combine": { 81 | "label": "Others", 82 | "threshold": 0 83 | }, 84 | "datasource": "${DS_PSQL}", 85 | "decimals": 0, 86 | "fontSize": "80%", 87 | "format": "none", 88 | "gridPos": { 89 | "h": 8, 90 | "w": 5, 91 | "x": 0, 92 | "y": 0 93 | }, 94 | "id": 6, 95 | "interval": null, 96 | "legend": { 97 | "show": true, 98 | "values": true 99 | }, 100 | "legendType": "Under graph", 101 | "links": [], 102 | "maxDataPoints": 3, 103 | "nullPointMode": "connected", 104 | "pieType": "pie", 105 | "strokeWidth": 1, 106 | "targets": [ 107 | { 108 | "alias": "", 109 | "format": "time_series", 110 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as \"ipv4\"\nFROM\n global_ip_rib\nWHERE\n recv_origin_as = [[asn_num]]\n and family(prefix) = 4\nGROUP BY prefix\n", 111 | "refId": "A" 112 | }, 113 | { 114 | "alias": "", 115 | "format": "time_series", 116 | "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as \"ipv6\"\nFROM\n global_ip_rib\nWHERE\n recv_origin_as = [[asn_num]]\n and family(prefix) = 6\nGROUP BY prefix\n", 117 | "refId": "B" 118 | } 119 | ], 120 | "title": "Advertised IP Addresses", 121 | "type": "grafana-piechart-panel", 122 | "valueName": "total" 123 | }, 124 | { 125 | "cacheTimeout": null, 126 | "colorBackground": true, 127 | "colorValue": false, 128 | "colors": [ 129 | "#299c46", 130 | "#64b0c8", 131 | "#d44a3a" 132 | ], 133 | "datasource": "${DS_PSQL}", 134 | "format": "none", 135 | "gauge": { 136 | "maxValue": 100, 137 | "minValue": 0, 138 | "show": false, 139 | "thresholdLabels": false, 140 | "thresholdMarkers": true 141 | }, 142 | "gridPos": { 143 | "h": 4, 144 | "w": 4, 145 | "x": 5, 146 | "y": 0 147 | }, 148 | "id": 11, 149 | "interval": null, 150 | "links": [], 151 | "mappingType": 1, 152 | "mappingTypes": [ 153 | { 154 | "name": "value to text", 155 | "value": 1 156 | }, 157 | { 158 | "name": "range to text", 159 | "value": 2 160 | } 161 | ], 162 | "maxDataPoints": 100, 163 | "nullPointMode": "connected", 164 | "nullText": null, 165 | "postfix": "", 166 | "postfixFontSize": "50%", 167 | "prefix": "", 168 | "prefixFontSize": "50%", 169 | "rangeMaps": [ 170 | { 171 | "from": "null", 172 | "text": "N/A", 173 | "to": "null" 174 | } 175 | ], 176 | "sparkline": { 177 | "fillColor": "rgba(31, 118, 189, 0.18)", 178 | "full": false, 179 | "lineColor": "rgb(31, 120, 193)", 180 | "show": false 181 | }, 182 | "tableColumn": "count", 183 | "targets": [ 184 | { 185 | "alias": "", 186 | "format": "table", 187 | "hide": false, 188 | "rawSql": "select count(distinct asn_left) as count\n from as_path_analysis a\n where a.asn = [[asn_num]]\n", 189 | "refId": "A" 190 | } 191 | ], 192 | "thresholds": "", 193 | "title": "Upstream ASNs", 194 | "type": "singlestat", 195 | "valueFontSize": "170%", 196 | "valueMaps": [ 197 | { 198 | "op": "=", 199 | "text": "N/A", 200 | "value": "null" 201 | } 202 | ], 203 | "valueName": "avg" 204 | }, 205 | { 206 | "aliasColors": {}, 207 | "bars": false, 208 | "dashLength": 10, 209 | "dashes": false, 210 | "datasource": "${DS_PSQL}", 211 | "decimals": 0, 212 | "fill": 1, 213 | "gridPos": { 214 | "h": 8, 215 | "w": 15, 216 | "x": 9, 217 | "y": 0 218 | }, 219 | "id": 14, 220 | "legend": { 221 | "alignAsTable": true, 222 | "avg": true, 223 | "current": false, 224 | "hideEmpty": false, 225 | "hideZero": false, 226 | "max": true, 227 | "min": true, 228 | "rightSide": true, 229 | "show": true, 230 | "sort": null, 231 | "sortDesc": null, 232 | "total": false, 233 | "values": true 234 | }, 235 | "lines": true, 236 | "linewidth": 1, 237 | "links": [], 238 | "nullPointMode": "null", 239 | "percentage": false, 240 | "pointradius": 5, 241 | "points": true, 242 | "renderer": "flot", 243 | "seriesOverrides": [], 244 | "spaceLength": 10, 245 | "stack": false, 246 | "steppedLine": false, 247 | "targets": [ 248 | { 249 | "alias": "", 250 | "format": "time_series", 251 | "rawSql": "SELECT\n $__time(interval_time),\n v4_prefixes,v6_prefixes,v4_with_rpki,v6_with_rpki,v4_with_irr,v6_with_irr\nFROM\n stats_ip_origins\nWHERE\n $__timeFilter(interval_time) and asn = [[asn_num]]\nORDER BY interval_time asc\n", 252 | "refId": "A" 253 | } 254 | ], 255 | "thresholds": [], 256 | "timeFrom": "24h", 257 | "timeShift": null, 258 | "title": "Originating Prefix Trend", 259 | "tooltip": { 260 | "shared": true, 261 | "sort": 0, 262 | "value_type": "individual" 263 | }, 264 | "type": "graph", 265 | "xaxis": { 266 | "buckets": null, 267 | "mode": "time", 268 | "name": null, 269 | "show": true, 270 | "values": [] 271 | }, 272 | "yaxes": [ 273 | { 274 | "decimals": 0, 275 | "format": "none", 276 | "label": null, 277 | "logBase": 1, 278 | "max": null, 279 | "min": null, 280 | "show": true 281 | }, 282 | { 283 | "format": "short", 284 | "label": null, 285 | "logBase": 1, 286 | "max": null, 287 | "min": null, 288 | "show": false 289 | } 290 | ], 291 | "yaxis": { 292 | "align": false, 293 | "alignLevel": null 294 | } 295 | }, 296 | { 297 | "cacheTimeout": null, 298 | "colorBackground": true, 299 | "colorValue": false, 300 | "colors": [ 301 | "#299c46", 302 | "#6ed0e0", 303 | "#d44a3a" 304 | ], 305 | "datasource": "${DS_PSQL}", 306 | "format": "none", 307 | "gauge": { 308 | "maxValue": 100, 309 | "minValue": 0, 310 | "show": false, 311 | "thresholdLabels": false, 312 | "thresholdMarkers": true 313 | }, 314 | "gridPos": { 315 | "h": 4, 316 | "w": 4, 317 | "x": 5, 318 | "y": 4 319 | }, 320 | "id": 12, 321 | "interval": null, 322 | "links": [], 323 | "mappingType": 1, 324 | "mappingTypes": [ 325 | { 326 | "name": "value to text", 327 | "value": 1 328 | }, 329 | { 330 | "name": "range to text", 331 | "value": 2 332 | } 333 | ], 334 | "maxDataPoints": 100, 335 | "nullPointMode": "connected", 336 | "nullText": null, 337 | "postfix": "", 338 | "postfixFontSize": "50%", 339 | "prefix": "", 340 | "prefixFontSize": "50%", 341 | "rangeMaps": [ 342 | { 343 | "from": "null", 344 | "text": "N/A", 345 | "to": "null" 346 | } 347 | ], 348 | "sparkline": { 349 | "fillColor": "rgba(31, 118, 189, 0.18)", 350 | "full": false, 351 | "lineColor": "rgb(31, 120, 193)", 352 | "show": false 353 | }, 354 | "tableColumn": "count", 355 | "targets": [ 356 | { 357 | "alias": "", 358 | "format": "table", 359 | "hide": false, 360 | "rawSql": "select count(distinct asn_right) as count\n from as_path_analysis a\n where a.asn = [[asn_num]] and asn_right != 0\n", 361 | "refId": "A" 362 | } 363 | ], 364 | "thresholds": "", 365 | "title": "Downstream ASNs", 366 | "type": "singlestat", 367 | "valueFontSize": "170%", 368 | "valueMaps": [ 369 | { 370 | "op": "=", 371 | "text": "N/A", 372 | "value": "null" 373 | } 374 | ], 375 | "valueName": "avg" 376 | }, 377 | { 378 | "columns": [], 379 | "datasource": "${DS_PSQL}", 380 | "fontSize": "100%", 381 | "gridPos": { 382 | "h": 7, 383 | "w": 24, 384 | "x": 0, 385 | "y": 8 386 | }, 387 | "id": 2, 388 | "links": [], 389 | "pageSize": null, 390 | "scroll": true, 391 | "showHeader": true, 392 | "sort": { 393 | "col": 0, 394 | "desc": true 395 | }, 396 | "styles": [ 397 | { 398 | "alias": "Time", 399 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 400 | "pattern": "Time", 401 | "type": "date" 402 | }, 403 | { 404 | "alias": "", 405 | "colorMode": null, 406 | "colors": [ 407 | "rgba(245, 54, 54, 0.9)", 408 | "rgba(237, 129, 40, 0.89)", 409 | "rgba(50, 172, 45, 0.97)" 410 | ], 411 | "decimals": 2, 412 | "pattern": "/.*/", 413 | "preserveFormat": true, 414 | "thresholds": [], 415 | "type": "string", 416 | "unit": "short" 417 | } 418 | ], 419 | "targets": [ 420 | { 421 | "alias": "", 422 | "format": "table", 423 | "hide": false, 424 | "rawSql": "select as_name,org_id,org_name,address,city,state_prov,country,remarks,raw_output,source \n from info_asn i \n where asn = [[asn_num]]", 425 | "refId": "A" 426 | } 427 | ], 428 | "title": "ASN Info", 429 | "transform": "table", 430 | "type": "table" 431 | }, 432 | { 433 | "columns": [], 434 | "datasource": "${DS_PSQL}", 435 | "fontSize": "100%", 436 | "gridPos": { 437 | "h": 9, 438 | "w": 12, 439 | "x": 0, 440 | "y": 15 441 | }, 442 | "id": 8, 443 | "links": [], 444 | "pageSize": null, 445 | "scroll": true, 446 | "showHeader": true, 447 | "sort": { 448 | "col": 0, 449 | "desc": true 450 | }, 451 | "styles": [ 452 | { 453 | "alias": "Time", 454 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 455 | "pattern": "Time", 456 | "type": "date" 457 | }, 458 | { 459 | "alias": "", 460 | "colorMode": null, 461 | "colors": [ 462 | "rgba(245, 54, 54, 0.9)", 463 | "rgba(237, 129, 40, 0.89)", 464 | "rgba(50, 172, 45, 0.97)" 465 | ], 466 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 467 | "decimals": 0, 468 | "mappingType": 1, 469 | "pattern": "ASN", 470 | "thresholds": [], 471 | "type": "number", 472 | "unit": "none" 473 | }, 474 | { 475 | "alias": "", 476 | "colorMode": null, 477 | "colors": [ 478 | "rgba(245, 54, 54, 0.9)", 479 | "rgba(237, 129, 40, 0.89)", 480 | "rgba(50, 172, 45, 0.97)" 481 | ], 482 | "decimals": 2, 483 | "pattern": "/.*/", 484 | "preserveFormat": true, 485 | "thresholds": [], 486 | "type": "string", 487 | "unit": "short" 488 | } 489 | ], 490 | "targets": [ 491 | { 492 | "alias": "", 493 | "format": "table", 494 | "rawSql": "select a.asn_left as \"ASN\",max(as_name) as \"Name\",max(org_id) as \"Org Id\",max(org_name) as \"Org Name\",max(city) as \"City\",\n max(state_prov) as \"State\",max(country) as \"Country\",max(source) as \"Source\"\n from as_path_analysis a\n LEFT JOIN info_asn i ON (i.asn = a.asn_left)\n where a.asn = [[asn_num]] and asn_left != 0\n group by a.asn_left", 495 | "refId": "A" 496 | } 497 | ], 498 | "title": "Upstream ASNs", 499 | "transform": "table", 500 | "type": "table" 501 | }, 502 | { 503 | "columns": [], 504 | "datasource": "${DS_PSQL}", 505 | "fontSize": "100%", 506 | "gridPos": { 507 | "h": 9, 508 | "w": 12, 509 | "x": 12, 510 | "y": 15 511 | }, 512 | "id": 9, 513 | "links": [], 514 | "pageSize": null, 515 | "scroll": true, 516 | "showHeader": true, 517 | "sort": { 518 | "col": 0, 519 | "desc": true 520 | }, 521 | "styles": [ 522 | { 523 | "alias": "Time", 524 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 525 | "pattern": "Time", 526 | "type": "date" 527 | }, 528 | { 529 | "alias": "", 530 | "colorMode": null, 531 | "colors": [ 532 | "rgba(245, 54, 54, 0.9)", 533 | "rgba(237, 129, 40, 0.89)", 534 | "rgba(50, 172, 45, 0.97)" 535 | ], 536 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 537 | "decimals": 0, 538 | "mappingType": 1, 539 | "pattern": "ASN", 540 | "thresholds": [], 541 | "type": "number", 542 | "unit": "none" 543 | }, 544 | { 545 | "alias": "", 546 | "colorMode": null, 547 | "colors": [ 548 | "rgba(245, 54, 54, 0.9)", 549 | "rgba(237, 129, 40, 0.89)", 550 | "rgba(50, 172, 45, 0.97)" 551 | ], 552 | "decimals": 2, 553 | "pattern": "/.*/", 554 | "preserveFormat": true, 555 | "thresholds": [], 556 | "type": "string", 557 | "unit": "short" 558 | } 559 | ], 560 | "targets": [ 561 | { 562 | "alias": "", 563 | "format": "table", 564 | "rawSql": "select a.asn_right as \"ASN\",max(as_name) as \"Name\",max(org_id) as \"Org Id\",max(org_name) as \"Org Name\",max(city) as \"City\",\n max(state_prov) as \"State\",max(country) as \"Country\",max(source) as \"Source\"\n from as_path_analysis a\n LEFT JOIN info_asn i ON (i.asn = a.asn_right)\n where a.asn = [[asn_num]] and asn_right != 0\n group by a.asn_right", 565 | "refId": "A" 566 | } 567 | ], 568 | "title": "Downstream ASNs", 569 | "transform": "table", 570 | "type": "table" 571 | }, 572 | { 573 | "columns": [], 574 | "compactRowsEnabled": false, 575 | "datasource": "${DS_PSQL}", 576 | "datatablePagingType": "simple_numbers", 577 | "datatableTheme": "basic_theme", 578 | "description": "", 579 | "emptyData": false, 580 | "fontSize": "100%", 581 | "gridPos": { 582 | "h": 15, 583 | "w": 24, 584 | "x": 0, 585 | "y": 24 586 | }, 587 | "hoverEnabled": true, 588 | "id": 4, 589 | "infoEnabled": true, 590 | "lengthChangeEnabled": true, 591 | "links": [], 592 | "orderColumnEnabled": true, 593 | "pagingTypes": [ 594 | { 595 | "text": "Page number buttons only", 596 | "value": "numbers" 597 | }, 598 | { 599 | "text": "'Previous' and 'Next' buttons only", 600 | "value": "simple" 601 | }, 602 | { 603 | "text": "'Previous' and 'Next' buttons, plus page numbers", 604 | "value": "simple_numbers" 605 | }, 606 | { 607 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 608 | "value": "full" 609 | }, 610 | { 611 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 612 | "value": "full_numbers" 613 | }, 614 | { 615 | "text": "'First' and 'Last' buttons, plus page numbers", 616 | "value": "first_last_numbers" 617 | } 618 | ], 619 | "panelHeight": 561, 620 | "rowNumbersEnabled": true, 621 | "rowsPerPage": 5, 622 | "scroll": true, 623 | "scrollHeight": "default", 624 | "searchEnabled": true, 625 | "showCellBorders": false, 626 | "showHeader": true, 627 | "showRowBorders": true, 628 | "sort": { 629 | "col": 0, 630 | "desc": true 631 | }, 632 | "stripedRowsEnabled": true, 633 | "styles": [ 634 | { 635 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 636 | "pattern": "Time", 637 | "type": "date" 638 | }, 639 | { 640 | "colorMode": null, 641 | "colors": [ 642 | "rgba(245, 54, 54, 0.9)", 643 | "rgba(237, 129, 40, 0.89)", 644 | "rgba(50, 172, 45, 0.97)" 645 | ], 646 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 647 | "decimals": 2, 648 | "pattern": "/.*/", 649 | "thresholds": [], 650 | "type": "string", 651 | "unit": "short" 652 | } 653 | ], 654 | "targets": [ 655 | { 656 | "alias": "", 657 | "format": "table", 658 | "rawSql": "SELECT r.prefix as \"Prefix\",g.rpki_origin_as AS \"RPKI Origin AS\",i.origin_as as \"IRR Origin AS\",\"Last Change\", i.descr as \"IRR Description\", i.source as \"IRR Source\"\n\nFROM (\n select\n prefix,\n max(timestamp) as \"Last Change\"\n FROM global_ip_rib\n WHERE recv_origin_as = [[asn_num]]\n GROUP BY prefix\n ) r\n LEFT JOIN info_route i ON (i.prefix = r.prefix)\n LEFT JOIN global_ip_rib g ON (g.prefix = r.prefix)\n\n\n", 659 | "refId": "A" 660 | } 661 | ], 662 | "themeOptions": { 663 | "dark": "./css/datatable-dark.css", 664 | "light": "./css/datatable-light.css" 665 | }, 666 | "themes": [ 667 | { 668 | "disabled": false, 669 | "text": "Basic", 670 | "value": "basic_theme" 671 | }, 672 | { 673 | "disabled": true, 674 | "text": "Bootstrap", 675 | "value": "bootstrap_theme" 676 | }, 677 | { 678 | "disabled": true, 679 | "text": "Foundation", 680 | "value": "foundation_theme" 681 | }, 682 | { 683 | "disabled": true, 684 | "text": "ThemeRoller", 685 | "value": "themeroller_theme" 686 | } 687 | ], 688 | "title": "Advertised Prefixes (multiple shown for all IRR entries)", 689 | "transform": "table", 690 | "type": "briangann-datatable-panel" 691 | } 692 | ], 693 | "schemaVersion": 16, 694 | "style": "dark", 695 | "tags": [], 696 | "templating": { 697 | "list": [ 698 | { 699 | "allValue": null, 700 | "current": { 701 | "text": "3356", 702 | "value": "3356" 703 | }, 704 | "hide": 0, 705 | "includeAll": false, 706 | "label": "ASN", 707 | "multi": false, 708 | "name": "asn_num", 709 | "options": [ 710 | { 711 | "selected": true, 712 | "text": "109", 713 | "value": "109" 714 | } 715 | ], 716 | "query": "109", 717 | "type": "custom" 718 | } 719 | ] 720 | }, 721 | "time": { 722 | "from": "now-3h", 723 | "to": "now" 724 | }, 725 | "timepicker": { 726 | "refresh_intervals": [ 727 | "5s", 728 | "10s", 729 | "30s", 730 | "1m", 731 | "5m", 732 | "15m", 733 | "30m", 734 | "1h", 735 | "2h", 736 | "1d" 737 | ], 738 | "time_options": [ 739 | "5m", 740 | "15m", 741 | "1h", 742 | "6h", 743 | "12h", 744 | "24h", 745 | "2d", 746 | "7d", 747 | "30d" 748 | ] 749 | }, 750 | "timezone": "", 751 | "title": "ASN View", 752 | "uid": "CRZaPcFik", 753 | "version": 21 754 | } -------------------------------------------------------------------------------- /dashboards/postgres/Security/BGP Sec_ Hijack_Leak.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | }, 11 | { 12 | "name": "VAR_ASN", 13 | "type": "constant", 14 | "label": "ASN", 15 | "value": "0", 16 | "description": "" 17 | } 18 | ], 19 | "__requires": [ 20 | { 21 | "type": "panel", 22 | "id": "briangann-datatable-panel", 23 | "name": "Datatable Panel", 24 | "version": "0.0.6" 25 | }, 26 | { 27 | "type": "grafana", 28 | "id": "grafana", 29 | "name": "Grafana", 30 | "version": "5.2.2" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "graph", 35 | "name": "Graph", 36 | "version": "5.0.0" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "postgres", 41 | "name": "PostgreSQL", 42 | "version": "5.0.0" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "singlestat", 47 | "name": "Singlestat", 48 | "version": "5.0.0" 49 | } 50 | ], 51 | "annotations": { 52 | "list": [ 53 | { 54 | "builtIn": 1, 55 | "datasource": "-- Grafana --", 56 | "enable": true, 57 | "hide": true, 58 | "iconColor": "rgba(0, 211, 255, 1)", 59 | "name": "Annotations & Alerts", 60 | "type": "dashboard" 61 | } 62 | ] 63 | }, 64 | "editable": true, 65 | "gnetId": null, 66 | "graphTooltip": 0, 67 | "id": null, 68 | "iteration": 1534274106435, 69 | "links": [], 70 | "panels": [ 71 | { 72 | "cacheTimeout": null, 73 | "colorBackground": true, 74 | "colorValue": false, 75 | "colors": [ 76 | "rgba(245, 54, 54, 0.9)", 77 | "rgba(40, 162, 237, 0.84)", 78 | "rgba(50, 172, 45, 0.97)" 79 | ], 80 | "datasource": "${DS_PSQL}", 81 | "decimals": 0, 82 | "format": "none", 83 | "gauge": { 84 | "maxValue": 100, 85 | "minValue": 0, 86 | "show": false, 87 | "thresholdLabels": false, 88 | "thresholdMarkers": true 89 | }, 90 | "gridPos": { 91 | "h": 3, 92 | "w": 8, 93 | "x": 0, 94 | "y": 0 95 | }, 96 | "id": 7, 97 | "interval": null, 98 | "links": [], 99 | "mappingType": 1, 100 | "mappingTypes": [ 101 | { 102 | "name": "value to text", 103 | "value": 1 104 | }, 105 | { 106 | "name": "range to text", 107 | "value": 2 108 | } 109 | ], 110 | "maxDataPoints": 100, 111 | "nullPointMode": "connected", 112 | "nullText": null, 113 | "postfix": " Alerts", 114 | "postfixFontSize": "50%", 115 | "prefix": "", 116 | "prefixFontSize": "50%", 117 | "rangeMaps": [ 118 | { 119 | "from": "null", 120 | "text": "N/A", 121 | "to": "null" 122 | } 123 | ], 124 | "sparkline": { 125 | "fillColor": "rgba(114, 189, 31, 0.43)", 126 | "full": true, 127 | "lineColor": "rgb(148, 193, 31)", 128 | "show": true 129 | }, 130 | "tableColumn": "count", 131 | "targets": [ 132 | { 133 | "alias": "", 134 | "dsType": "influxdb", 135 | "format": "time_series", 136 | "groupBy": [ 137 | { 138 | "params": [ 139 | "$__interval" 140 | ], 141 | "type": "time" 142 | }, 143 | { 144 | "params": [ 145 | "null" 146 | ], 147 | "type": "fill" 148 | } 149 | ], 150 | "hide": false, 151 | "orderByTime": "ASC", 152 | "policy": "default", 153 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE (\"tag-type\" = 'TRANSIT_LEAK' OR \"tag-type\" = 'TRANSIT_HIJACK') AND $timeFilter GROUP BY time($__interval);", 154 | "rawQuery": true, 155 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('TRANSIT_LEAK', 'TRANSIT_HIJACK')\nGROUP BY time\norder by time\n", 156 | "refId": "A", 157 | "resultFormat": "time_series", 158 | "select": [ 159 | [ 160 | { 161 | "params": [ 162 | "value" 163 | ], 164 | "type": "field" 165 | }, 166 | { 167 | "params": [], 168 | "type": "mean" 169 | } 170 | ] 171 | ], 172 | "tags": [] 173 | } 174 | ], 175 | "thresholds": "", 176 | "title": "Transit Leak/Hijacks", 177 | "type": "singlestat", 178 | "valueFontSize": "80%", 179 | "valueMaps": [ 180 | { 181 | "op": "=", 182 | "text": "N/A", 183 | "value": "null" 184 | } 185 | ], 186 | "valueName": "total" 187 | }, 188 | { 189 | "cacheTimeout": null, 190 | "colorBackground": true, 191 | "colorValue": false, 192 | "colors": [ 193 | "rgba(245, 54, 54, 0.9)", 194 | "rgba(90, 211, 18, 0.84)", 195 | "rgba(50, 172, 45, 0.97)" 196 | ], 197 | "datasource": "${DS_PSQL}", 198 | "decimals": 0, 199 | "format": "none", 200 | "gauge": { 201 | "maxValue": 100, 202 | "minValue": 0, 203 | "show": false, 204 | "thresholdLabels": false, 205 | "thresholdMarkers": true 206 | }, 207 | "gridPos": { 208 | "h": 3, 209 | "w": 8, 210 | "x": 8, 211 | "y": 0 212 | }, 213 | "id": 8, 214 | "interval": null, 215 | "links": [], 216 | "mappingType": 1, 217 | "mappingTypes": [ 218 | { 219 | "name": "value to text", 220 | "value": 1 221 | }, 222 | { 223 | "name": "range to text", 224 | "value": 2 225 | } 226 | ], 227 | "maxDataPoints": 100, 228 | "nullPointMode": "connected", 229 | "nullText": null, 230 | "postfix": " Alerts", 231 | "postfixFontSize": "50%", 232 | "prefix": "", 233 | "prefixFontSize": "50%", 234 | "rangeMaps": [ 235 | { 236 | "from": "null", 237 | "text": "N/A", 238 | "to": "null" 239 | } 240 | ], 241 | "sparkline": { 242 | "fillColor": "rgba(31, 67, 189, 0.43)", 243 | "full": true, 244 | "lineColor": "rgb(31, 93, 193)", 245 | "show": true 246 | }, 247 | "tableColumn": "value", 248 | "targets": [ 249 | { 250 | "alias": "", 251 | "dsType": "influxdb", 252 | "format": "time_series", 253 | "groupBy": [ 254 | { 255 | "params": [ 256 | "$__interval" 257 | ], 258 | "type": "time" 259 | }, 260 | { 261 | "params": [ 262 | "null" 263 | ], 264 | "type": "fill" 265 | } 266 | ], 267 | "hide": false, 268 | "orderByTime": "ASC", 269 | "policy": "default", 270 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE (\"tag-type\" = 'UPSTREAM_LEAK' or \"tag-type\" = 'UPSTREAM_HIJACK') AND $timeFilter GROUP BY time($__interval);", 271 | "rawQuery": true, 272 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('UPSTREAM_LEAK', 'UPSTREAM_HIJACK')\nGROUP BY time\norder by time", 273 | "refId": "A", 274 | "resultFormat": "time_series", 275 | "select": [ 276 | [ 277 | { 278 | "params": [ 279 | "value" 280 | ], 281 | "type": "field" 282 | }, 283 | { 284 | "params": [], 285 | "type": "mean" 286 | } 287 | ] 288 | ], 289 | "tags": [] 290 | } 291 | ], 292 | "thresholds": "", 293 | "title": "Upstream Leak/Hijacks", 294 | "type": "singlestat", 295 | "valueFontSize": "80%", 296 | "valueMaps": [ 297 | { 298 | "op": "=", 299 | "text": "N/A", 300 | "value": "null" 301 | } 302 | ], 303 | "valueName": "total" 304 | }, 305 | { 306 | "cacheTimeout": null, 307 | "colorBackground": true, 308 | "colorValue": false, 309 | "colors": [ 310 | "rgba(245, 54, 54, 0.9)", 311 | "rgba(237, 129, 40, 0.84)", 312 | "rgba(50, 172, 45, 0.97)" 313 | ], 314 | "datasource": "${DS_PSQL}", 315 | "decimals": 0, 316 | "format": "none", 317 | "gauge": { 318 | "maxValue": 100, 319 | "minValue": 0, 320 | "show": false, 321 | "thresholdLabels": false, 322 | "thresholdMarkers": true 323 | }, 324 | "gridPos": { 325 | "h": 3, 326 | "w": 8, 327 | "x": 16, 328 | "y": 0 329 | }, 330 | "id": 6, 331 | "interval": null, 332 | "links": [], 333 | "mappingType": 1, 334 | "mappingTypes": [ 335 | { 336 | "name": "value to text", 337 | "value": 1 338 | }, 339 | { 340 | "name": "range to text", 341 | "value": 2 342 | } 343 | ], 344 | "maxDataPoints": 100, 345 | "nullPointMode": "connected", 346 | "nullText": null, 347 | "postfix": " Alerts", 348 | "postfixFontSize": "50%", 349 | "prefix": "", 350 | "prefixFontSize": "50%", 351 | "rangeMaps": [ 352 | { 353 | "from": "null", 354 | "text": "N/A", 355 | "to": "null" 356 | } 357 | ], 358 | "sparkline": { 359 | "fillColor": "rgba(31, 118, 189, 0.43)", 360 | "full": true, 361 | "lineColor": "rgb(31, 120, 193)", 362 | "show": true 363 | }, 364 | "tableColumn": "value", 365 | "targets": [ 366 | { 367 | "alias": "", 368 | "dsType": "influxdb", 369 | "format": "time_series", 370 | "groupBy": [ 371 | { 372 | "params": [ 373 | "$__interval" 374 | ], 375 | "type": "time" 376 | }, 377 | { 378 | "params": [ 379 | "null" 380 | ], 381 | "type": "fill" 382 | } 383 | ], 384 | "hide": false, 385 | "orderByTime": "ASC", 386 | "policy": "default", 387 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE \"tag-type\" = 'ORIGIN_HIJACK' AND $timeFilter GROUP BY time($__interval);\n", 388 | "rawQuery": true, 389 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('ORIGIN_HIJACK')\nGROUP BY time\norder by time", 390 | "refId": "A", 391 | "resultFormat": "time_series", 392 | "select": [ 393 | [ 394 | { 395 | "params": [ 396 | "value" 397 | ], 398 | "type": "field" 399 | }, 400 | { 401 | "params": [], 402 | "type": "mean" 403 | } 404 | ] 405 | ], 406 | "tags": [] 407 | } 408 | ], 409 | "thresholds": "", 410 | "title": "Origin HiJacks", 411 | "type": "singlestat", 412 | "valueFontSize": "80%", 413 | "valueMaps": [ 414 | { 415 | "op": "=", 416 | "text": "N/A", 417 | "value": "null" 418 | } 419 | ], 420 | "valueName": "total" 421 | }, 422 | { 423 | "aliasColors": {}, 424 | "bars": false, 425 | "dashLength": 10, 426 | "dashes": false, 427 | "datasource": "${DS_PSQL}", 428 | "decimals": 0, 429 | "fill": 1, 430 | "gridPos": { 431 | "h": 5, 432 | "w": 24, 433 | "x": 0, 434 | "y": 3 435 | }, 436 | "id": 17, 437 | "legend": { 438 | "alignAsTable": true, 439 | "avg": true, 440 | "current": false, 441 | "max": true, 442 | "min": false, 443 | "rightSide": true, 444 | "show": true, 445 | "total": true, 446 | "values": true 447 | }, 448 | "lines": true, 449 | "linewidth": 1, 450 | "links": [], 451 | "nullPointMode": "null", 452 | "percentage": false, 453 | "pointradius": 5, 454 | "points": false, 455 | "renderer": "flot", 456 | "seriesOverrides": [], 457 | "spaceLength": 10, 458 | "stack": false, 459 | "steppedLine": false, 460 | "targets": [ 461 | { 462 | "alias": "", 463 | "dsType": "influxdb", 464 | "format": "time_series", 465 | "groupBy": [ 466 | { 467 | "params": [ 468 | "$__interval" 469 | ], 470 | "type": "time" 471 | }, 472 | { 473 | "params": [ 474 | "null" 475 | ], 476 | "type": "fill" 477 | } 478 | ], 479 | "hide": false, 480 | "measurement": "alerts", 481 | "orderByTime": "ASC", 482 | "policy": "10weeks", 483 | "query": "select", 484 | "rawQuery": true, 485 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as alerts\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\ngroup by time\norder by time\n", 486 | "refId": "A", 487 | "resultFormat": "time_series", 488 | "select": [ 489 | [ 490 | { 491 | "params": [ 492 | "message" 493 | ], 494 | "type": "field" 495 | }, 496 | { 497 | "params": [], 498 | "type": "count" 499 | } 500 | ] 501 | ], 502 | "tags": [] 503 | }, 504 | { 505 | "alias": "", 506 | "format": "time_series", 507 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(monitored_asn) as asns\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\ngroup by monitored_asn,time\norder by time\n", 508 | "refId": "B" 509 | }, 510 | { 511 | "alias": "", 512 | "format": "time_series", 513 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(affected_prefix) as prefixes\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\ngroup by time,affected_prefix\norder by time\n", 514 | "refId": "C" 515 | } 516 | ], 517 | "thresholds": [], 518 | "timeFrom": null, 519 | "timeShift": null, 520 | "title": "Alert Counts", 521 | "tooltip": { 522 | "shared": true, 523 | "sort": 0, 524 | "value_type": "individual" 525 | }, 526 | "type": "graph", 527 | "xaxis": { 528 | "buckets": null, 529 | "mode": "time", 530 | "name": null, 531 | "show": true, 532 | "values": [] 533 | }, 534 | "yaxes": [ 535 | { 536 | "format": "short", 537 | "label": null, 538 | "logBase": 1, 539 | "max": null, 540 | "min": null, 541 | "show": true 542 | }, 543 | { 544 | "format": "short", 545 | "label": null, 546 | "logBase": 1, 547 | "max": null, 548 | "min": null, 549 | "show": true 550 | } 551 | ], 552 | "yaxis": { 553 | "align": false, 554 | "alignLevel": null 555 | } 556 | }, 557 | { 558 | "aliasColors": {}, 559 | "bars": true, 560 | "dashLength": 10, 561 | "dashes": false, 562 | "datasource": "${DS_PSQL}", 563 | "decimals": 0, 564 | "description": "Count of alerts by offending ASNs", 565 | "fill": 1, 566 | "gridPos": { 567 | "h": 8, 568 | "w": 12, 569 | "x": 0, 570 | "y": 8 571 | }, 572 | "id": 10, 573 | "legend": { 574 | "alignAsTable": true, 575 | "avg": true, 576 | "current": false, 577 | "hideEmpty": true, 578 | "hideZero": true, 579 | "max": true, 580 | "min": false, 581 | "rightSide": true, 582 | "show": true, 583 | "sort": "max", 584 | "sortDesc": true, 585 | "total": false, 586 | "values": true 587 | }, 588 | "lines": false, 589 | "linewidth": 1, 590 | "links": [], 591 | "nullPointMode": "null", 592 | "percentage": false, 593 | "pointradius": 5, 594 | "points": false, 595 | "renderer": "flot", 596 | "seriesOverrides": [], 597 | "spaceLength": 10, 598 | "stack": false, 599 | "steppedLine": false, 600 | "targets": [ 601 | { 602 | "alias": "", 603 | "dsType": "influxdb", 604 | "format": "time_series", 605 | "groupBy": [ 606 | { 607 | "params": [ 608 | "$__interval" 609 | ], 610 | "type": "time" 611 | }, 612 | { 613 | "params": [ 614 | "tag-offending_asn" 615 | ], 616 | "type": "tag" 617 | }, 618 | { 619 | "params": [ 620 | "null" 621 | ], 622 | "type": "fill" 623 | } 624 | ], 625 | "hide": false, 626 | "limit": "", 627 | "measurement": "alerts", 628 | "orderByTime": "ASC", 629 | "policy": "10weeks", 630 | "query": "SELECT count(\"message\") as items FROM \"10weeks\".\"alerts\" WHERE $timeFilter GROUP BY time(60s),\"tag-offending_asn\" fill(none) ", 631 | "rawQuery": true, 632 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as value,\n offending_asn::text as metric\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\ngroup by time,offending_asn\norder by time\n", 633 | "refId": "A", 634 | "resultFormat": "time_series", 635 | "select": [ 636 | [ 637 | { 638 | "params": [ 639 | "message" 640 | ], 641 | "type": "field" 642 | }, 643 | { 644 | "params": [], 645 | "type": "count" 646 | } 647 | ] 648 | ], 649 | "slimit": "25", 650 | "tags": [ 651 | { 652 | "key": "tag-offending_asn", 653 | "operator": "<>", 654 | "value": "''" 655 | } 656 | ] 657 | } 658 | ], 659 | "thresholds": [], 660 | "timeFrom": null, 661 | "timeShift": null, 662 | "title": "Offending ASNs", 663 | "tooltip": { 664 | "shared": false, 665 | "sort": 0, 666 | "value_type": "individual" 667 | }, 668 | "type": "graph", 669 | "xaxis": { 670 | "buckets": null, 671 | "mode": "time", 672 | "name": null, 673 | "show": true, 674 | "values": [] 675 | }, 676 | "yaxes": [ 677 | { 678 | "decimals": 0, 679 | "format": "none", 680 | "label": "Count of Alerts", 681 | "logBase": 1, 682 | "max": null, 683 | "min": null, 684 | "show": true 685 | }, 686 | { 687 | "format": "short", 688 | "label": "", 689 | "logBase": 1, 690 | "max": null, 691 | "min": null, 692 | "show": false 693 | } 694 | ], 695 | "yaxis": { 696 | "align": false, 697 | "alignLevel": null 698 | } 699 | }, 700 | { 701 | "aliasColors": {}, 702 | "bars": true, 703 | "dashLength": 10, 704 | "dashes": false, 705 | "datasource": "${DS_PSQL}", 706 | "decimals": 0, 707 | "description": "Count of alerts by monitored ASNs", 708 | "fill": 1, 709 | "gridPos": { 710 | "h": 8, 711 | "w": 12, 712 | "x": 12, 713 | "y": 8 714 | }, 715 | "id": 16, 716 | "legend": { 717 | "alignAsTable": true, 718 | "avg": true, 719 | "current": false, 720 | "hideEmpty": true, 721 | "hideZero": true, 722 | "max": true, 723 | "min": false, 724 | "rightSide": true, 725 | "show": true, 726 | "sort": "max", 727 | "sortDesc": true, 728 | "total": false, 729 | "values": true 730 | }, 731 | "lines": false, 732 | "linewidth": 1, 733 | "links": [], 734 | "nullPointMode": "null", 735 | "percentage": false, 736 | "pointradius": 5, 737 | "points": false, 738 | "renderer": "flot", 739 | "seriesOverrides": [], 740 | "spaceLength": 10, 741 | "stack": false, 742 | "steppedLine": false, 743 | "targets": [ 744 | { 745 | "alias": "", 746 | "dsType": "influxdb", 747 | "format": "time_series", 748 | "groupBy": [ 749 | { 750 | "params": [ 751 | "$__interval" 752 | ], 753 | "type": "time" 754 | }, 755 | { 756 | "params": [ 757 | "tag-offending_asn" 758 | ], 759 | "type": "tag" 760 | }, 761 | { 762 | "params": [ 763 | "null" 764 | ], 765 | "type": "fill" 766 | } 767 | ], 768 | "hide": false, 769 | "limit": "", 770 | "measurement": "alerts", 771 | "orderByTime": "ASC", 772 | "policy": "10weeks", 773 | "query": "SELECT count(\"message\") as items FROM \"10weeks\".\"alerts\" WHERE $timeFilter GROUP BY time(60s),\"tag-monitored_asn\" fill(none) ", 774 | "rawQuery": true, 775 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as value,\n monitored_asn::text as metric\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\ngroup by time,monitored_asn\norder by time\n", 776 | "refId": "A", 777 | "resultFormat": "time_series", 778 | "select": [ 779 | [ 780 | { 781 | "params": [ 782 | "message" 783 | ], 784 | "type": "field" 785 | }, 786 | { 787 | "params": [], 788 | "type": "count" 789 | } 790 | ] 791 | ], 792 | "slimit": "25", 793 | "tags": [ 794 | { 795 | "key": "tag-offending_asn", 796 | "operator": "<>", 797 | "value": "''" 798 | } 799 | ] 800 | } 801 | ], 802 | "thresholds": [], 803 | "timeFrom": null, 804 | "timeShift": null, 805 | "title": "Monitored ASNs", 806 | "tooltip": { 807 | "shared": false, 808 | "sort": 0, 809 | "value_type": "individual" 810 | }, 811 | "type": "graph", 812 | "xaxis": { 813 | "buckets": null, 814 | "mode": "time", 815 | "name": null, 816 | "show": true, 817 | "values": [] 818 | }, 819 | "yaxes": [ 820 | { 821 | "decimals": 0, 822 | "format": "none", 823 | "label": "Count of Alerts", 824 | "logBase": 1, 825 | "max": null, 826 | "min": null, 827 | "show": true 828 | }, 829 | { 830 | "format": "short", 831 | "label": "", 832 | "logBase": 1, 833 | "max": null, 834 | "min": null, 835 | "show": false 836 | } 837 | ], 838 | "yaxis": { 839 | "align": false, 840 | "alignLevel": null 841 | } 842 | }, 843 | { 844 | "columns": [], 845 | "compactRowsEnabled": false, 846 | "datasource": "${DS_PSQL}", 847 | "datatablePagingType": "simple_numbers", 848 | "datatableTheme": "basic_theme", 849 | "emptyData": false, 850 | "fontSize": "100%", 851 | "gridPos": { 852 | "h": 13, 853 | "w": 24, 854 | "x": 0, 855 | "y": 16 856 | }, 857 | "hoverEnabled": true, 858 | "id": 15, 859 | "infoEnabled": true, 860 | "lengthChangeEnabled": true, 861 | "links": [], 862 | "orderColumnEnabled": true, 863 | "pagingTypes": [ 864 | { 865 | "text": "Page number buttons only", 866 | "value": "numbers" 867 | }, 868 | { 869 | "text": "'Previous' and 'Next' buttons only", 870 | "value": "simple" 871 | }, 872 | { 873 | "text": "'Previous' and 'Next' buttons, plus page numbers", 874 | "value": "simple_numbers" 875 | }, 876 | { 877 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 878 | "value": "full" 879 | }, 880 | { 881 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 882 | "value": "full_numbers" 883 | }, 884 | { 885 | "text": "'First' and 'Last' buttons, plus page numbers", 886 | "value": "first_last_numbers" 887 | } 888 | ], 889 | "panelHeight": 481, 890 | "rowNumbersEnabled": false, 891 | "rowsPerPage": 10, 892 | "scroll": true, 893 | "scrollHeight": "default", 894 | "searchEnabled": true, 895 | "showCellBorders": false, 896 | "showHeader": true, 897 | "showRowBorders": true, 898 | "sort": { 899 | "col": 0, 900 | "desc": true 901 | }, 902 | "stripedRowsEnabled": true, 903 | "styles": [ 904 | { 905 | "dateFormat": "YYYY-MM-DD HH:mm:ss.SSS", 906 | "pattern": "Time", 907 | "type": "date" 908 | }, 909 | { 910 | "colorMode": null, 911 | "colors": [ 912 | "rgba(245, 54, 54, 0.9)", 913 | "rgba(237, 129, 40, 0.89)", 914 | "rgba(50, 172, 45, 0.97)" 915 | ], 916 | "column": "", 917 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 918 | "decimals": 2, 919 | "link": true, 920 | "pattern": "History", 921 | "thresholds": [], 922 | "type": "string", 923 | "unit": "short" 924 | }, 925 | { 926 | "colorMode": null, 927 | "colors": [ 928 | "rgba(245, 54, 54, 0.9)", 929 | "rgba(237, 129, 40, 0.89)", 930 | "rgba(50, 172, 45, 0.97)" 931 | ], 932 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 933 | "decimals": 2, 934 | "pattern": "/.*/", 935 | "thresholds": [], 936 | "type": "string", 937 | "unit": "short" 938 | } 939 | ], 940 | "targets": [ 941 | { 942 | "alias": "", 943 | "dsType": "influxdb", 944 | "format": "table", 945 | "groupBy": [ 946 | { 947 | "params": [ 948 | "$__interval" 949 | ], 950 | "type": "time" 951 | }, 952 | { 953 | "params": [ 954 | "null" 955 | ], 956 | "type": "fill" 957 | } 958 | ], 959 | "hide": false, 960 | "measurement": "alerts", 961 | "orderByTime": "ASC", 962 | "policy": "10weeks", 963 | "query": "", 964 | "rawQuery": true, 965 | "rawSql": "SELECT\n timestamp as \"Time\", type, left(monitored_asname,32) as \"Monitored\", left(offending_asname, 32) as \"Offending\", message, history_url as \"History\"\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n AND ([[asn]] <= 0 or monitored_asn = [[asn]] or offending_asn = [[asn]])\n", 966 | "refId": "A", 967 | "resultFormat": "table", 968 | "select": [ 969 | [ 970 | { 971 | "params": [ 972 | "value" 973 | ], 974 | "type": "field" 975 | } 976 | ] 977 | ], 978 | "tags": [] 979 | } 980 | ], 981 | "themeOptions": { 982 | "dark": "./css/datatable-dark.css", 983 | "light": "./css/datatable-light.css" 984 | }, 985 | "themes": [ 986 | { 987 | "disabled": false, 988 | "text": "Basic", 989 | "value": "basic_theme" 990 | }, 991 | { 992 | "disabled": true, 993 | "text": "Bootstrap", 994 | "value": "bootstrap_theme" 995 | }, 996 | { 997 | "disabled": true, 998 | "text": "Foundation", 999 | "value": "foundation_theme" 1000 | }, 1001 | { 1002 | "disabled": true, 1003 | "text": "ThemeRoller", 1004 | "value": "themeroller_theme" 1005 | } 1006 | ], 1007 | "title": "Alerts", 1008 | "transform": "table", 1009 | "type": "briangann-datatable-panel" 1010 | } 1011 | ], 1012 | "refresh": false, 1013 | "schemaVersion": 16, 1014 | "style": "dark", 1015 | "tags": [], 1016 | "templating": { 1017 | "list": [ 1018 | { 1019 | "current": { 1020 | "value": "${VAR_ASN}", 1021 | "text": "${VAR_ASN}" 1022 | }, 1023 | "hide": 0, 1024 | "label": "ASN", 1025 | "name": "asn", 1026 | "options": [ 1027 | { 1028 | "value": "${VAR_ASN}", 1029 | "text": "${VAR_ASN}" 1030 | } 1031 | ], 1032 | "query": "${VAR_ASN}", 1033 | "type": "constant" 1034 | } 1035 | ] 1036 | }, 1037 | "time": { 1038 | "from": "now-3h", 1039 | "to": "now" 1040 | }, 1041 | "timepicker": { 1042 | "refresh_intervals": [ 1043 | "5s", 1044 | "10s", 1045 | "30s", 1046 | "1m", 1047 | "5m", 1048 | "15m", 1049 | "30m", 1050 | "1h", 1051 | "2h", 1052 | "1d" 1053 | ], 1054 | "time_options": [ 1055 | "5m", 1056 | "15m", 1057 | "1h", 1058 | "6h", 1059 | "12h", 1060 | "24h", 1061 | "2d", 1062 | "7d", 1063 | "30d" 1064 | ] 1065 | }, 1066 | "timezone": "utc", 1067 | "title": "BGP Sec: Hijack/Leak", 1068 | "uid": "000000005", 1069 | "version": 67 1070 | } -------------------------------------------------------------------------------- /dashboards/postgres/Security/BGP Sec_ Hijack_Leak (by AS Name).json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PSQL", 5 | "label": "psql", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "postgres", 9 | "pluginName": "PostgreSQL" 10 | }, 11 | { 12 | "name": "VAR_AS_NAME", 13 | "type": "constant", 14 | "label": "AS Name", 15 | "value": "google", 16 | "description": "" 17 | } 18 | ], 19 | "__requires": [ 20 | { 21 | "type": "panel", 22 | "id": "briangann-datatable-panel", 23 | "name": "Datatable Panel", 24 | "version": "0.0.6" 25 | }, 26 | { 27 | "type": "grafana", 28 | "id": "grafana", 29 | "name": "Grafana", 30 | "version": "5.2.2" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "graph", 35 | "name": "Graph", 36 | "version": "5.0.0" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "postgres", 41 | "name": "PostgreSQL", 42 | "version": "5.0.0" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "singlestat", 47 | "name": "Singlestat", 48 | "version": "5.0.0" 49 | } 50 | ], 51 | "annotations": { 52 | "list": [ 53 | { 54 | "builtIn": 1, 55 | "datasource": "-- Grafana --", 56 | "enable": true, 57 | "hide": true, 58 | "iconColor": "rgba(0, 211, 255, 1)", 59 | "name": "Annotations & Alerts", 60 | "type": "dashboard" 61 | } 62 | ] 63 | }, 64 | "editable": true, 65 | "gnetId": null, 66 | "graphTooltip": 0, 67 | "id": null, 68 | "iteration": 1534274116907, 69 | "links": [], 70 | "panels": [ 71 | { 72 | "cacheTimeout": null, 73 | "colorBackground": true, 74 | "colorValue": false, 75 | "colors": [ 76 | "rgba(245, 54, 54, 0.9)", 77 | "rgba(40, 162, 237, 0.84)", 78 | "rgba(50, 172, 45, 0.97)" 79 | ], 80 | "datasource": "${DS_PSQL}", 81 | "decimals": 0, 82 | "format": "none", 83 | "gauge": { 84 | "maxValue": 100, 85 | "minValue": 0, 86 | "show": false, 87 | "thresholdLabels": false, 88 | "thresholdMarkers": true 89 | }, 90 | "gridPos": { 91 | "h": 3, 92 | "w": 8, 93 | "x": 0, 94 | "y": 0 95 | }, 96 | "id": 7, 97 | "interval": null, 98 | "links": [], 99 | "mappingType": 1, 100 | "mappingTypes": [ 101 | { 102 | "name": "value to text", 103 | "value": 1 104 | }, 105 | { 106 | "name": "range to text", 107 | "value": 2 108 | } 109 | ], 110 | "maxDataPoints": 100, 111 | "nullPointMode": "connected", 112 | "nullText": null, 113 | "postfix": " Alerts", 114 | "postfixFontSize": "50%", 115 | "prefix": "", 116 | "prefixFontSize": "50%", 117 | "rangeMaps": [ 118 | { 119 | "from": "null", 120 | "text": "N/A", 121 | "to": "null" 122 | } 123 | ], 124 | "sparkline": { 125 | "fillColor": "rgba(114, 189, 31, 0.43)", 126 | "full": true, 127 | "lineColor": "rgb(148, 193, 31)", 128 | "show": true 129 | }, 130 | "tableColumn": "count", 131 | "targets": [ 132 | { 133 | "alias": "", 134 | "dsType": "influxdb", 135 | "format": "time_series", 136 | "groupBy": [ 137 | { 138 | "params": [ 139 | "$__interval" 140 | ], 141 | "type": "time" 142 | }, 143 | { 144 | "params": [ 145 | "null" 146 | ], 147 | "type": "fill" 148 | } 149 | ], 150 | "hide": false, 151 | "orderByTime": "ASC", 152 | "policy": "default", 153 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE (\"tag-type\" = 'TRANSIT_LEAK' OR \"tag-type\" = 'TRANSIT_HIJACK') AND $timeFilter GROUP BY time($__interval);", 154 | "rawQuery": true, 155 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('TRANSIT_LEAK', 'TRANSIT_HIJACK')\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\nGROUP BY time\norder by time\n", 156 | "refId": "A", 157 | "resultFormat": "time_series", 158 | "select": [ 159 | [ 160 | { 161 | "params": [ 162 | "value" 163 | ], 164 | "type": "field" 165 | }, 166 | { 167 | "params": [], 168 | "type": "mean" 169 | } 170 | ] 171 | ], 172 | "tags": [] 173 | } 174 | ], 175 | "thresholds": "", 176 | "title": "Transit Leak/Hijacks", 177 | "type": "singlestat", 178 | "valueFontSize": "80%", 179 | "valueMaps": [ 180 | { 181 | "op": "=", 182 | "text": "N/A", 183 | "value": "null" 184 | } 185 | ], 186 | "valueName": "total" 187 | }, 188 | { 189 | "cacheTimeout": null, 190 | "colorBackground": true, 191 | "colorValue": false, 192 | "colors": [ 193 | "rgba(245, 54, 54, 0.9)", 194 | "rgba(90, 211, 18, 0.84)", 195 | "rgba(50, 172, 45, 0.97)" 196 | ], 197 | "datasource": "${DS_PSQL}", 198 | "decimals": 0, 199 | "format": "none", 200 | "gauge": { 201 | "maxValue": 100, 202 | "minValue": 0, 203 | "show": false, 204 | "thresholdLabels": false, 205 | "thresholdMarkers": true 206 | }, 207 | "gridPos": { 208 | "h": 3, 209 | "w": 8, 210 | "x": 8, 211 | "y": 0 212 | }, 213 | "id": 8, 214 | "interval": null, 215 | "links": [], 216 | "mappingType": 1, 217 | "mappingTypes": [ 218 | { 219 | "name": "value to text", 220 | "value": 1 221 | }, 222 | { 223 | "name": "range to text", 224 | "value": 2 225 | } 226 | ], 227 | "maxDataPoints": 100, 228 | "nullPointMode": "connected", 229 | "nullText": null, 230 | "postfix": " Alerts", 231 | "postfixFontSize": "50%", 232 | "prefix": "", 233 | "prefixFontSize": "50%", 234 | "rangeMaps": [ 235 | { 236 | "from": "null", 237 | "text": "N/A", 238 | "to": "null" 239 | } 240 | ], 241 | "sparkline": { 242 | "fillColor": "rgba(31, 67, 189, 0.43)", 243 | "full": true, 244 | "lineColor": "rgb(31, 93, 193)", 245 | "show": true 246 | }, 247 | "tableColumn": "value", 248 | "targets": [ 249 | { 250 | "alias": "", 251 | "dsType": "influxdb", 252 | "format": "time_series", 253 | "groupBy": [ 254 | { 255 | "params": [ 256 | "$__interval" 257 | ], 258 | "type": "time" 259 | }, 260 | { 261 | "params": [ 262 | "null" 263 | ], 264 | "type": "fill" 265 | } 266 | ], 267 | "hide": false, 268 | "orderByTime": "ASC", 269 | "policy": "default", 270 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE (\"tag-type\" = 'UPSTREAM_LEAK' or \"tag-type\" = 'UPSTREAM_HIJACK') AND $timeFilter GROUP BY time($__interval);", 271 | "rawQuery": true, 272 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('UPSTREAM_LEAK', 'UPSTREAM_HIJACK')\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\nGROUP BY time\norder by time", 273 | "refId": "A", 274 | "resultFormat": "time_series", 275 | "select": [ 276 | [ 277 | { 278 | "params": [ 279 | "value" 280 | ], 281 | "type": "field" 282 | }, 283 | { 284 | "params": [], 285 | "type": "mean" 286 | } 287 | ] 288 | ], 289 | "tags": [] 290 | } 291 | ], 292 | "thresholds": "", 293 | "title": "Upstream Leak/Hijacks", 294 | "type": "singlestat", 295 | "valueFontSize": "80%", 296 | "valueMaps": [ 297 | { 298 | "op": "=", 299 | "text": "N/A", 300 | "value": "null" 301 | } 302 | ], 303 | "valueName": "total" 304 | }, 305 | { 306 | "cacheTimeout": null, 307 | "colorBackground": true, 308 | "colorValue": false, 309 | "colors": [ 310 | "rgba(245, 54, 54, 0.9)", 311 | "rgba(237, 129, 40, 0.84)", 312 | "rgba(50, 172, 45, 0.97)" 313 | ], 314 | "datasource": "${DS_PSQL}", 315 | "decimals": 0, 316 | "format": "none", 317 | "gauge": { 318 | "maxValue": 100, 319 | "minValue": 0, 320 | "show": false, 321 | "thresholdLabels": false, 322 | "thresholdMarkers": true 323 | }, 324 | "gridPos": { 325 | "h": 3, 326 | "w": 8, 327 | "x": 16, 328 | "y": 0 329 | }, 330 | "id": 6, 331 | "interval": null, 332 | "links": [], 333 | "mappingType": 1, 334 | "mappingTypes": [ 335 | { 336 | "name": "value to text", 337 | "value": 1 338 | }, 339 | { 340 | "name": "range to text", 341 | "value": 2 342 | } 343 | ], 344 | "maxDataPoints": 100, 345 | "nullPointMode": "connected", 346 | "nullText": null, 347 | "postfix": " Alerts", 348 | "postfixFontSize": "50%", 349 | "prefix": "", 350 | "prefixFontSize": "50%", 351 | "rangeMaps": [ 352 | { 353 | "from": "null", 354 | "text": "N/A", 355 | "to": "null" 356 | } 357 | ], 358 | "sparkline": { 359 | "fillColor": "rgba(31, 118, 189, 0.43)", 360 | "full": true, 361 | "lineColor": "rgb(31, 120, 193)", 362 | "show": true 363 | }, 364 | "tableColumn": "value", 365 | "targets": [ 366 | { 367 | "alias": "", 368 | "dsType": "influxdb", 369 | "format": "time_series", 370 | "groupBy": [ 371 | { 372 | "params": [ 373 | "$__interval" 374 | ], 375 | "type": "time" 376 | }, 377 | { 378 | "params": [ 379 | "null" 380 | ], 381 | "type": "fill" 382 | } 383 | ], 384 | "hide": false, 385 | "orderByTime": "ASC", 386 | "policy": "default", 387 | "query": "SELECT count(distinct(\"prefix\")) FROM \"alerts\" WHERE \"tag-type\" = 'ORIGIN_HIJACK' AND $timeFilter GROUP BY time($__interval);\n", 388 | "rawQuery": true, 389 | "rawSql": "SELECT \n $__timeGroup(timestamp, $__interval),\n count(message) \nFROM alerts \nWHERE $__timeFilter(timestamp)\n AND type in ('ORIGIN_HIJACK')\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\nGROUP BY time\norder by time", 390 | "refId": "A", 391 | "resultFormat": "time_series", 392 | "select": [ 393 | [ 394 | { 395 | "params": [ 396 | "value" 397 | ], 398 | "type": "field" 399 | }, 400 | { 401 | "params": [], 402 | "type": "mean" 403 | } 404 | ] 405 | ], 406 | "tags": [] 407 | } 408 | ], 409 | "thresholds": "", 410 | "title": "Origin HiJacks", 411 | "type": "singlestat", 412 | "valueFontSize": "80%", 413 | "valueMaps": [ 414 | { 415 | "op": "=", 416 | "text": "N/A", 417 | "value": "null" 418 | } 419 | ], 420 | "valueName": "total" 421 | }, 422 | { 423 | "aliasColors": {}, 424 | "bars": false, 425 | "dashLength": 10, 426 | "dashes": false, 427 | "datasource": "${DS_PSQL}", 428 | "decimals": 0, 429 | "fill": 1, 430 | "gridPos": { 431 | "h": 5, 432 | "w": 24, 433 | "x": 0, 434 | "y": 3 435 | }, 436 | "id": 17, 437 | "legend": { 438 | "alignAsTable": true, 439 | "avg": true, 440 | "current": false, 441 | "max": true, 442 | "min": false, 443 | "rightSide": true, 444 | "show": true, 445 | "total": true, 446 | "values": true 447 | }, 448 | "lines": true, 449 | "linewidth": 1, 450 | "links": [], 451 | "nullPointMode": "null", 452 | "percentage": false, 453 | "pointradius": 5, 454 | "points": false, 455 | "renderer": "flot", 456 | "seriesOverrides": [], 457 | "spaceLength": 10, 458 | "stack": false, 459 | "steppedLine": false, 460 | "targets": [ 461 | { 462 | "alias": "", 463 | "dsType": "influxdb", 464 | "format": "time_series", 465 | "groupBy": [ 466 | { 467 | "params": [ 468 | "$__interval" 469 | ], 470 | "type": "time" 471 | }, 472 | { 473 | "params": [ 474 | "null" 475 | ], 476 | "type": "fill" 477 | } 478 | ], 479 | "hide": false, 480 | "measurement": "alerts", 481 | "orderByTime": "ASC", 482 | "policy": "10weeks", 483 | "query": "select", 484 | "rawQuery": true, 485 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as alerts\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\ngroup by time\norder by time\n", 486 | "refId": "A", 487 | "resultFormat": "time_series", 488 | "select": [ 489 | [ 490 | { 491 | "params": [ 492 | "message" 493 | ], 494 | "type": "field" 495 | }, 496 | { 497 | "params": [], 498 | "type": "count" 499 | } 500 | ] 501 | ], 502 | "tags": [] 503 | }, 504 | { 505 | "alias": "", 506 | "format": "time_series", 507 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(monitored_asn) as asns\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\ngroup by monitored_asn,time\norder by time\n", 508 | "refId": "B" 509 | }, 510 | { 511 | "alias": "", 512 | "format": "time_series", 513 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(affected_prefix) as prefixes\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\ngroup by time,affected_prefix\norder by time\n", 514 | "refId": "C" 515 | } 516 | ], 517 | "thresholds": [], 518 | "timeFrom": null, 519 | "timeShift": null, 520 | "title": "Alert Counts", 521 | "tooltip": { 522 | "shared": true, 523 | "sort": 0, 524 | "value_type": "individual" 525 | }, 526 | "type": "graph", 527 | "xaxis": { 528 | "buckets": null, 529 | "mode": "time", 530 | "name": null, 531 | "show": true, 532 | "values": [] 533 | }, 534 | "yaxes": [ 535 | { 536 | "format": "short", 537 | "label": null, 538 | "logBase": 1, 539 | "max": null, 540 | "min": null, 541 | "show": true 542 | }, 543 | { 544 | "format": "short", 545 | "label": null, 546 | "logBase": 1, 547 | "max": null, 548 | "min": null, 549 | "show": true 550 | } 551 | ], 552 | "yaxis": { 553 | "align": false, 554 | "alignLevel": null 555 | } 556 | }, 557 | { 558 | "aliasColors": {}, 559 | "bars": true, 560 | "dashLength": 10, 561 | "dashes": false, 562 | "datasource": "${DS_PSQL}", 563 | "decimals": 0, 564 | "description": "Count of alerts by offending ASNs", 565 | "fill": 1, 566 | "gridPos": { 567 | "h": 8, 568 | "w": 12, 569 | "x": 0, 570 | "y": 8 571 | }, 572 | "id": 10, 573 | "legend": { 574 | "alignAsTable": true, 575 | "avg": true, 576 | "current": false, 577 | "hideEmpty": true, 578 | "hideZero": true, 579 | "max": true, 580 | "min": false, 581 | "rightSide": true, 582 | "show": true, 583 | "sort": "max", 584 | "sortDesc": true, 585 | "total": false, 586 | "values": true 587 | }, 588 | "lines": false, 589 | "linewidth": 1, 590 | "links": [], 591 | "nullPointMode": "null", 592 | "percentage": false, 593 | "pointradius": 5, 594 | "points": false, 595 | "renderer": "flot", 596 | "seriesOverrides": [], 597 | "spaceLength": 10, 598 | "stack": false, 599 | "steppedLine": false, 600 | "targets": [ 601 | { 602 | "alias": "", 603 | "dsType": "influxdb", 604 | "format": "time_series", 605 | "groupBy": [ 606 | { 607 | "params": [ 608 | "$__interval" 609 | ], 610 | "type": "time" 611 | }, 612 | { 613 | "params": [ 614 | "tag-offending_asn" 615 | ], 616 | "type": "tag" 617 | }, 618 | { 619 | "params": [ 620 | "null" 621 | ], 622 | "type": "fill" 623 | } 624 | ], 625 | "hide": false, 626 | "limit": "", 627 | "measurement": "alerts", 628 | "orderByTime": "ASC", 629 | "policy": "10weeks", 630 | "query": "SELECT count(\"message\") as items FROM \"10weeks\".\"alerts\" WHERE $timeFilter GROUP BY time(60s),\"tag-offending_asn\" fill(none) ", 631 | "rawQuery": true, 632 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as value,\n offending_asn::text as metric\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\ngroup by time,offending_asn\norder by time\n", 633 | "refId": "A", 634 | "resultFormat": "time_series", 635 | "select": [ 636 | [ 637 | { 638 | "params": [ 639 | "message" 640 | ], 641 | "type": "field" 642 | }, 643 | { 644 | "params": [], 645 | "type": "count" 646 | } 647 | ] 648 | ], 649 | "slimit": "25", 650 | "tags": [ 651 | { 652 | "key": "tag-offending_asn", 653 | "operator": "<>", 654 | "value": "''" 655 | } 656 | ] 657 | } 658 | ], 659 | "thresholds": [], 660 | "timeFrom": null, 661 | "timeShift": null, 662 | "title": "Offending ASNs", 663 | "tooltip": { 664 | "shared": false, 665 | "sort": 0, 666 | "value_type": "individual" 667 | }, 668 | "type": "graph", 669 | "xaxis": { 670 | "buckets": null, 671 | "mode": "time", 672 | "name": null, 673 | "show": true, 674 | "values": [] 675 | }, 676 | "yaxes": [ 677 | { 678 | "decimals": 0, 679 | "format": "none", 680 | "label": "Count of Alerts", 681 | "logBase": 1, 682 | "max": null, 683 | "min": null, 684 | "show": true 685 | }, 686 | { 687 | "format": "short", 688 | "label": "", 689 | "logBase": 1, 690 | "max": null, 691 | "min": null, 692 | "show": false 693 | } 694 | ], 695 | "yaxis": { 696 | "align": false, 697 | "alignLevel": null 698 | } 699 | }, 700 | { 701 | "aliasColors": {}, 702 | "bars": true, 703 | "dashLength": 10, 704 | "dashes": false, 705 | "datasource": "${DS_PSQL}", 706 | "decimals": 0, 707 | "description": "Count of alerts by monitored ASNs", 708 | "fill": 1, 709 | "gridPos": { 710 | "h": 8, 711 | "w": 12, 712 | "x": 12, 713 | "y": 8 714 | }, 715 | "id": 16, 716 | "legend": { 717 | "alignAsTable": true, 718 | "avg": true, 719 | "current": false, 720 | "hideEmpty": true, 721 | "hideZero": true, 722 | "max": true, 723 | "min": false, 724 | "rightSide": true, 725 | "show": true, 726 | "sort": "max", 727 | "sortDesc": true, 728 | "total": false, 729 | "values": true 730 | }, 731 | "lines": false, 732 | "linewidth": 1, 733 | "links": [], 734 | "nullPointMode": "null", 735 | "percentage": false, 736 | "pointradius": 5, 737 | "points": false, 738 | "renderer": "flot", 739 | "seriesOverrides": [], 740 | "spaceLength": 10, 741 | "stack": false, 742 | "steppedLine": false, 743 | "targets": [ 744 | { 745 | "alias": "", 746 | "dsType": "influxdb", 747 | "format": "time_series", 748 | "groupBy": [ 749 | { 750 | "params": [ 751 | "$__interval" 752 | ], 753 | "type": "time" 754 | }, 755 | { 756 | "params": [ 757 | "tag-offending_asn" 758 | ], 759 | "type": "tag" 760 | }, 761 | { 762 | "params": [ 763 | "null" 764 | ], 765 | "type": "fill" 766 | } 767 | ], 768 | "hide": false, 769 | "limit": "", 770 | "measurement": "alerts", 771 | "orderByTime": "ASC", 772 | "policy": "10weeks", 773 | "query": "SELECT count(\"message\") as items FROM \"10weeks\".\"alerts\" WHERE $timeFilter GROUP BY time(60s),\"tag-monitored_asn\" fill(none) ", 774 | "rawQuery": true, 775 | "rawSql": "SELECT\n $__timeGroup(timestamp, '3m'),\n count(message) as value,\n monitored_asn::text as metric\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\ngroup by time,monitored_asn\norder by time\n", 776 | "refId": "A", 777 | "resultFormat": "time_series", 778 | "select": [ 779 | [ 780 | { 781 | "params": [ 782 | "message" 783 | ], 784 | "type": "field" 785 | }, 786 | { 787 | "params": [], 788 | "type": "count" 789 | } 790 | ] 791 | ], 792 | "slimit": "25", 793 | "tags": [ 794 | { 795 | "key": "tag-offending_asn", 796 | "operator": "<>", 797 | "value": "''" 798 | } 799 | ] 800 | } 801 | ], 802 | "thresholds": [], 803 | "timeFrom": null, 804 | "timeShift": null, 805 | "title": "Monitored ASNs", 806 | "tooltip": { 807 | "shared": false, 808 | "sort": 0, 809 | "value_type": "individual" 810 | }, 811 | "type": "graph", 812 | "xaxis": { 813 | "buckets": null, 814 | "mode": "time", 815 | "name": null, 816 | "show": true, 817 | "values": [] 818 | }, 819 | "yaxes": [ 820 | { 821 | "decimals": 0, 822 | "format": "none", 823 | "label": "Count of Alerts", 824 | "logBase": 1, 825 | "max": null, 826 | "min": null, 827 | "show": true 828 | }, 829 | { 830 | "format": "short", 831 | "label": "", 832 | "logBase": 1, 833 | "max": null, 834 | "min": null, 835 | "show": false 836 | } 837 | ], 838 | "yaxis": { 839 | "align": false, 840 | "alignLevel": null 841 | } 842 | }, 843 | { 844 | "columns": [], 845 | "compactRowsEnabled": false, 846 | "datasource": "${DS_PSQL}", 847 | "datatablePagingType": "simple_numbers", 848 | "datatableTheme": "basic_theme", 849 | "emptyData": false, 850 | "fontSize": "100%", 851 | "gridPos": { 852 | "h": 13, 853 | "w": 24, 854 | "x": 0, 855 | "y": 16 856 | }, 857 | "hoverEnabled": true, 858 | "id": 15, 859 | "infoEnabled": true, 860 | "lengthChangeEnabled": true, 861 | "links": [], 862 | "orderColumnEnabled": true, 863 | "pagingTypes": [ 864 | { 865 | "text": "Page number buttons only", 866 | "value": "numbers" 867 | }, 868 | { 869 | "text": "'Previous' and 'Next' buttons only", 870 | "value": "simple" 871 | }, 872 | { 873 | "text": "'Previous' and 'Next' buttons, plus page numbers", 874 | "value": "simple_numbers" 875 | }, 876 | { 877 | "text": "'First', 'Previous', 'Next' and 'Last' buttons", 878 | "value": "full" 879 | }, 880 | { 881 | "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers", 882 | "value": "full_numbers" 883 | }, 884 | { 885 | "text": "'First' and 'Last' buttons, plus page numbers", 886 | "value": "first_last_numbers" 887 | } 888 | ], 889 | "panelHeight": 481, 890 | "rowNumbersEnabled": false, 891 | "rowsPerPage": 10, 892 | "scroll": true, 893 | "scrollHeight": "default", 894 | "searchEnabled": true, 895 | "showCellBorders": false, 896 | "showHeader": true, 897 | "showRowBorders": true, 898 | "sort": { 899 | "col": 0, 900 | "desc": true 901 | }, 902 | "stripedRowsEnabled": true, 903 | "styles": [ 904 | { 905 | "dateFormat": "YYYY-MM-DD HH:mm:ss.SSS", 906 | "pattern": "Time", 907 | "type": "date" 908 | }, 909 | { 910 | "colorMode": null, 911 | "colors": [ 912 | "rgba(245, 54, 54, 0.9)", 913 | "rgba(237, 129, 40, 0.89)", 914 | "rgba(50, 172, 45, 0.97)" 915 | ], 916 | "column": "", 917 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 918 | "decimals": 2, 919 | "link": true, 920 | "pattern": "History", 921 | "thresholds": [], 922 | "type": "string", 923 | "unit": "short" 924 | }, 925 | { 926 | "colorMode": null, 927 | "colors": [ 928 | "rgba(245, 54, 54, 0.9)", 929 | "rgba(237, 129, 40, 0.89)", 930 | "rgba(50, 172, 45, 0.97)" 931 | ], 932 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 933 | "decimals": 2, 934 | "pattern": "/.*/", 935 | "thresholds": [], 936 | "type": "string", 937 | "unit": "short" 938 | } 939 | ], 940 | "targets": [ 941 | { 942 | "alias": "", 943 | "dsType": "influxdb", 944 | "format": "table", 945 | "groupBy": [ 946 | { 947 | "params": [ 948 | "$__interval" 949 | ], 950 | "type": "time" 951 | }, 952 | { 953 | "params": [ 954 | "null" 955 | ], 956 | "type": "fill" 957 | } 958 | ], 959 | "hide": false, 960 | "measurement": "alerts", 961 | "orderByTime": "ASC", 962 | "policy": "10weeks", 963 | "query": "", 964 | "rawQuery": true, 965 | "rawSql": "SELECT\n timestamp as \"Time\", type, left(monitored_asname,32) as \"Monitored\", left(offending_asname, 32) as \"Offending\", message, history_url as \"History\"\nFROM\n alerts\nWHERE\n $__timeFilter(timestamp)\n and (monitored_asname ilike '%[[as_name]]%' OR offending_asname ilike '%[[as_name]]%')\n", 966 | "refId": "A", 967 | "resultFormat": "table", 968 | "select": [ 969 | [ 970 | { 971 | "params": [ 972 | "value" 973 | ], 974 | "type": "field" 975 | } 976 | ] 977 | ], 978 | "tags": [] 979 | } 980 | ], 981 | "themeOptions": { 982 | "dark": "./css/datatable-dark.css", 983 | "light": "./css/datatable-light.css" 984 | }, 985 | "themes": [ 986 | { 987 | "disabled": false, 988 | "text": "Basic", 989 | "value": "basic_theme" 990 | }, 991 | { 992 | "disabled": true, 993 | "text": "Bootstrap", 994 | "value": "bootstrap_theme" 995 | }, 996 | { 997 | "disabled": true, 998 | "text": "Foundation", 999 | "value": "foundation_theme" 1000 | }, 1001 | { 1002 | "disabled": true, 1003 | "text": "ThemeRoller", 1004 | "value": "themeroller_theme" 1005 | } 1006 | ], 1007 | "title": "Alerts", 1008 | "transform": "table", 1009 | "type": "briangann-datatable-panel" 1010 | } 1011 | ], 1012 | "refresh": false, 1013 | "schemaVersion": 16, 1014 | "style": "dark", 1015 | "tags": [], 1016 | "templating": { 1017 | "list": [ 1018 | { 1019 | "current": { 1020 | "value": "${VAR_AS_NAME}", 1021 | "text": "${VAR_AS_NAME}" 1022 | }, 1023 | "hide": 0, 1024 | "label": "AS Name", 1025 | "name": "as_name", 1026 | "options": [ 1027 | { 1028 | "value": "${VAR_AS_NAME}", 1029 | "text": "${VAR_AS_NAME}" 1030 | } 1031 | ], 1032 | "query": "${VAR_AS_NAME}", 1033 | "type": "constant" 1034 | } 1035 | ] 1036 | }, 1037 | "time": { 1038 | "from": "now-7d", 1039 | "to": "now" 1040 | }, 1041 | "timepicker": { 1042 | "refresh_intervals": [ 1043 | "5s", 1044 | "10s", 1045 | "30s", 1046 | "1m", 1047 | "5m", 1048 | "15m", 1049 | "30m", 1050 | "1h", 1051 | "2h", 1052 | "1d" 1053 | ], 1054 | "time_options": [ 1055 | "5m", 1056 | "15m", 1057 | "1h", 1058 | "6h", 1059 | "12h", 1060 | "24h", 1061 | "2d", 1062 | "7d", 1063 | "30d" 1064 | ] 1065 | }, 1066 | "timezone": "utc", 1067 | "title": "BGP Sec: Hijack/Leak (by AS Name)", 1068 | "uid": "SHBbxe5iz", 1069 | "version": 3 1070 | } --------------------------------------------------------------------------------