Grafana dashboard: Aipix Mediaserver Dashboard
Description: InfluxDB dashboard to collect metrics from Aipix Mediaserver

### About ###
Collector source files can be found on the GitHub Page: 
[https://github.com/Xaipix/mediaserver-collectors](https://github.com/Xaipix/mediaserver-collectors "Title")

### How To Use ###
- Install and setup Telegraf, InfluxDB, and Grafana to work with eachother. 
- Use the provided mediaserver-collector.conf file.
- Clone Git repository with collector:
```bash
git clone https://github.com/Xaipix/mediaserver-collectors.git /etc/telegraf/telegraf.d/inputs
```
- Restart Telegraf. 
- Import the dashboard json file (or use Grafana Dashboard ID) to add the dashboard and panels to Grafana, selecting your own InfluxDB database after clicking "Import".
- Enjoy!

### Description ###
Collected metrics:
1. Mediaserver summary
    * current time
    * mediaserver hostname
    * mediaserver version
    * mediaserver uptime
    * number of mediaserver restarts
    * OS version of host mediaserver is installed at
2. Memory usage
    * VmSize – size of available for use memory
    * VmRss –  size of used memory
3. Tasks usage
    * mediasvc – customer service streams
    * mediumsvc – streams capturing cameras
    * websvc – API\Cpanel
    * scheduler\vacuum\cluster – auxiliary
4. CPU usage
5. Sockets connections (incoming/outgoing)
    * RxQueue – number of unreceived data 
    * TxQueue – send queue
    * Sockets – total open sockets
    * Established – number of established connections
    * Close Wait – semi-closed connections
    * Slow Connection – slow connections, delivery takes more than 100 milliseconds

 

{
  "__inputs": [
    {
      "name": "DS_INFLUXDB_STAGE",
      "label": "InfluxDB Stage",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__elements": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.4.4"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "InfluxDB dashboard to collect metrics from Aipix Mediaserver",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 16423,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1655103479446,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Uptime"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "8.4.4",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            }
          ],
          "limit": "1",
          "measurement": "mediaserver.proc",
          "orderByTime": "DESC",
          "policy": "default",
          "query": "SELECT last(\"version\") AS \"Version\", last(\"uptime\") AS \"Last uptime\", max(\"uptime\") AS \"Max uptime\", count(distinct(\"pid\")) AS \"Restarts\", last(\"os\") AS \"Linux\" FROM \"mediaserver.proc\" WHERE $timeFilter GROUP BY \"host\" ORDER BY time DESC LIMIT 1",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "version"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Version"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "uptime"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Uptime"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "pid"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "distinct"
              },
              {
                "params": [],
                "type": "count"
              },
              {
                "params": [
                  " -1"
                ],
                "type": "math"
              },
              {
                "params": [
                  "Restarts"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "os"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Linux"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": []
        }
      ],
      "title": "MediaServer Summary",
      "transformations": [
        {
          "id": "configFromData",
          "options": {
            "configRefId": "B",
            "mappings": [
              {
                "fieldName": "Time",
                "handlerKey": "field.value",
                "reducerId": "lastNotNull"
              },
              {
                "fieldName": "mediaserver.proc.count {host: mediaserver1.navek.dev}",
                "handlerKey": "field.name",
                "reducerId": "last"
              }
            ]
          }
        }
      ],
      "transparent": true,
      "type": "table"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "unit",
                "value": "bytes"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "id": 4,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "mediaserver.memory",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "vmsize"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "VmSize"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "vmrss"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "VmRSS"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        }
      ],
      "title": "Memory usage ( VmRSS/VmSize )",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 18
      },
      "id": 16,
      "panels": [],
      "repeat": "server",
      "title": "Tasks and CPU",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 14,
        "w": 12,
        "x": 0,
        "y": 19
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "last"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "task"
              ],
              "type": "tag"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "mediaserver.tasks",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cpu_d"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        }
      ],
      "title": "Tasks CPU Usage",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "custom.drawStyle",
                "value": "line"
              },
              {
                "id": "custom.fillOpacity",
                "value": 9
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 14,
        "w": 12,
        "x": 12,
        "y": 19
      },
      "id": 6,
      "options": {
        "legend": {
          "calcs": [
            "last",
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "measurement": "mediaserver.proc",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cpu"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "Proc"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "total"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "Total"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "mediaserver.proc",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "iowait"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "IoWait"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        }
      ],
      "title": "CPU / IoWait",
      "transformations": [],
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "id": 14,
      "panels": [],
      "repeat": "server",
      "title": "Sockets stats",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "decbytes"
              },
              {
                "id": "custom.fillOpacity",
                "value": 15
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "decbytes"
              },
              {
                "id": "custom.fillOpacity",
                "value": 10
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 15,
        "w": 12,
        "x": 0,
        "y": 34
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "mediaserver.incomming",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "rxq"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Rx Queue"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "mediaserver.incomming",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "txq"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Tx Queue"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [
            {
              "params": [
                "host"
              ],
              "type": "tag"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "mediaserver.incomming",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "conn"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Sockets"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_estab"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Establishied"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_close_wait"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Close Wait"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_very_slow"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Slow Connection"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        }
      ],
      "title": "Incomming connections",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_STAGE}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "decbytes"
              },
              {
                "id": "custom.fillOpacity",
                "value": 10
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "custom.fillOpacity",
                "value": 10
              },
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "decbytes"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 15,
        "w": 12,
        "x": 12,
        "y": 34
      },
      "id": 10,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [],
          "hide": false,
          "measurement": "mediaserver.outgoing",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "txq"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Tx Queue"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [],
          "hide": false,
          "measurement": "mediaserver.outgoing",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "rxq"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Rx Queue"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_STAGE}"
          },
          "groupBy": [],
          "measurement": "mediaserver.outgoing",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"conn\" AS \"Sockets\", \"ss_estab\" AS \"Established\", \"ss_close_wait\" AS \"Close Wait\", \"txq\" AS \"Tx Queue\", \"rxq\" AS \"Rx Queue\", \"ss_very_slow\" AS \"Slow connections\" FROM \"mediaserver.outgoing\" WHERE (\"_port\" = '0') AND $timeFilter",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "conn"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Sockets"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_estab"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Established"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_close_wait"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Close Wait"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "ss_very_slow"
                ],
                "type": "field"
              },
              {
                "params": [
                  "Slow connections"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "_port",
              "operator": "=",
              "value": "0"
            },
            {
              "condition": "AND",
              "key": "host",
              "operator": "=~",
              "value": "/^$server$/"
            }
          ]
        }
      ],
      "title": "Outgoing connectioins",
      "type": "timeseries"
    }
  ],
  "refresh": "",
  "schemaVersion": 35,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB_STAGE}"
        },
        "definition": "SHOW TAG VALUES FROM \"mediaserver.proc\" WITH KEY=host",
        "description": "",
        "hide": 0,
        "includeAll": false,
        "label": "server",
        "multi": false,
        "name": "server",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"mediaserver.proc\" WITH KEY=host",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Aipix Mediaserver Dashboard",
  "uid": "pktmwmr",
  "version": 4,
  "weekStart": ""
}