Alex Krzos 966106905e Improve/Consolidate Collectd Configs & Grafana Dashboards
Collectd Configs:
+ Improvements to the maintainability of these config files
  + Versions appended to end of each per-process captured that
    the specific process was used in OpenStack
+ Collect on for Gnocchi, Aodh, and Sahara
+ Remove Satellite6 and OSE collectd configurations
+ Cleaned up Undercloud, Controller, Compute and Ceph Collectd
  Configurations to contain "mostly" processes that exist on
  machines of that type

Dashboards:
+ Add Gnocchi, Aodh, and Sahara per-process graphs
+ s/glance-agent/glance-api/ "bug"
+ Remove non-OpenStack Dashboards (OSE, Satellite 6) from Repo
+ Consolidate Guest, Baremetal, and Graphite Dashboards with OpenStack
  Dashboards in single playbook grafana-dashboards.yml
+ Update the Cloud System Performance Dashboard to allow comparsion
  with timeshifting
+ Add several comments to clarify the three types of dashboards
+ Removed DivideSeries from Graphite, Baremetal, and Guest Dashboards
  to match behavior of the OpenStack Dashboards for per-process
  graphs

Change-Id: I0c5c994324bd202b02a6175b261b84b183499d0e
2016-07-15 16:06:16 -04:00

42 lines
1.6 KiB
Python

#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import json
def main():
"""Script used to fix panel ids in static dashboards. Typically adding a new panel or row into
a static dashboard will involve re-ordering all subsequent panels. This script automates that.
"""
parser = argparse.ArgumentParser(description="Fix panel ids in grafana json dashboard.")
parser.add_argument('inputfile', help='Input json file')
parser.add_argument('outputfile', help='Output json file')
args = parser.parse_args()
with open(args.inputfile) as data_file:
data = json.load(data_file)
index = 0
for row in data['dashboard']['rows']:
for panel in row['panels']:
index += 1
if index != panel['id']:
print "Found error in panel({}): {}".format(index, panel['title'])
panel['id'] = index
with open(args.outputfile, 'w') as outputfile:
json.dump(data, outputfile, sort_keys=True, indent=2, separators=(',', ': '))
if __name__ == "__main__":
main()