mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -79,7 +79,7 @@ def get_data(what, api_url, *args):
|
|||
except IOError:
|
||||
print 'Could not connect to the celerymon webserver'
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
def check_web_server_status(api_url):
|
||||
try:
|
||||
request = urllib.urlopen(api_url)
|
||||
|
@ -104,25 +104,25 @@ def print_config(task_names):
|
|||
print '%s.type DERIVE' % (clean_task_name(name))
|
||||
print '%s.min 0' % (clean_task_name(name))
|
||||
print '%s.info number of %s tasks' % (clean_task_name(name), name)
|
||||
|
||||
|
||||
# Values
|
||||
def print_values(task_names = None, api_url = None):
|
||||
for task_name in task_names:
|
||||
count = len(get_data('task_details', api_url, task_name))
|
||||
print '%s.value %d' % (clean_task_name(task_name), count)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
task_names = os.environ.get('tasks', None)
|
||||
api_url = os.environ.get('api_url', API_URL)
|
||||
|
||||
|
||||
check_web_server_status(api_url)
|
||||
|
||||
|
||||
if not task_names:
|
||||
print 'You need to define at least one task name'
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
task_names = task_names.split(',')
|
||||
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] == 'config':
|
||||
print_config(task_names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue