summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html
diff options
context:
space:
mode:
authordn3250@student.uni-lj.si <dn3250@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-04 22:49:41 +0000
committerdn3250@student.uni-lj.si <dn3250@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-04 22:49:41 +0000
commit9027451e32c0524ee9d88c570161817aa6359b10 (patch)
tree753f887ac0be097d68f5e7d98269210c88372aa3 /kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html
parent2c286889ace86d88b60c3503557c0c0d1a9772f5 (diff)
edited howto
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@145 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html')
-rw-r--r--kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html137
1 files changed, 122 insertions, 15 deletions
diff --git a/kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html b/kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html
index d51941b..b5027fa 100644
--- a/kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html
+++ b/kpov_judge/tasks/snmp_agent_uptime/howtos/en/index.html
@@ -23,7 +23,7 @@
</p>
<p>
Write a script called beri.sh that reads the value from the
- OID 1.3.6.1.4.1.8072.1.3.2.4.1.4. on SNMPServer. Set it up on
+ OID 1.3.6.1.4.1.8072.1.3.2.4.1.4 on SNMPServer. Set it up on
SNMPClient in the home directory of the user test.
</p>
<h2>Instructions</h2>
@@ -90,9 +90,9 @@
</li>
<li>
(un)comment these four lines as below:<br>
- <i># Listen for connections from the local system only<br>
- #agentAddress udp:127.0.0.1:161<br>
- # Listen for connections on all interfaces (both IPv4 *and* IPv6)<br>
+ <i># Listen for connections from the local system only<br>
+ # agentAddress udp:127.0.0.1:161<br>
+ # Listen for connections on all interfaces (both IPv4 *and* IPv6)<br>
agentAddress udp:161,udp6:[::1]:161</i>
</li>
</ol>
@@ -136,25 +136,96 @@
</li>
</ol>
</li>
- </ol>
+ </ol>
+
<h3>Set up of SNMPClient machine</h3>
<ol>
<li>
- Install snmp package on client side and tools for inspecting the
- data available over SNMP.
+ Install snmpd and snmp packages.
+ <ol type="disc">
+ <li>
+ command <i>apt-get install snmpd snmp</i>
+ </li>
+ </ol>
+ <li>
+ RECOMMENDATION! Before doing any changes to your /etc/snmp/snmpd.conf
+ file take a copy of original file.
+ <ol type="disc">
+ <li>
+ command <i>cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig</i>
+ </li>
+ </ol>
+ </li>
+ <li>
+ Set up the snmp client to allow all other computers to access it = edit
+ snmpd.conf file.
+ <ol type="disc">
+ <li>
+ command <i>nano /etc/snmp/snmpd.conf</i>
+ (you can use different editor)
+ </li>
+ <li>
+ (un)comment these four lines as below:<br>
+ <i># Listen for connections from the local system only<br>
+ # agentAddress udp:127.0.0.1:161<br>
+ # Listen for connections on all interfaces (both IPv4 *and* IPv6)<br>
+ agentAddress udp:161,udp6:[::1]:161</i>
+ </li>
+ </ol>
+ </li>
+ <li>
+ Add a group (community) of computers we deem to be worthy of
+ accessing all data. This group will be called students = again edit
+ snmpd.conf file.
+ <ol type="disc">
+ <li>
+ rocommunity students 0.0.0.0/0
+ </li>
+ <li>
+ write correct network address = command <i>ifconfig -a</i>
+ </li>
+ </ol>
+ </li>
+ <li>
+ OPTIONAL CONFIGURATION. Lower in the same file you can set the
+ location of the computer snmpd is running on and the name
+ of the administrator.
<ol type="disc">
<li>
- command <i>apt-get install snmp snmp-mibs-downloader</i>
+ find under # SYSTEM INFORMATION
</li>
- </ol>
+ </ol>
</li>
<li>
- don't know what's next, because even snmpwalk localhost -c public -v1
- or /etc/init.d/snmp restart doesn't work....
- </li>
+ Under # EXTENDING THE AGENT comment all three tests and add your script
+ (you'll create it later) called <i>upminutes</i>.
+ <ol type="disc">
+ <li>
+ it will look like this:<br>
+ <i># extend test1 /bin/echo Hello, world!<br>
+ # extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35<br>
+ # extend-sh test3 /bin/sh /tmp/shtest<br>
+ extend-sh "your_name" /home/test/upminutes
+ </i>
+ </li>
+ </ol>
+ </li>
<li>
-
+ You need to restart the snmp services.
+ <ol type="disc">
+ <li>
+ command <i>/etc/init.d/snmpd restart</i>
+ </li>
+ </ol>
</li>
+ <li>
+ You can test your configuration through localhost.
+ <ol type="disc">
+ <li>
+ command <i>snmpwalk localhost -c public -v1</i>
+ </li>
+ </ol>
+ </li>
<li>Create the user <i>test</i> with password <i>test</i>
<ol type="disc">
<li>
@@ -183,9 +254,45 @@
test the program (it should output the uptime of the
computer in minutes)<br>
command <i>/home/test/upminutes</i>
- </li>
+ </li>
</ol>
</li>
- </ol>
+ <li>As user <i>test</i> and create next script called <i>beri.sh</i> that
+ reads the value from the OID 1.3.6.1.4.1.8072.1.3.2.4.1.2.
+ on SNMPServer. Set it up on SNMPClient in the home directory of the
+ user test.
+ <ol type="disc">
+ <li>
+ command <i>nano beri.sh</i> (you can use different editor)
+ </li>
+ <li>
+ add the source code:<br>
+ <i>#!/bin/bash</i><br>
+ <i>snmpwalk -c students -v1 IPaddressOfServer
+ 1.3.6.1.4.1.8072.1.3.2.4.1.2</i><br>
+ <i>exit 0</i>
+ </li>
+ <li>
+ don't forget to make the program runnable:<br>
+ command <i>chmod +x /home/test/upminutes</i>
+ </li>
+ </ol>
+ </li>
+ </ol>
+
+ <h3>Testing of <i>upminutes</i> script</h3>
+ <ol>
+ <li>
+ Make sure that the SNMP server reports it's uptime in seconds
+ over SNMP under NET-SNMP-EXTEND-MIB::nsExtendOutput2Table = write on
+ server side:
+ <ol type="disc">
+ <li>
+ command <i>snmpwalk -c students -v1 IPaddressOfClient
+ 1.3.6.1.4.1.8072.1.3.2.4.1.2</i>
+ </li>
+ </ol>
+ </li>
+ </ol>
</body>
</html>