Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
Tabs to spaces, PEP8 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewis Franklin committed Mar 21, 2014
1 parent 33a559f commit 9a7ae05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ def check_queue(self, filters=None):
def _send_data(self, queue):
'''Send the queue data to Zabbix.'''
args = 'zabbix_sender -c {0} -k {1} -o {2}'
return_code = 0
for item in ['memory', 'messages', 'messages_unacknowledged', 'consumers']:
return_code = 0
for item in ['memory', 'messages', 'messages_unacknowledged',
'consumers']:
key = '"rabbitmq[{0},queue_{1},{2}]"'
key = key.format(queue['vhost'], item, queue['name'])
value = queue.get(item, 0)
#print "Executing ", args.format(self.conf, key, value)
return_code |= subprocess.call(args.format(self.conf, key, value), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return_code |= subprocess.call(args.format(self.conf, key, value),
shell=True, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
return return_code

def check_aliveness(self):
Expand Down

0 comments on commit 9a7ae05

Please sign in to comment.