ROTINAS BMC CONTROL-M INCIDENTES X EXECUCOES
Jobs Dashboard canceled and number of runs on Control-M using PostgreSQL datasource
Jobs Dashboard canceled and number of runs on Control-M using PostgreSQL datasource. Accessing the Control-M Enterprise Manager database in PostgreSQL
{
  "__inputs": [
    {
      "name": "DS_CONTROL-M",
      "label": "PostgreSQL",
      "description": "Accessing the Control-M Enterprise Manager database in PostgreSQL",
      "type": "datasource",
      "pluginId": "postgres",
      "pluginName": "PostgreSQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.2.4"
    },
    {
      "type": "panel",
      "id": "grafana-piechart-panel",
      "name": "Pie Chart",
      "version": "1.3.6"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "postgres",
      "name": "PostgreSQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 11417,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1576513323588,
  "links": [
    {
      "icon": "external link",
      "includeVars": false,
      "keepTime": false,
      "tags": [],
      "targetBlank": true,
      "title": "ACESSE O CONTROL-M SELF SERVICE",
      "tooltip": "ABRIR CONTROLM SELF SERVICE",
      "type": "link",
      "url": "http://processamento.riachuelo.net:18080/ControlM"
    },
    {
      "icon": "external link",
      "tags": [],
      "targetBlank": true,
      "title": "DASHBOARD (SLA)",
      "tooltip": "Abrir Dashboard",
      "type": "link",
      "url": "http://processamento.riachuelo.net:8080/dashboard/"
    },
    {
      "icon": "external link",
      "tags": [],
      "targetBlank": true,
      "title": "DOWNLOAD CONTROL-M CLIENT",
      "tooltip": "DOWNLOAD CONTROL-M CLIENT",
      "type": "link",
      "url": "http://processamento.riachuelo.net:18080/ClientDeployServices/GetInstaller"
    }
  ],
  "panels": [
    {
      "aliasColors": {},
      "breakPoint": "50%",
      "cacheTimeout": null,
      "combine": {
        "label": "Others",
        "threshold": 0
      },
      "datasource": "${DS_CONTROL-M}",
      "fontSize": "80%",
      "format": "short",
      "gridPos": {
        "h": 8,
        "w": 9,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "interval": null,
      "legend": {
        "header": "",
        "percentage": true,
        "percentageDecimals": 2,
        "show": true,
        "sideWidth": null,
        "values": true
      },
      "legendType": "Right side",
      "links": [],
      "maxDataPoints": 3,
      "nullPointMode": "connected",
      "options": {},
      "pieType": "pie",
      "strokeWidth": 1,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select UPPER(A.application), count(A.job_mem_name) as total,now() as time\n\tFROM public.runinfo_history as A\n\tINNER JOIN public.def_ver_job as B ON \n\tA.job_mem_name = B.job_name\n\twhere $__timeFilter(A.end_time)\n\tand A.node_id IS NOT NULL\n\tand A.node_group IS NOT NULL\n\tand A.job_mem_name != A.sched_table\n\tand not A.job_mem_name like 'SUMD%'\n\t--and application !='Producao'\n\tand upper(A.application) LIKE $AREA\n\tand A.ended_status = 32\n\tand B.is_current_version::text = 'Y'::text\n\tgroup by A.job_mem_name,A.group_name,A.application,A.sched_table,A.ended_status,b.description\n\t--having count(job_mem_name) > 5\n\torder by count(A.job_mem_name) desc\n--\tlimit 100;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "ROTINAS CANCELADAS",
      "transparent": true,
      "type": "grafana-piechart-panel",
      "valueName": "total"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CONTROL-M}",
      "decimals": 0,
      "description": "",
      "fill": 0,
      "gridPos": {
        "h": 8,
        "w": 15,
        "x": 9,
        "y": 0
      },
      "hideTimeOverride": false,
      "id": 6,
      "interval": "24h",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": null,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "options": {},
      "percentage": false,
      "pointradius": 2,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select cast(count(application) as numeric) as valor, application as metric, cast (order_date as date) as time\nFROM public.runinfo_history\nwhere ended_status=32 and $__timeFilter(end_time)and not application is null\nand not job_mem_name like 'SUMD%'\ngroup by order_date,application,ended_status\norder by order_date\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "QUANTIDADE DE INCIDENTES",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "short",
          "label": "Quantidade Incidentes",
          "logBase": 2,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": 10
      }
    },
    {
      "cacheTimeout": null,
      "columns": [],
      "datasource": "${DS_CONTROL-M}",
      "description": "INCIDENTES COM ROTINAS CONTROL-M\nPADRÃO DE TIME RANGE SÃO 7 DIAS, MAS PODE SER ALTERADO NA PARTE SUPERIOR DIREITA DA TELA                                    \nCORES INCIDENTE :\n      VERDE ATE 5  --\n      AMARELO DE 6 ATE 15 --\n      VERMELHO  ACIMA DE 15",
      "fontSize": "100%",
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 2,
      "interval": "1h",
      "links": [],
      "maxPerRow": null,
      "options": {},
      "pageSize": 100,
      "pluginVersion": "6.2.4",
      "repeat": null,
      "repeatDirection": "h",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 3,
        "desc": true
      },
      "styles": [
        {
          "alias": "ÚLTIMA OCORRÊNCIA",
          "dateFormat": "DD/MM/YYYY_H:mm:ss",
          "link": false,
          "pattern": "max",
          "type": "date"
        },
        {
          "alias": "COUNT",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "#E0B400",
            "rgba(245, 54, 54, 0.9)"
          ],
          "decimals": 0,
          "pattern": "total",
          "thresholds": [
            "5",
            "15"
          ],
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "STATUS",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "#37872D",
            "rgba(245, 54, 54, 0.9)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "ended_status",
          "preserveFormat": false,
          "rangeMaps": [
            {
              "from": "",
              "text": "",
              "to": ""
            }
          ],
          "sanitize": false,
          "thresholds": [
            "16",
            "32"
          ],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "INCIDENTE",
              "value": "32"
            },
            {
              "text": "SUCESSO",
              "value": "16"
            }
          ]
        },
        {
          "alias": "ÁREA",
          "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,
          "mappingType": 1,
          "pattern": "upper",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "SUB GRUPO",
          "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,
          "mappingType": 1,
          "pattern": "group_name",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "SERVIÇ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,
          "mappingType": 1,
          "pattern": "sched_table",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "JOBNAME",
          "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,
          "mappingType": 1,
          "pattern": "jobname",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "DESCRIÇÃO (200 Chars)",
          "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,
          "mappingType": 1,
          "pattern": "descricao",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "hide": false,
          "metricColumn": "job_mem_name",
          "rawQuery": true,
          "rawSql": "\tselect A.ended_status, UPPER(A.application), A.job_mem_name as JOBNAME, count(A.job_mem_name) as total,max(A.end_time), A.group_name, A.sched_table,LEFT(B.Description,200) as DESCRICAO\n\tFROM public.runinfo_history as A\n\tINNER JOIN public.def_ver_job as B ON \n\tA.job_mem_name = B.job_name\n\twhere $__timeFilter(A.end_time)\n\tand A.node_id IS NOT NULL\n\tand A.node_group IS NOT NULL\n\tand A.job_mem_name != A.sched_table\n\tand not A.job_mem_name like 'SUMD%'\n\t--and application !='Producao'\n\tand upper(A.application) LIKE $AREA\n\tand A.ended_status = $STATUS \n\tand B.is_current_version::text = 'Y'::text\n\tgroup by A.job_mem_name,A.group_name,A.application,A.sched_table,A.ended_status,b.description\n\t--having count(job_mem_name) > 5\n\torder by count(A.job_mem_name) desc\n\tlimit 100;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "job_mem_name"
                ],
                "type": "column"
              },
              {
                "params": [
                  "JOB NAME"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "job_mem_name"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "JOB NAME"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "runinfo_history",
          "timeColumn": "start_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "datatype": "int4",
              "name": "",
              "params": [
                "ended_status",
                "=",
                "32"
              ],
              "type": "expression"
            },
            {
              "name": "",
              "params": [
                "count(ended_status) > 5",
                "=",
                "value"
              ],
              "type": "expression"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "INCIDENTES / EXECUÇÕES DE JOBS NO CONTROL-M",
      "transform": "table",
      "type": "table"
    }
  ],
  "refresh": "30m",
  "schemaVersion": 18,
  "style": "dark",
  "tags": [
    "PROCESSAMENTO",
    "CONTROL-M"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "tags": [],
          "text": "32",
          "value": "32"
        },
        "hide": 0,
        "includeAll": false,
        "label": "STATUS - (16=OK - 32=CANCEL)",
        "multi": false,
        "name": "STATUS",
        "options": [
          {
            "selected": false,
            "text": "16",
            "value": "16"
          },
          {
            "selected": true,
            "text": "32",
            "value": "32"
          }
        ],
        "query": "16,32",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": "'%'",
        "current": {},
        "datasource": "${DS_CONTROL-M}",
        "definition": "select distinct UPPER(application) from public.runinfo_history ",
        "hide": 0,
        "includeAll": true,
        "label": "AREA",
        "multi": false,
        "name": "AREA",
        "options": [],
        "query": "select distinct UPPER(application) from public.runinfo_history ",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-2d",
    "to": "now"
  },
  "timepicker": {
    "hidden": false,
    "refresh_intervals": [
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "utc",
  "title": "ROTINAS BMC CONTROL-M INCIDENTES X EXECUCOES",
  "uid": "ErNILB2Wz",
  "version": 24,
  "description": "Jobs Dashboard canceled and number of runs on Control-M using PostgreSQL datasource"
}