Write a script to probe the an SNMP agent and find the rate of change for several counters between successive probes/ samples. The rate calculated for each counter/OID should be displayed on the console, one line for each calculated rate, the output format will be described in detail in 'output format'. Futhermore, as the only requirement on the OIDs is that they are of the type COUNTER, this means that there are both 32 and 64 bit versions of counters. Your solution should handle both counter types, and in the case that a counter wraps (ie goes from a high number to a low number), your solution should address/rectify (if its possible). The solution needs also to handle that an SNMP agent restarts (i.e. the sysUpTime OID becomes less than it was before, ie. it starts counting from zero), and timeouts, i.e. the device does not respond to your request in time. It will be tested that your solution maintains the requested sampling frequency (i.e. the requests from your solution should be sent so that the sampling frequency is maintained, irrespectively if the device has responded or not).
The script will be invoked as follows:
prober <Agent IP:port:community> <sample frequency> <samples> <OID1> <OID2> …….. <OIDn>
IP, port and community are agent details,
OIDn are the OIDs to be probed (they are absolute, cf. IF-MIB::ifInOctets.2 for interface 2, or 220.127.116.11.18.104.22.168.1.10.2 )
Sample frequency (Fs) is the sampling frequency expressed in Hz, you should handle between 10 and 0.1 Hz.
Samples (N) is the number of successful samples the solution should do before terminating, hence the value should be greater or equal to 2. If the value is -1 that means run forever (until CTRL-C is pressed, or the app is terminated in someway).
Following are the files to be submitted: Note: The file has to be submitted with ".txt" extension so that plagiarism control will work.
[url removed, login to view]
Script that probes the agent, may be written in any language (perl, python,etc.), make use of the SHEBANG to handle what language interpreter that execute the script.
If you use a complied language, make sure that the compiler outputs the correct filename on the executable.
What ever language you choose to implement the solution in, make sure that you use a proper API for the SNMP communication, i.e. using system commands is not the way to do it. The aim is to train API interaction.
The output from the script _MUST_ be as follows:
Sample time | OID1 | OID2 | .... | OIDn
Sample time: Timestamp of the last sample, in UNIX time (seconds).
OID*: Rate of OID* between the last two successful samples
As an example:
1504083911 | 2124 | 819 | 0 | 281761
1504083912 | 2471 | 819 | 110 | 450782
1504083913 | 1904 | 819 | 2000 | 325448
Your solution will be tested against a simulated/real SNMP agent, where the behavior is known.
A test script will be launch your solution and validate the results against the known results. The script will check:
- that the solution generates the correct number of samples, as requested, at the requested sample frequency.
- that the solution sends the snmp request at the required sampling frequency, will be tested by packet tracing.
- that the SNMP request contain all the requested OIDs, by packet tracing
- that the solution handles non-responsive SNMP agents, ie. timeouts. Ie the inter sample time presented in console would be n/Fs where Fs is sample frequency and n=1,2,3,...
- that the solution handles that the SNMP agent restarts/reboots
- that the output from the solution matches the configuration of the agent
- that the solution handles counters that wrap around, both 32 and 64 bit counters.
Use SysUpTime as to detect device reboots and to obtain the device time when calculating rates.
 [url removed, login to view]
 [url removed, login to view]
7 freelancere byder i gennemsnit kr998 på dette job
Hi I have done similar work before I can provide you samples of my previous work and can forward you with the same the work will be provided with quality and in timely manner thanks