Grafana dashboard: OTRS - Atendentes
Description: Dashboards sobre atendentes do OTRS


{
  "__inputs": [
    {
      "name": "DS_MARIADB_OTRS",
      "label": "MariaDB otrs",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.0.4"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.3.3"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": false,
  "gnetId": 8904,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1541871719310,
  "links": [
    {
      "asDropdown": true,
      "icon": "external link",
      "tags": [
        "otrs"
      ],
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 15,
      "panels": [],
      "title": "Geral",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_MARIADB_OTRS}",
      "decimals": null,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 7,
        "x": 0,
        "y": 1
      },
      "id": 56,
      "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"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "time_sec",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT \nUNIX_TIMESTAMP(ticket.create_time) as time_sec,\nsum(CASE WHEN ticket.ticket_lock_id = 2 THEN 1 ELSE 0 END) as value,\n'locked' as metric\nFROM ticket, users\nWHERE\n    ticket.user_id = users.id\n    AND users.login = '$atendente'\n    AND $__timeFilter(ticket.create_time)\n",
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Em atendimento",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "0",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_MARIADB_OTRS}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 8,
        "x": 7,
        "y": 1
      },
      "id": 57,
      "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"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT \nUNIX_TIMESTAMP(th.create_time) as time_sec,\ncount(*) as value,\nts.name as metric\nFROM ticket_history th\nJOIN ticket t ON (th.ticket_id=t.id)\nJOIN users u ON (th.owner_id=u.id)\nJOIN ticket_state ts ON (th.state_id=ts.id)\nJOIN ticket_state_type tst ON (ts.type_id=tst.id)\nWHERE\ntst.name = 'closed'\nAND th.history_type_id = 27\nAND u.login = '$atendente'\nAND $__timeFilter(th.create_time)",
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Chamados fechados",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_MARIADB_OTRS}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 9,
        "x": 15,
        "y": 1
      },
      "id": 76,
      "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"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(sr.create_time) as time_sec,\n  sum(CASE WHEN sr.id THEN 1 ELSE 0 END) as value,\n  'voted' as metric\nFROM survey_request sr\nJOIN ticket t ON (t.id=sr.ticket_id)\nJOIN users u ON (t.user_id=u.id)\nWHERE\nsr.vote_time IS NOT NULL\nAND u.login = \"$atendente\"\nAND $__timeFilter(sr.create_time)",
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Chamados avaliados",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "0",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 3
      },
      "id": 6,
      "panels": [],
      "title": "Avaliação dos usuários",
      "type": "row"
    },
    {
      "aliasColors": {},
      "breakPoint": "25%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_MARIADB_OTRS}",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 4
      },
      "id": 8,
      "interval": null,
      "legend": {
        "header": "",
        "percentage": true,
        "percentageDecimals": 1,
        "show": true,
        "values": true
      },
      "legendType": "On graph",
      "links": [],
      "maxDataPoints": 3,
      "minSpan": null,
      "nullPointMode": "connected",
      "pieType": "pie",
      "repeat": "questao",
      "repeatDirection": "v",
      "strokeWidth": 1,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT\n  UNIX_TIMESTAMP(sv.create_time) as time_sec,\n  count(vote_value) as value,\n  answer as metric\nFROM survey_vote sv\nJOIN survey_answer sa ON (sv.vote_value=sa.id)\nJOIN survey_question sq ON (sq.id=sv.question_id)\nJOIN survey_request sr ON (sr.id=sv.request_id)\nJOIN ticket t ON (t.id=sr.ticket_id)\nJOIN users u ON (t.user_id=u.id)\nWHERE\n$__timeFilter(sv.create_time)\nAND sq.question IN ($questao)\nAND u.login = \"$atendente\"\nGROUP BY vote_value\nORDER BY sa.position",
          "refId": "A"
        }
      ],
      "title": "$questao",
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "columns": [],
      "datasource": "${DS_MARIADB_OTRS}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 18,
        "x": 6,
        "y": 4
      },
      "id": 27,
      "links": [],
      "pageSize": 10000,
      "repeat": "questao",
      "repeatDirection": "v",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": null,
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "Número",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Ver chamado no OTRS",
          "linkUrl": "https://servidor.otrs/otrs/index.pl?Action=AgentTicketZoom;TicketNumber=$__cell",
          "pattern": "tn",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Título do chamado",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Ver chamado no OTRS",
          "linkUrl": "https://servidor.otrs/otrs/index.pl?Action=AgentTicketZoom;TicketNumber=$__cell_0",
          "pattern": "title",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Questão",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "question",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Avaliação",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "answer",
          "thresholds": [],
          "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": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT\n  t.tn,\n  t.title,\n  sa.answer\nFROM survey_vote sv\nJOIN survey_answer sa ON (sv.vote_value=sa.id)\nJOIN survey_question sq ON (sq.id=sv.question_id)\nJOIN survey_request sr ON (sv.request_id=sr.id)\nJOIN ticket t ON (t.id=sr.ticket_id)\nJOIN users u ON (u.id=t.user_id)\nWHERE\n$__timeFilter(sv.create_time)\nAND\nsq.question IN ($questao)\nAND\nu.login = \"$atendente\"\nORDER BY t.tn DESC",
          "refId": "A"
        }
      ],
      "title": "$questao - Chamados avaliados",
      "transform": "table",
      "type": "table"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 67,
      "panels": [],
      "title": "Outros dados",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "${DS_MARIADB_OTRS}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 13
      },
      "hideTimeOverride": false,
      "id": 46,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss.SSS",
          "link": false,
          "pattern": "Time",
          "type": "string"
        },
        {
          "alias": "Fila",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "queue_name",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Número",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Ver chamado no OTRS",
          "linkUrl": "https://servidor.otrs/otrs/index.pl?Action=AgentTicketZoom;TicketNumber=$__cell",
          "pattern": "tn",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Unidade",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "customer_id",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Título do chamado",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "Ver chamado no OTRS",
          "linkUrl": "https://servidor.otrs/otrs/index.pl?Action=AgentTicketZoom;TicketNumber=$__cell_1",
          "pattern": "title",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "pattern": "id",
          "thresholds": [],
          "type": "hidden",
          "unit": "none"
        },
        {
          "alias": "Tipo",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "article_type_name",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Data criado (GMT 0)",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "create_time",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "a_from",
          "thresholds": [],
          "type": "hidden",
          "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": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT  q.name AS queue_name, t.tn, t.customer_id, t.title,\n        a_t.name AS article_type_name, a.create_time\nFROM    queue AS q, ticket AS t, article AS a, article_type AS a_t, users AS u, (\n            SELECT  _a.ticket_id, MAX(_a.create_time) AS create_time\n            FROM    ticket AS _t, ticket_state AS _t_s, article AS _a\n            WHERE   _t_s.name IN ('new', 'open')\n            AND     _t.ticket_state_id = _t_s.id\n            AND     _a.ticket_id = _t.id\n            GROUP   BY _a.ticket_id\n        ) a_max\nWHERE   q.id = t.queue_id\nAND     t.id = a_max.ticket_id\nAND     a.create_time = a_max.create_time\nAND     a_t.id = a.article_type_id\nAND u.id=a.create_by\nAND $__timeFilter(a.create_time)\nAND u.login = '$atendente'\nGROUP   BY t.id",
          "refId": "A"
        }
      ],
      "timeShift": null,
      "title": "Ações executadas no OTRS",
      "transform": "table",
      "type": "table"
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "otrs"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_MARIADB_OTRS}",
        "hide": 0,
        "includeAll": false,
        "label": "Atendente",
        "multi": false,
        "name": "atendente",
        "options": [],
        "query": "SELECT login FROM users WHERE valid_id = 1 ORDER BY login",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_MARIADB_OTRS}",
        "hide": 2,
        "includeAll": true,
        "label": "Questão",
        "multi": false,
        "name": "questao",
        "options": [],
        "query": "SELECT question FROM survey_question sq JOIN survey s ON (s.id=sq.survey_id AND s.status='Master')",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5y",
    "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": "OTRS - Atendentes",
  "uid": "eLj72s-mz",
  "version": 41,
  "description": "Dashboards sobre atendentes do OTRS"
}