Your sample data in a file called data:
Passing it through a tr filter to remove all characters that are not a decimal digit, decimal point, minus sign, space, or newline yields:
Assuming that your sample data is representative of the two forms of records you mentioned, and that you did not neglect to mention any special cases, a line with 6 numbers is a single line record that only requires appending three zeros; a line with 7 numbers is the start of a multiline record and is followed by three lines of 4, 3, and 5 fields respectively (all field counts are after tr filtering). The following AWK assembles what remains into what's desired, before passing it through another tr filter to squeeze mulitple spaces into a single space:
Regards,
Alister
Hi guys, i need your help.
I need to convert a date like this one 20071003071023 , to a formated date
like 20071003 07:10:23 .
Could this be possible ?
Regards,
Osramos (6 Replies)
Hi Everyone, I've been using this site as a great resource to aid me with simple search and replace tasks. I still consider myself a novice and now I've been pulling my hair out over this problem. Any hints or suggestions would be welcome!
I have a text file in a format like this
name:... (6 Replies)
Hello!!!
I am using shell script that print some formated text on the screen (example)
========
hello I am ...
========
Is it possible to print this information to the printer exactly as I see it on the screen??? (6 Replies)
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Hello,
I have a file ff.txt that looks as follows
*ABNA.txt
356
24
36
112
*AC24.txt
457
458
321
2
ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
Hi I am part of a academic organization and I want to send a fax to the students however there must be a quicker way to get the fax numbers extracted from the online forms they sent me.
The file looks like this (numbers are fake in order to protect identity):
Biochemistry Major
Michael... (3 Replies)
How to split the file and have suffix with formatted numbers
Tried the following code
awk '{filename="split."int((NR-1)/2)".txt"; print >> filename}' split.txt
Current Result
Expected Result (21 Replies)
Dear All,
I have to solve the following problems with multiple tab-separated text file but I don't know how. Any help would be greatly appreciated. I have access to Linux mint (but not as a professional).
I have multiple tab-delimited files with the following structure:
file1:
1 44
2 ... (5 Replies)
I need to sum up the values in field nr 5 in a data file that contains some file listing. The 5th field denotes the size of each file and following are some sample values.
1,775,947,633
4,738
7,300
16,610
15,279
0
0
I tried the following code in a shell script.
awk '{sum+=$5} END{print... (4 Replies)
Discussion started by: krishmaths
4 Replies
LEARN ABOUT V7
snmpdelta
SNMPDELTA(1) Net-SNMP SNMPDELTA(1)NAME
snmpdelta - Monitor delta differences in SNMP Counter values
SYNOPSIS
snmpdelta [ common options ] [-Cf] [ -Ct ] [ -Cs ] [ -CS ] [ -Cm ] [ -CF configfile ] [ -Cl ] [ -Cp period ] [ -CP Peaks ] [ -Ck ] [ -CT ]
AGENT OID [ OID ... ]
DESCRIPTION
snmpdelta will monitor the specified integer valued OIDs, and report changes over time.
AGENT identifies a target SNMP agent, which is instrumented to monitor the given objects. At its simplest, the AGENT specification will
consist of a hostname or an IPv4 address. In this situation, the command will attempt communication with the agent, using UDP/IPv4 to port
161 of the given target host. See snmpcmd(1) for a full list of the possible formats for AGENT.
OID is an object identifier which uniquely identifies the object type within a MIB. Multiple OIDs can be specified on a single snmpdelta
command.
OPTIONS
COMMON OPTIONS
Please see snmpcmd(1) for a list of possible values for COMMON OPTIONS as well as their descriptions.
-Cf Don't fix errors and retry the request. Without this option, if multiple oids have been specified for a single request and if the
request for one or more of the oids fails, snmpdelta will retry the request so that data for oids apart from the ones that failed
will still be returned. Specifying -Cf tells snmpdelta not to retry a request, even if there are multiple oids specified.
-Ct Flag will determine time interval from the monitored entity.
-Cs Flag will display a timestamp.
-CS Generates a "sum count" in addition to the individual instance counts. The "sum count" is the total of all the individual deltas
for each time period.
-Cm Prints the max value ever attained.
-CF configfile
Tells snmpdelta to read it's configuration from the specified file. This options allows the input to be set up in advance rather
than having to be specified on the command line.
-Cl Tells snmpdelta to write it's configuration to files whose names correspond to the MIB instances monitored. For example, snmpdelta
-Cl localhost ifInOctets.1 will create a file "localhost-ifInOctets.1".
-Cp Specifies the number of seconds between polling periods. Polling constitutes sending a request to the agent. The default polling
period is one second.
-CP peaks
Specifies the reporting period in number of polling periods. If this option is specified, snmpdelta polls the agent peaks number
of times before reporting the results. The result reported includes the average value over the reporting period. In addition, the
highest polled value within the reporting period is shown.
-Ck When the polling period (-Cp) is an increment of 60 seconds and the timestamp is displayed in the output (-Cs), then the default
display shows the timestamp in the format hh:mm mm/dd. This option causes the timestamp format to be hh:mm:ss mm/dd.
-CT Makes snmpdelta print its output in tabular form.
-Cv vars/pkt
Specifies the maximum number of oids allowed to be packaged in a single PDU. Multiple PDUs can be created in a single request. The
default value of variables per packet is 60. This option is useful if a request response results in an error becaues the packet is
too big.
EXAMPLES
$ snmpdelta -c public -v 1 -Cs localhost IF-MIB::ifInUcastPkts.3 IF-MIB::ifOutUcastPkts.3
[20:15:43 6/14] ifInUcastPkts.3 /1 sec: 158
[20:15:43 6/14] ifOutUcastPkts.3 /1 sec: 158
[20:15:44 6/14] ifInUcastPkts.3 /1 sec: 184
[20:15:44 6/14] ifOutUcastPkts.3 /1 sec: 184
[20:15:45 6/14] ifInUcastPkts.3 /1 sec: 184
[20:15:45 6/14] ifOutUcastPkts.3 /1 sec: 184
[20:15:46 6/14] ifInUcastPkts.3 /1 sec: 158
[20:15:46 6/14] ifOutUcastPkts.3 /1 sec: 158
[20:15:47 6/14] ifInUcastPkts.3 /1 sec: 184
[20:15:47 6/14] ifOutUcastPkts.3 /1 sec: 184
[20:15:48 6/14] ifInUcastPkts.3 /1 sec: 184
[20:15:48 6/14] ifOutUcastPkts.3 /1 sec: 184
[20:15:49 6/14] ifInUcastPkts.3 /1 sec: 158
[20:15:49 6/14] ifOutUcastPkts.3 /1 sec: 158
^C
$ snmpdelta -c public -v 1 -Cs -CT localhost IF-MIB:ifInUcastPkts.3 IF-MIB:ifOutcastPkts.3
localhost ifInUcastPkts.3 ifOutUcastPkts.3
[20:15:59 6/14] 184.00 184.00
[20:16:00 6/14] 158.00 158.00
[20:16:01 6/14] 184.00 184.00
[20:16:02 6/14] 184.00 184.00
[20:16:03 6/14] 158.00 158.00
[20:16:04 6/14] 184.00 184.00
[20:16:05 6/14] 184.00 184.00
[20:16:06 6/14] 158.00 158.00
^C
The following example uses a number of options. Since the Cl option is specified, the output is sent to a file and not to the screen.
$ snmpdelta -c public -v 1 -Ct -Cs -CS -Cm -Cl -Cp 60 -CP 60
interlink.sw.net.cmu.edu .1.3.6.1.2.1.2.2.1.16.3 .1.3.6.1.2.1.2.2.1.16.4
fi
SEE ALSO snmpcmd(1), variables(5).
4th Berkeley Distribution 25 Jul 2003 SNMPDELTA(1)