diff --git a/scripts/django_check_cpu_load.py b/scripts/django_check_cpu_load.py index 4e4166f..68f2478 100755 --- a/scripts/django_check_cpu_load.py +++ b/scripts/django_check_cpu_load.py @@ -5,8 +5,8 @@ import sys import urllib2 -CRITICAL_LOAD = 90 -WARNING_LOAD = 75 +CRITICAL = 90 +WARNING = 75 parser = argparse.ArgumentParser(description='Checks CPU load on remote host.') @@ -14,14 +14,14 @@ args = parser.parse_args() -response = urllib2.urlopen(args.url) +response = urllib2.urlopen(args.url) # nosec data = json.load(response) if 'cpu_percentage' in data: - if data['cpu_percentage'] > CRITICAL_LOAD: + if data['cpu_percentage'] > CRITICAL: print 'CPU LOAD CRITICAL: ' + str(data['cpu_percentage']) + '%' sys.exit(2) - elif data['cpu_percentage'] > WARNING_LOAD: + elif data['cpu_percentage'] > WARNING: print 'CPU LOAD WARNING: ' + str(data['cpu_percentage']) + '%' sys.exit(1) else: diff --git a/scripts/django_check_current_users.py b/scripts/django_check_current_users.py index 8d04934..dfceab5 100755 --- a/scripts/django_check_current_users.py +++ b/scripts/django_check_current_users.py @@ -14,7 +14,7 @@ args = parser.parse_args() -response = urllib2.urlopen(args.url) +response = urllib2.urlopen(args.url) # nosec data = json.load(response) if 'count' in data: diff --git a/scripts/django_check_disk_usage.py b/scripts/django_check_disk_usage.py index cdfe2b0..53c97db 100755 --- a/scripts/django_check_disk_usage.py +++ b/scripts/django_check_disk_usage.py @@ -14,7 +14,7 @@ args = parser.parse_args() -response = urllib2.urlopen(args.url) +response = urllib2.urlopen(args.url) # nosec data = json.load(response) max_percentage = 0 diff --git a/scripts/django_check_total_processes.py b/scripts/django_check_total_processes.py index b2ec222..adfbcd6 100755 --- a/scripts/django_check_total_processes.py +++ b/scripts/django_check_total_processes.py @@ -14,7 +14,7 @@ args = parser.parse_args() -response = urllib2.urlopen(args.url) +response = urllib2.urlopen(args.url) # nosec data = json.load(response) if 'count' in data: diff --git a/scripts/django_check_zombie_processes.py b/scripts/django_check_zombie_processes.py index 4955e64..182b75b 100755 --- a/scripts/django_check_zombie_processes.py +++ b/scripts/django_check_zombie_processes.py @@ -14,7 +14,7 @@ args = parser.parse_args() -response = urllib2.urlopen(args.url) +response = urllib2.urlopen(args.url) # nosec data = json.load(response) if 'count' in data: