Chamados - OTRS - 2019
Mostra quantidade de chamados abertos, fechados, quantidade por usuário, por fila, top 10, etc.
Mostra quantidade de chamados abertos, fechados, quantidade por usuário, por fila, top 10, etc.
{
  "__inputs": [
    {
      "name": "DS_OTRS",
      "label": "https://centraldeservicos.interop.com.br/otrs",
      "description": "otrs",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.6.3"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 11383,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "rows": [
    {
      "collapse": false,
      "height": 57,
      "panels": [
        {
          "content": "<center><h2 style=\"background-color:green\"><font color=\"#F5FFFA\"><b>OTRS - Chamado relativos ao ano de 2019</b></></font></h2></center>",
          "id": 8,
          "links": [],
          "mode": "html",
          "span": 12,
          "title": "",
          "type": "text"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": 291,
      "panels": [
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_OTRS}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "hideTimeOverride": true,
          "id": 9,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "80%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 4,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "qtde",
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT count(0)qtde from ticket\r\nwhere date(create_time) between '2019-01-01' and '2019-12-31'",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "timeFrom": "2m",
          "timeShift": "2m",
          "title": "Total de Chamado - 2019",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#299c46",
            "#e5ac0e",
            "#d44a3a"
          ],
          "datasource": "${DS_OTRS}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "hideTimeOverride": true,
          "id": 7,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "qtd",
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT ts.name, count(0) qtd \r\nFROM ticket t \r\ninner join ticket_state ts on t.ticket_state_id=ts.id \r\nwhere  ticket_state_id= 1 and date(t.create_time) between '2019-01-01' and '2019-12-31'\r\ngroup by ts.name \r\n",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "timeFrom": "10m",
          "timeShift": "10m",
          "title": "Chamados novos - 2019",
          "type": "singlestat",
          "valueFontSize": "120%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#bf1b00",
            "#0a437c",
            "#d44a3a"
          ],
          "datasource": "${DS_OTRS}",
          "format": "none",
          "gauge": {
            "maxValue": 200,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 2,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "qtd",
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT ts.name, count(0) qtd \r\nFROM ticket t \r\ninner join ticket_state ts on t.ticket_state_id=ts.id \r\nwhere  ticket_state_id=4 and date(t.create_time) between '2019-01-01' and '2019-12-31'\r\ngroup by ts.name \r\n",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Chamados Abertos  - 2019",
          "type": "singlestat",
          "valueFontSize": "120%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#299c46",
            "#508642",
            "#d44a3a"
          ],
          "datasource": "${DS_OTRS}",
          "format": "none",
          "gauge": {
            "maxValue": 30000,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "id": 1,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "qtd",
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT ts.name, count(0) qtd \r\nFROM ticket t \r\ninner join ticket_state ts on t.ticket_state_id=ts.id \r\nwhere  ticket_state_id= 2 and date(t.create_time) between '2019-01-01' and '2019-12-31'\r\ngroup by ts.name \r\n",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Chamados Fechados com sucesso  - 2019",
          "type": "singlestat",
          "valueFontSize": "120%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        },
        {
          "cacheTimeout": null,
          "colorBackground": true,
          "colorValue": false,
          "colors": [
            "#299c46",
            "#bf1b00",
            "#d44a3a"
          ],
          "datasource": "${DS_OTRS}",
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "hideTimeOverride": true,
          "id": 3,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "tableColumn": "qtd",
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT ts.name, count(0) qtd \r\nFROM ticket t \r\ninner join ticket_state ts on t.ticket_state_id=ts.id \r\nwhere  ticket_state_id=3 and date(t.create_time) between '2019-01-01' and '2019-12-31'\r\ngroup by ts.name \r\n",
              "refId": "A"
            }
          ],
          "thresholds": "",
          "timeFrom": "10m",
          "timeShift": "10m",
          "title": "Chamados fechados sem sucesso- 2019",
          "type": "singlestat",
          "valueFontSize": "120%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "avg"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": -921,
      "panels": [
        {
          "columns": [],
          "datasource": "${DS_OTRS}",
          "fontSize": "100%",
          "hideTimeOverride": true,
          "id": 5,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "span": 5,
          "styles": [
            {
              "alias": "Quantidade",
              "colorMode": "value",
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 0,
              "link": false,
              "pattern": "Total",
              "sanitize": false,
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "decimals": 0,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "select t1.usuario, \r\nif(t3.aberto IS NOT NULL, t3.aberto, 0) aberto, \r\nif(t2.fechado IS NOT NULL, t2.fechado, 0) fechado, \r\nif(t1.total IS NOT NULL, t1.total, 0) total \r\nfrom \r\n(SELECT concat_ws(' ', u.first_name, u.last_name) usuario, count(0) total  \r\nFROM ticket t \r\ninner join users u on t.user_id=u.id \r\nwhere date(t.create_time) between '2019-01-01' and '2019-12-31' \r\ngroup by u.id) t1 \r\nleft join \r\n(SELECT concat_ws(' ', u.first_name, u.last_name) usuario, count(0) fechado \r\nFROM ticket t \r\ninner join users u on t.user_id=u.id \r\nwhere date(t.create_time) between '2019-01-01' and '2019-12-31' \r\nand ticket_state_id=2 \r\ngroup by u.id) t2 on t1.usuario=t2.usuario \r\nleft join \r\n(SELECT concat_ws(' ', u.first_name, u.last_name) usuario, count(0) aberto \r\nFROM ticket t \r\ninner join users u on t.user_id=u.id \r\nwhere date(t.create_time) between '2019-01-01' and '2019-12-31' \r\nand ticket_state_id=4 \r\ngroup by u.id) t3 on t1.usuario=t3.usuario",
              "refId": "A"
            }
          ],
          "timeFrom": "2m",
          "timeShift": "2m",
          "title": "Qtde de chamado por Usuário - 2019",
          "transform": "table",
          "type": "table"
        },
        {
          "columns": [],
          "datasource": "${DS_OTRS}",
          "fontSize": "100%",
          "hideTimeOverride": true,
          "id": 6,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": null,
            "desc": false
          },
          "span": 3,
          "styles": [
            {
              "alias": "Quantidade",
              "colorMode": null,
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "link": false,
              "pattern": "qtd",
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [
                "rgba(50, 172, 45, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT q.name, count(0) qtd  \r\nFROM ticket t \r\ninner join queue q on t.queue_id=q.id \r\nwhere date(t.create_time) between '2019-01-01' and '2019-01-31' \r\ngroup by q.name \r\norder by 2 desc",
              "refId": "A"
            }
          ],
          "timeFrom": "10m",
          "timeShift": "10m",
          "title": "Chamado por fila - 2019",
          "transform": "table",
          "type": "table"
        },
        {
          "columns": [],
          "datasource": "${DS_OTRS}",
          "fontSize": "100%",
          "hideTimeOverride": true,
          "id": 10,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 1,
            "desc": true
          },
          "span": 4,
          "styles": [
            {
              "alias": "Quantidade",
              "colorMode": null,
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 10,
              "pattern": "total",
              "thresholds": [
                ""
              ],
              "type": "number",
              "unit": "currencyBRL"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "decimals": 0,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "alias": "",
              "format": "table",
              "hide": false,
              "rawSql": "SELECT concat_ws(' ', u.first_name, u.last_name) 'Nome do Usuário', count(0) Quantidade \r\nFROM ticket t \r\ninner join users u on t.user_id=u.id \r\nwhere date(t.create_time) between '2019-01-01' and '2019-12-01' \r\ngroup by u.id \r\norder by 2 desc\r\nlimit 10",
              "refId": "A"
            }
          ],
          "timeFrom": "10m",
          "timeShift": "10m",
          "title": "Top -10",
          "transform": "table",
          "type": "table"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Dashboard Row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Chamados - OTRS - 2019",
  "version": 27,
  "description": "Mostra quantidade de chamados abertos, fechados, quantidade por usuário, por fila, top 10, etc."
}