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.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py
index e3f395c..da55b42 100644
--- a/kpov_judge/tasks/snmp_agent_uptime/task.py
+++ b/kpov_judge/tasks/snmp_agent_uptime/task.py
@@ -23,10 +23,6 @@ Napiši skripto, poimenovano beri.sh, ki prek SNMP prebere vrednost s strežnika
SNMPServer na OID 1.3.6.1.4.1.8072.1.3.2.4.1.4.
Postavi jo na SNMP klienta, v domaci imenik uporabnika test z geslom test.
-Napiši skripto gen_params(), ki uporabnikom generira razlicne parametre in
-sicer razlicno število med 1 in 254 s pomocjo katerih bomo preverjali
-ali je prislo do prepisovanja.
-
Navodila za ostale metode pa so obarvana rdece oz. komentirana z #
""",
@@ -112,7 +108,7 @@ def task(SNMP_VALUE, SNMP_OID_ON_SERVER, SNMP_OID_ON_CLIENT):
#Dobimo vrednost casa
#vars=netsnmp.Varbind(SNMP_OID_ON_SERVER['type'])
#Shranimo vrednost casa v imenik od SNMP_OID_ON_SERVER
- #var=netsnmp.Varbind(SNMP_OID_ON_SERVER['descriptions'['si'],'0',session.get(vars),SNMP_OID_ON_SERVER['type'])
+ #var=netsnmp.Varbind(SNMP_OID_ON_SERVER['decdscriptions'['si'],'0',session.get(vars),SNMP_OID_ON_SERVER['type'])
#netsnmp.snmpset(var,Version=2,DestHost=SNMP_VALUE['type'],Community='public')
@@ -124,16 +120,12 @@ def gen_params(user_id, params_meta):
params = dict()
# TODO (polz) this is wrong. Try something like:
r = random.Random(user_id)
- #params['SNMP_VALUE'] = r.randint(0, 255)
- #params_meta['SNMP_OID_ON_SERVER'] = '1.3.6.1.4.1.8072.1.3.2.4.1.4'
- #params_meta['SNMP_OID_ON_CLIENT'] = '1.3.6.1.4.1.8072.1.3.2.4.1.4.'
+ params['SNMP_VALUE'] = r.randint(0, 255)
+ params['SNMP_OID_ON_SERVER'] = '1.3.6.1.4.1.8072.1.3.2.4.1.4'
+ params['SNMP_OID_ON_CLIENT'] = '1.3.6.1.4.1.8072.1.3.2.4.1.4.'
# You can also create an OID creation function in kpov_random_helpers.
# this should probably return params_meta
- params['SNMP_VALUE'] = str(r.randint(0, 255))
- params['SNMP_OID_ON_SERVER'] = 'NET-SNMP-EXTEND-MIB::nsExtendOutput2Table'
- params['SNMP_OID_ON_CLIENT'] = '1.3.6.1.4.1.8072.1.3.2.4.1.4'
-
return params
def task_check(results, params):