Hi people,
My apologies on the somewhat novice question. Please bear with me.
We regularly get snmp data from our routers the format is below.
col-1 col-2 col-3 col-4 col-5 col-6 col-7 col-8
23/10/2003 00:00 00:04:19 302 0.26 1.18 3617.13 657.42 2959.71 29
23/10/2003 00:00 00:24:30 315 0.67 0.86 3804.99 1665.32 2139.67 28
col-1 - Sample Time
col-2 - "Delta Time"
col-3 - "Bandwidth Utilization In %"
col-4 - "Bandwidth Utilization Out %"
col-5 - "Bytes/sec Util"
col-6 - "Bytes In" "/sec"
col-7 - "Bytes Out" "/sec"
col-8 - latency
********************************
I currently use the following commands to generate the gnuplot graps of the columns im intrested in.
I put this series of commands in a executable file called 'stats' and run it by doing ./stats
**********COMMAND***************
awk '{ print $1, $4, $5 }' RTP*Theale*B* | sed 's/"/ /g' | sed 's/,/ /g' > theale-B; awk '{ print $1, $2 }' theale-B > data-in; awk '{ print $1, $3 }' theale-B > data-out; ./graph
RTP*Theale*B* - file that contains snmp data
theale-B - file to pipe into
data-in and data-out - made the file name generic to save me having to manaully input all the time
graph(Chart:Graph module) - executable that plots graph taken in the data in/out has input
But each time I run this stats script(dont know wether to call it a script or not) I have to manually input the file(RTP*Theale*B*) and the file to pipe into (theale-B).
Is it possible to modify this script to ask for input for the file names without having to open it with vi and modify.
My apologies again but I am quite desperate for help. Any help or advice will be greatly appreciated.
regards,
gab
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.