Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Azef1 authored Jul 11, 2016
1 parent 4b6a18b commit 886a6ec
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions module/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def manage_initial_host_status_brok(self, b):
def manage_service_check_result_brok(self, b):
host_name = b.data['host_name']
state_id = b.data['state_id']
service_description = b.data['service_description']
service_description = b.data['service_description']
service_id = host_name+"/"+service_description
logger.debug("[Graphite] service check result: %s", service_id)

Expand Down Expand Up @@ -303,7 +303,6 @@ def manage_service_check_result_brok(self, b):
path = '.'.join((hname, self.graphite_data_source, desc))
else:
path = '.'.join((hname, desc))


#Send state to Graphite
state_query = []
Expand Down Expand Up @@ -333,8 +332,7 @@ def manage_service_check_result_brok(self, b):
def manage_host_check_result_brok(self, b):
host_name = b.data['host_name']
logger.debug("[Graphite] host check result: %s", host_name)

state_id = b.data['state_id']
state_id = b.data['state_id']
# If host initial status brok has not been received, ignore ...
if host_name not in self.hosts_cache:
logger.warning("[Graphite] received service check result for an unknown host: %s", host_name)
Expand Down Expand Up @@ -373,7 +371,7 @@ def manage_host_check_result_brok(self, b):
else:
path = hname

#Send state to Graphite
#Send state to Graphite
state_query = []
state_query.append("%s.available %s %d" % (path, state_id, check_time))
state_packet = '\n'.join(state_query) + '\n'
Expand All @@ -383,7 +381,7 @@ def manage_host_check_result_brok(self, b):
except IOError:
logger.error("[Graphite broker] Failed sendind state o the Graphite Carbon.")

if len(couples) == 0:
if len(couples) == 0:
logger.debug("[Graphite] no metrics to send ...")
return

Expand All @@ -403,4 +401,4 @@ def main(self):
l = self.to_q.get()
for b in l:
b.prepare()
self.manage_brok(b)
self.manage_brok(b)

0 comments on commit 886a6ec

Please sign in to comment.