CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
SNMP Data Retrieval (Pretty Easy!)

 



shanks
New User

May 18, 2008, 2:45 AM

Post #1 of 2 (2924 views)
SNMP Data Retrieval (Pretty Easy!) Can't Post

Hi Guys these are the requirements:

Its a very simple script for perl programmers. I have provided a lot of detail.

This assignment consists of 5 parts use a small perl program to:

1.retrieve and calculate the system load of a remote machine via snmp

2.read the current swapspace from the remote machine via snmp and calculate the percentage in use

3.snmpd.conf lines to "expose" only the data needed to satisfy the above tasks

4.a crontab line that can be inserted into a machine to run the perl script once every 15 minutes at an appropriate time

5.a crontab line to email the results to the local system administrator before the start of the business day (~8.30am)







Parts 1 and 2
:Produce a single Perl script that is to be run once every 15 minutes, retrieving the requisite values and logging them to a local file. Just before the start of the business day (8.30am), send the file to the system administrator

The output is intended to be parsed by script working on the log file or correlated in a spreadsheet. Use a csv format (you will have to research "what" is a csv format! - use one line in this format per record), including the run-time, hostname, 1m load, 5m load, 15m load, swapspace in use (as a percentage of the total available). The order, and fine details of these entries are up to you think about what you would
want if you were writing the parser to process this file.

The Perl program should read the hosts to parse from a simple list in a separate configuration file the format of which is up to you. Make sure you describe the format if this file in your perl script (as comments) no need to supply the file. Remember that hostnames, snmp ports and whether access is tcp/udp will need to be stored for each server to be accessed.

The administrator account resides on the local machine, so a simple cron job will suffice


*NOTE: use cron, no external mail program should be used!


Part 3
: snmp is inherently insecure as it potentially exposes a huge amount of sensitive information about a host. As the above will be the only data required, a new snmpd.conf file (for Fedora 7) is required that exposes ONLY the minimum details to provide the requested data. Targets will use snmp v2c.

Part 4
: cron is ideal for running the script every hour, and emailing the results to the system administrator. You are required to produce the relevant crontab entries to enable the script to run every 15 minutes, and email the contents of the log file once a day.

* Notes:

1.You are not expected to set up or use an external email program. Use the existing facilities in the FC7 image. If you cant see how to email the results check the lectures!!!!

2.The target system for this program is Fedora Core 7, however these servers at Murdoch University that can be used for checking, as well as the lab image.

1.troll.murdoch.edu.au, TCP, port 1161

2.134.115.64.94, TCP, port 1161

3.134.115.64.95, TCP, port 1161



3.Do not "walk" the snmp tree and use perl to filter the data you are expected to retrieve ONLY the needed values from within your program.

Deliverables:

one file containing the Perl script, snmpd.conf lines inserted as comments, the crontab line inserted as a comment and the format of the configuration file. Note that descriptive comments about the snmpd.conf, crontab and configuration file information should also be included.



(This post was edited by shanks on May 18, 2008, 2:59 AM)


KevinR
Veteran


May 18, 2008, 9:34 AM

Post #2 of 2 (2914 views)
Re: [shanks] SNMP Data Retrieval (Pretty Easy!) [In reply to] Can't Post

That is a ridiculous request. Hire a programmer.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives