diff options
Diffstat (limited to 'kpov_judge/tasks/snmp_agent_uptime')
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/task.py | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py index c636549..7b3143c 100644 --- a/kpov_judge/tasks/snmp_agent_uptime/task.py +++ b/kpov_judge/tasks/snmp_agent_uptime/task.py @@ -1,7 +1,5 @@ - #!/usr/bin/env python -# -*- coding: utf-8 -*- +# kpov_util should be imported by add_assignment.py -# kpov_random_helpers should be imported by add_assignment.py # TODO: finish this. instructions = { 'si':""" @@ -42,20 +40,14 @@ Set it up on SNMPClient in the home directory of the user test. Make all the data available over SNMP readable by the "studentje" community. """ - } - computers = { 'SNMPClient': { 'disks': [ { 'name': 'student-SNMPClient', }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} ], 'network_interfaces': [{'network': 'net1'}], 'flavor': 'm1.tiny', @@ -65,10 +57,6 @@ computers = { 'disks': [ { 'name': 'student-SNMPServer', }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} ], 'network_interfaces': [{'network': 'net1'}], 'flavor': 'm1.tiny', @@ -79,12 +67,7 @@ computers = { 'SimpleArbiter': { 'disks': [ { 'name': 'simpleArbiterDhcpGWSNMP', - # attempt automount }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, ], 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}], 'flavor': 'm1.tiny', @@ -154,13 +137,13 @@ def gen_params(user_id, params_meta): import random params = dict() r = random.Random(user_id) - # You can also create an OID creation function in kpov_random_helpers. + # You can also create an OID creation function in kpov_util. # this should probably return params_meta #<== Aleksander Fujs 6310020 ==> - params['SNMP_VALUE'] = kpov_random_helpers.alnum_gen(r, 64) + params['SNMP_VALUE'] = kpov_util.alnum_gen(r, 64) params['SNMP_UPTIME_OID'] = 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."{}".1'.format( - kpov_random_helpers.hostname_gen(r)) + kpov_util.hostname_gen(r)) params['SNMP_CLIENT_OID'] = '1.3.6.1.4.1.8072.2.9999.9999.{}'.format( r.randint(0, 255)) #<== Aleksander Fujs 6310020 ==> |