Leslie,
yes, there is a bug in the variables in the awk part of the script.
Instead of being $4, $5, $6, $3 are $5, $6, $7, $4. I supressed the part of
the script with $p
The script I'm using now is a simplified version of the one in man pages.
It works well.
# nvrecorta num_of_lines FILE
# |
# |__> number of lines (latest lines) of FILE that are
kept
# In the awk program:
# $5=startTime, $6=endTime, $7=dottedIPAddr, $4=value
snmpColDump -tTI $2 | \
awk '{printf("%d\t%d\t%s\t%1g\n", $5, $6, $7, $4)}' | \
tail -$1 | snmpColDump -r - $2
rm $2~ # deletes a temporary file
I hope that helps.
Regards,
Juan.
Juan Echevarría López
AT&T Global Network Services
Internet: jechevarria@att.com
"Leslie Clark/Southfield/IBM" <lclark@US.IBM.COM> on 14/10/2000 00:21:08
Please respond to IBM NetView Discussion <nv-l@tkg.com>
To: NV-L@tkg.com
cc:
Subject: [NV-L] Sample age-off of snmpCollect data
Ok, does anyone have a sample based on the snmpColDump
man page that works? I think maybe there are some typos in that
example (a fine old tradition, I know). But I can't see what's wrong.
And what is that $p for!?! I'm talking about the example where
you replace the data file with just the last so-many records of the
data file. Any clues appreciated..
Cordially,
Leslie A. Clark
IBM Global Services - Systems Mgmt & Networking
Detroit
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
|