diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-03-02 13:16:59 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-03-02 13:16:59 +0100 |
commit | fd5740b73510fa3b002c8235f84220aeafff88c5 (patch) | |
tree | 4bec710006f9be356830ddc2564ecf0ecddf2291 | |
parent | b632b5fa796044174115b79fe5e91db690624a7c (diff) |
tasks.snmp_agent_uptime: fix scripts in howto
-rw-r--r-- | tasks/snmp_agent_uptime/howtos/en/index.html | 5 | ||||
-rw-r--r-- | tasks/snmp_agent_uptime/howtos/si/index.html | 5 | ||||
-rw-r--r-- | tasks/snmp_agent_uptime/task.py | 4 |
3 files changed, 2 insertions, 12 deletions
diff --git a/tasks/snmp_agent_uptime/howtos/en/index.html b/tasks/snmp_agent_uptime/howtos/en/index.html index bef6792..2013eb2 100644 --- a/tasks/snmp_agent_uptime/howtos/en/index.html +++ b/tasks/snmp_agent_uptime/howtos/en/index.html @@ -128,7 +128,7 @@ <i>#!/bin/bash<br>
uptime=$(</proc/uptime)<br>
seconds=${uptime%%.*}<br>
- echo "Uptime in seconds:" $seconds<br>
+ echo $seconds<br>
exit 0</i>
</li>
<li>
@@ -171,9 +171,6 @@ command <i>snmpwalk -c students -v1 IPaddressOfServer
1.3.6.1.4.1.8072.1.3.2.4.1.2</i>
</li>
- <li>
- you should get string: "Uptime in seconds: xyz"
- </li>
</ol>
</li>
</ol>
diff --git a/tasks/snmp_agent_uptime/howtos/si/index.html b/tasks/snmp_agent_uptime/howtos/si/index.html index f490f6c..2a14412 100644 --- a/tasks/snmp_agent_uptime/howtos/si/index.html +++ b/tasks/snmp_agent_uptime/howtos/si/index.html @@ -126,7 +126,7 @@ <i>#!/bin/bash<br>
uptime=$(</proc/uptime)<br>
seconds=${uptime%%.*}<br>
- echo "Uptime in seconds:" $seconds<br>
+ echo $seconds<br>
exit 0</i><br>
skripto nato shrani kjerkoli hoces
</li>
@@ -170,9 +170,6 @@ ukaz <i>snmpwalk -c students -v1 IPnaslovStreznika
1.3.6.1.4.1.8072.1.3.2.4.1.2</i>
</li>
- <li>
- moral bi vrniti taksen string: "Uptime in seconds: xyz"
- </li>
</ol>
</li>
</ol>
diff --git a/tasks/snmp_agent_uptime/task.py b/tasks/snmp_agent_uptime/task.py index ba6e896..2e504d6 100644 --- a/tasks/snmp_agent_uptime/task.py +++ b/tasks/snmp_agent_uptime/task.py @@ -94,7 +94,6 @@ params_meta = { } def task(SERVER_IP, CLIENT_IP, SNMP_UPTIME_OID, SNMP_CLIENT_OID): - #<== Aleksander Fujs 6310020 ==> # TODO popravi IPje import netsnmp import paramiko @@ -137,7 +136,6 @@ def task(SERVER_IP, CLIENT_IP, SNMP_UPTIME_OID, SNMP_CLIENT_OID): return_results['client_script2'] = stdout.read() #TODO add 3 part of assigement return return_results - #<== Aleksander Fujs 6310020 ==> def gen_params(user_id, params_meta): @@ -147,13 +145,11 @@ def gen_params(user_id, params_meta): # You can also create an OID creation function in kpov_util. # this should probably return params_meta - #<== Aleksander Fujs 6310020 ==> params['SNMP_VALUE'] = kpov_util.alnum_gen(r, 64) params['SNMP_UPTIME_OID'] = 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."{}".1'.format( 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 ==> return params |