diff options
author | jp8046@student.uni-lj.si <jp8046@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-12 16:48:05 +0000 |
---|---|---|
committer | jp8046@student.uni-lj.si <jp8046@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-12 16:48:05 +0000 |
commit | 1f6212005b9d3367635844c25ae52b97071ef91e (patch) | |
tree | 6ce02a94b541b1dcdd9abc99ab6a8d33f422d292 | |
parent | 8fb1396f4cf3f94fa0ef223e51b43129e0561b3e (diff) |
8.poglavje: V slovar sem dodol OID za server in client. V SNMP-Value sem dodal Value default =0 in v gen_parameter ustvarim random stevilo med 1 in 254
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@51 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/task.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py index a32a607..9aaa20b 100644 --- a/kpov_judge/tasks/snmp_agent_uptime/task.py +++ b/kpov_judge/tasks/snmp_agent_uptime/task.py @@ -95,9 +95,9 @@ computers = { networks = { 'net1': {'public': False}, 'test-net': {'public': True} } params_meta = { - 'SNMP_VALUE': {'descriptions': {'si': 'Vrednost, dostopna prek SNMP'}, 'w': False, 'public':True, 'type': 'number', 'generated': True}, - 'SNMP_OID_ON_SERVER': {'descriptions': {'si': 'OID, na katerem je vrednost dostopna'}, 'w': False, 'public':True, 'type': 'OID', 'generated': True}, - 'SNMP_OID_ON_CLIENT': {'descriptions': {'si': 'OID, ki naj ga klient bere'}, 'w': False, 'public':True, 'type': 'OID', 'generated': True}, + 'SNMP_VALUE': {'descriptions': {'si': 'Vrednost, dostopna prek SNMP'}Value:0, 'w': False, 'public':True, 'type': 'number', 'generated': True}, + 'SNMP_OID_ON_SERVER': {'descriptions': {'si': 'OID, na katerem je vrednost dostopna'},'OID':'1.3.6.1.4.1.8072.1.3.2.4', 'w': False, 'public':True, 'type': 'OID', 'generated': True}, + 'SNMP_OID_ON_CLIENT': {'descriptions': {'si': 'OID, ki naj ga klient bere'}'OID':'1.3.6.1.4.1.8072.1.3.2.4.1.4', 'w': False, 'public':True, 'type': 'OID', 'generated': True}, } def task(SNMP_VALUE, SNMP_OID_ON_SERVER, SNMP_OID_ON_CLIENT): @@ -118,8 +118,9 @@ def task(SNMP_VALUE, SNMP_OID_ON_SERVER, SNMP_OID_ON_CLIENT): def gen_params(user_id, params_meta): params = dict() - r = random.Random(user_id) - return params + r = random.randrange(1,255,1) + paras_meta[SNMP_VAULE[Value]]=r + return r def task_check(results, params): import re |