diff options
author | af7140@student.uni-lj.si <af7140@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-22 19:37:34 +0000 |
---|---|---|
committer | af7140@student.uni-lj.si <af7140@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-22 19:37:34 +0000 |
commit | a232f4a3b6c5c0e39cd262cd0e6b3d49ad27e034 (patch) | |
tree | 79c6fdfb56f239beed6e05120e80a81c4aea7af8 | |
parent | 792b601a248a912532fb18a680f46ba2ab679849 (diff) |
restored gasper version :D
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@129 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/task.py | 16 |
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): |