]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
dashUpdater.py: Allow updating alert dashboard
authorZack Cerza <zack@redhat.com>
Thu, 31 Aug 2017 16:00:12 +0000 (10:00 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 5 Sep 2017 18:02:34 +0000 (12:02 -0600)
This may end up only being useful for testing, but it seems important to
have the option to update the alert dashboard.

Signed-off-by: Zack Cerza <zack@redhat.com>
dashUpdater.py

index e916d38e9b3cb62a154ef5ca4f6c92da58d23b5d..1ba8fd4cb009fba141a38b7edaac89c8560c9c3c 100644 (file)
@@ -37,6 +37,8 @@ def get_options():
     parser = argparse.ArgumentParser(prog='dashmgr',
                                      description='Manage Ceph Monitoring '
                                                  'dashboards in Grafana')
+    parser.add_argument('-A', '--update-alerts', action='store_true',
+                        default=False)
     parser.add_argument('-c', '--config-file', type=str,
                         help='path of the config file to use',
                         default=os.path.join(os.getcwd(), 'dashboard.yml'))
@@ -379,7 +381,8 @@ def main():
         logger.info("\nProcessing dashboard {}".format(dashname))
 
         http_rc, dashjson = get_dashboard(dashname)
-        if dashname == config.alert_dashboard and http_rc == 200:
+        if (dashname == config.alert_dashboard and http_rc == 200 and not
+                opts.update_alerts):
             logger.info("- existing alert dashboard found, update bypassed")
             continue