summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r--kpov_judge/tasks/snmp_agent_uptime/task.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py
index 0c24235..1ec037b 100644
--- a/kpov_judge/tasks/snmp_agent_uptime/task.py
+++ b/kpov_judge/tasks/snmp_agent_uptime/task.py
@@ -161,7 +161,7 @@ def gen_params(user_id, params_meta):
params['SNMP_VALUE'] = kpov_random_helpers.alnum_gen(r, 64)
params['SNMP_UPTIME_OID'] = 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."{}".1'.format(
kpov_random_helpers.hostname_gen(r))
- params['SNMP_CLIENT_OID'] = '1.3.6.1.4.1.8072.9999.9999.{}'.format(
+ params['SNMP_CLIENT_OID'] = '1.3.6.1.4.1.8072.2.9999.9999.{}'.format(
r.randint(0, 255))
#<== Aleksander Fujs 6310020 ==>
@@ -175,10 +175,10 @@ def task_check(results, params):
client_script_uptime = int(results['client_script'].strip())
client_uptime = int(results['client_uptime'].strip())
d = client_uptime - client_script_uptime*60
- if d >= 0 and d < 2:
+ if d >= 0 and d < 62:
score += 3
else:
- hints += "client uptime script output wrong."
+ hints += ["client uptime script output wrong."]
server_uptime = int(results['server_uptime'].strip())
lines = results['server_OID'].split('\n')
unique_part_start = params['SNMP_UPTIME_OID'].find('"')
@@ -196,10 +196,14 @@ def task_check(results, params):
break
except Exception, e:
pass
- if len(lines) <= 10 and found_uptime:
+ if len(lines) <= 50 and found_uptime:
score += 3
+ else:
+ hints += ["Uptime not found in server's MDB"]
if results['client_script2'].find(params['SNMP_VALUE']) >= 0:
score += 4
+ else:
+ hints += ["beri.sh not working properly"]
return score, hints
def prepare_disks(templates, task_params, global_params):