From f19d0cbcb5cb94b4813fbba5cb47a9e4b5a81374 Mon Sep 17 00:00:00 2001 From: saravanan30erd Date: Wed, 14 Aug 2019 15:10:54 +0400 Subject: [PATCH] add few corrections --- bin/monit-dashboard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/monit-dashboard.py b/bin/monit-dashboard.py index 02c46f5..31fe677 100755 --- a/bin/monit-dashboard.py +++ b/bin/monit-dashboard.py @@ -28,8 +28,6 @@ output = [] def getMonit(): output = [] - server = {} - checks = OrderedDict() xmlQuery = "/_status?format=xml" with open('{0}/conf/servers.json'.format(os.path.expanduser('.'))) as f: @@ -44,12 +42,13 @@ def getMonit(): services = allstat['service'] status = {} + server = {} checks = OrderedDict() for service in services: name = service['name'] status[name] = int(service['status']) - checks[service['name']] = status[name] + checks[name] = status[name] sorted_checks = OrderedDict() sorted_checks = OrderedDict(sorted(checks.iteritems(), key=itemgetter(1), reverse=True))