snmp_agent_uptime

Purpose of the assignment

???

Quick instructions

Set up three virtual computers, SimpleArbiter with the disk image simpleArbiterDhcp, SNMPServer and SNMPClient. Write a program called upminutes. This program should output the uptime of the computer in minutes. Set it up on SNMPClient in the home directory of the user test with the password test.

Make sure that the SNMP server reports it's uptime in seconds over SNMP under NET-SNMP-EXTEND-MIB::nsExtendOutput2Table.

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 SNMPClient in the home directory of the user test.

Instructions

Set up of VM VirtualBox

  1. Download the following virtual images (*.vid) from the directory with images of virtual computers:
    1. simpleArbiterDhcp.vdi
    2. some-bash-console.vdi – twice, one for SNMPServer and second for SNMPClient
  2. VM VirtualBox WARNING! If you want to use one same virtual image (some-bash-console.vdi) for two virtual computers (SNMPServer and SNMPClient), you must change UUID of one image.
    1. Use this command vboxmanage internalcommands sethduuid name-of-disk.vdi to change UUID (hint).
  3. Final view of sets VM VirtualBox machines.

Set up of SNMPServer

  1. a
    1. aa
    2. aaa

Set up of SNMPClient

  1. a
  2. aa
  3. aaa
  4. Create the user test with password test
    1. command adduser test
  5. Login as user test and create program upminutes in the home directory. This program should output the uptime of the computer in minutes.
    1. command nano upminutes (you can use different editor)
    2. add the source code:
      #!/bin/bash
      echo $(awk '{print $1}' /proc/uptime) / 60 | bc
      exit 0
    3. don't forget to make the program runtable:
      command chmod +x /home/test/upminutes
    4. test the program (it should output the uptime of the computer in minutes)
      command /home/test/upminutes