diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2016-12-19 10:30:00 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2016-12-19 10:30:00 +0000 |
commit | b07dd1d04118f92d6d26a9a45db95c6481c1e03d (patch) | |
tree | cf0b60f8329d791661d08ce38e635a478bb15aa9 /kpov_judge/tasks/snmp_agent_uptime | |
parent | e35fe771f7c962b17598e8f99ddc8cdcca05f760 (diff) |
fixed fixing snmp_agent_uptime
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@374 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/snmp_agent_uptime')
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/task.py | 12 |
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): |