Skip to content

Commit

Permalink
Footer update
Browse files Browse the repository at this point in the history
  • Loading branch information
jangaraj committed Nov 20, 2023
1 parent c9d4a3e commit 3d51743
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 8 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/standards.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os
import json
import re

standard_footer = "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/transfer/latest/userguide/monitoring.html\">AWS CloudWatch Transfer Family documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/20008\">Installed from Grafana.com dashboards</a>\n"
standard_footer = re.sub(r'https://docs.aws.amazon.com/.*\"', r'https://docs.aws.amazon.com/\"', standard_footer)
standard_footer = re.sub(r'>AWS CloudWatch .* documentation</a', r'>AWS CloudWatch documentation</a', standard_footer)
standard_footer = re.sub(r'https://grafana.com/dashboards/.+\"', r'https://grafana.com/dashboards/n\"', standard_footer)
standard_footer = standard_footer.replace('\n', '')

def validate_title(f, dashboard):
if not dashboard['title'].startswith('AWS '):
print('Dashboard ' + f + ' title doesn\'t start with \'AWS \' : ' + dashboard['title'])

def validate_footer(f, dashboard):
if 'rows' in dashboard:
footer = dashboard['rows'][len(dashboard['rows']) - 1]['panels'][len(dashboard['rows'][len(dashboard['rows']) - 1]['panels']) - 1]
if 'panels' in dashboard:
footer = dashboard['panels'][len(dashboard['panels']) - 1]

if footer['type'] != 'text':
print('Dashboard ' + f + ' footer is not a text panel')
if footer['title'] != 'Documentation':
print('Dashboard ' + f + ' footer title is not \'Documentation\'')
if 'mode' not in footer:
if 'mode' in footer['options'] and footer['options']['mode'] != 'html':
print('Dashboard ' + f + ' footer is not in html mode')
footer_content = re.sub(r'https://docs.aws.amazon.com/.*\"', r'https://docs.aws.amazon.com/\"', footer['options']['content'])
footer_content = re.sub(r'>AWS CloudWatch .* documentation</a', r'>AWS CloudWatch documentation</a', footer_content)
footer_content = re.sub(r'https://grafana.com/dashboards/.+\"', r'https://grafana.com/dashboards/n\"', footer_content)
footer_content = footer_content.replace('\n', '')
if footer_content != standard_footer:
print('Dashboard ' + f + ' footer content is not standard')
print(footer_content)
print(standard_footer)
print("---")
else:
if 'mode' in footer and footer['mode'] != 'html':
print('Dashboard ' + f + ' footer is not in html mode')
footer_content = re.sub(r'https://docs.aws.amazon.com/.*\"', r'https://docs.aws.amazon.com/\"', footer['content'])
footer_content = re.sub(r'>AWS CloudWatch .* documentation</a', r'>AWS CloudWatch documentation</a', footer_content)
footer_content = re.sub(r'https://grafana.com/dashboards/.+\"', r'https://grafana.com/dashboards/n\"', footer_content)
footer_content = footer_content.replace('\n', '')
if footer_content != standard_footer:
print('Dashboard ' + f + ' footer content is not standard')
print(footer_content)
print(standard_footer)
print("---")

directories = [d for d in os.listdir('.') if os.path.isdir(d) and d.startswith('aws')]
json_files = []
for d in directories:
json_files.extend([d + '/' + f for f in os.listdir(d) if f.endswith('.json')])
jsons = []
for f in json_files:
with open(f, 'r') as j:
dashboard = json.loads(j.read())
validate_title(f, dashboard)
validate_footer(f, dashboard)
2 changes: 1 addition & 1 deletion aws-sns/aws-sns.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
}
},
{
"content": "<a style=\"float: right\" href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a>\n<a style=\"float: left\" target=\"_blank\" href=\"http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/sns-metricscollected.html\">AWS CloudWatch SNS documentation</a><br/>\n<a style=\"float: left\" target=\"_blank\" href=\"https://grafana.com/dashboards/581\">Installed from Grafana.com dashboards</a>\n<div style=\"clear:both; width:100%;height:0;font-size:0;\"></div>",
"contenr": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/sns/latest/dg/sns-monitoring-using-cloudwatch.html\">AWS CloudWatch SNS documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/581\">Installed from Grafana.com dashboards</a>\n",
"editable": true,
"error": false,
"gridPos": {
Expand Down
2 changes: 1 addition & 1 deletion aws-sqs/aws-sqs.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@
}
},
{
"content": "<a style=\"float: right\" href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a>\n<a style=\"float: left\" target=\"_blank\" href=\"http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/sqs-metricscollected.html\">AWS CloudWatch SQS documentation</a><br/>\n<a style=\"float: left\" target=\"_blank\" href=\"https://grafana.com/dashboards/584\">Installed from Grafana.com dashboards</a>\n<div style=\"clear:both; width:100%;height:0;font-size:0;\"></div>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html\">AWS CloudWatch SQS documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/584\">Installed from Grafana.com dashboards</a>\n",
"editable": true,
"error": false,
"gridPos": {
Expand Down
2 changes: 1 addition & 1 deletion aws-step-functions/aws-step-functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@
}
},
{
"content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/step-functions/latest/dg/procedure-cw-metrics.html\">AWS CloudWatch Step Functions documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/11099\">Installed from Grafana.com dashboards</a>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/step-functions/latest/dg/procedure-cw-metrics.html\">AWS CloudWatch Step Functions documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/11099\">Installed from Grafana.com dashboards</a>\n",
"editable": true,
"error": false,
"gridPos": {
Expand Down
2 changes: 1 addition & 1 deletion aws-storage-gateway/aws-storage-gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,7 @@
"links": [],
"mode": "html",
"options": {
"content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/storagegateway/latest/userguide/Main_monitoring-gateways-common.html\">AWS CloudWatch Storage Gateway documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/13040\">Installed from Grafana.com dashboards</a>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/storagegateway/latest/userguide/Main_monitoring-gateways-common.html\">AWS CloudWatch Storage Gateway documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/13040\">Installed from Grafana.com dashboards</a>\n",
"mode": "html"
},
"pluginVersion": "7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion aws-transit-gateway/aws-transit-gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@
"id": 2,
"links": [],
"options": {
"content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-cloudwatch-metrics.html\">AWS CloudWatch Transit Gateway documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/14954\">Installed from Grafana.com dashboards</a>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-cloudwatch-metrics.html\">AWS CloudWatch Transit Gateway documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/14954\">Installed from Grafana.com dashboards</a>\n",
"mode": "html"
},
"pluginVersion": "8.4.3",
Expand Down
2 changes: 1 addition & 1 deletion aws-vpn/aws-vpn.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"height": "25px",
"panels": [
{
"content": "<a style=\"float: right\" href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a>\n<a style=\"float: left\" target=\"_blank\" href=\"http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/monitoring-cloudwatch-vpn.html\">AWS CloudWatch VPN documentation</a><br/>\n<a style=\"float: left\" target=\"_blank\" href=\"https://grafana.com/dashboards/2969\">Installed from Grafana.com dashboards</a>\n<div style=\"clear:both; width:100%;height:0;font-size:0;\"></div>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/monitoring-cloudwatch-vpn.html\">AWS CloudWatch VPN documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/2969\">Installed from Grafana.com dashboards</a>\n",
"editable": true,
"error": false,
"id": 2,
Expand Down
2 changes: 1 addition & 1 deletion aws-waf/aws-waf.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@
"showLineNumbers": false,
"showMiniMap": false
},
"content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html\">AWS CloudWatch WAF documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/20009\">Installed from Grafana.com dashboards</a>\n",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html\">AWS CloudWatch WAF documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/20009\">Installed from Grafana.com dashboards</a>\n",
"mode": "html"
},
"pluginVersion": "10.2.0",
Expand Down
2 changes: 1 addition & 1 deletion aws-x-ray/aws-x-ray.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
"id": 2,
"links": [],
"options": {
"content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/15016\">Installed from Grafana.com dashboards</a>",
"content": "<a target=\"_blank\" href=\"http://www.monitoringartist.com\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/15016\">Installed from Grafana.com dashboards</a>",
"mode": "html"
},
"pluginVersion": "8.1.3",
Expand Down

0 comments on commit 3d51743

Please sign in to comment.