Skip to content

Commit

Permalink
Adding #nosec whitelisted lines
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Aug 4, 2017
1 parent 521013d commit 4bca71a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions scripts/django_check_cpu_load.py
Expand Up @@ -5,23 +5,23 @@
import sys
import urllib2

CRITICAL_LOAD = 90
WARNING_LOAD = 75
CRITICAL = 90
WARNING = 75

parser = argparse.ArgumentParser(description='Checks CPU load on remote host.')

parser.add_argument('url', help='URL of remote endpoint to check.')

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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/django_check_current_users.py
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/django_check_disk_usage.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/django_check_total_processes.py
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/django_check_zombie_processes.py
Expand Up @@ -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:
Expand Down

0 comments on commit 4bca71a

Please sign in to comment.