Maybe it would be easier if I started from the beginning... I think I may have confused the issue big time.
There is a directory on my server that has 40K+ files in it. If you opened up the folder where these files are located you would see something like this:
As you can see, every event file name starts with "Event".
The reason why there are so many event files is that our application supports 100's of manufactures in managing their devices. Each device is loaded with their manufacture's "smarts" in their firmware. An example would be a Cisco 3750 switch or an IBM BladeCenter HS22 or the 100's of others that we are managing. As you can imagine, each device sends its own type of device messages (sometimes they are in "traps" and other times they are as a result of a "polled" attribute from the management system). For every type of device message and for every type of device manufacturer I have an Event file.
Here is an example of text that is found in the event file named Event01169b15 (note: this is the raw file this is used for incoming traps for this device and alert type)
NOTE:
{S 1} means the String from Varbind #1 in the trap,
{S 3} means the String from the Varbind #3 in the trap,
{T iddmodAlarmSummaryUpDown 4} means it is looking up a Table named "iddmodAlarmSummaryUpDown" for its information.
When the device, in this example, an IBM Director Host, sends a trap that matches this event message the information we get within our application looks like this:
Here's another example of another event. This event is named Event00011223 and the raw file looks like this:
NOTE:
{D 2} means a DateStamp in VarBind #2 from the trap.
{I 10} means in Integer in VarBind #10 from the trap.
{S 11} means a String in VarBind #11 from the trap.
etc.
And here is what an actual alert looks like from a device that matches the criteria set up to use this event message:
As you can see from these two examples, the event file does not have a set standard for its format because we are dealing with different manufacturers that do things differently.
I don't need to have a script that would take into account every single permuatation of the 40k+ event files.... rather I am interested in understanding the logic to create a script for each event type that I am insterested in parsing out additional information. So I would have a script for Event01169b15 and a separate script for Event00011223. Although the Events would be different, as far as the text goes, the logic I would think would be very similar.
In the first example, (assuming this is an event that I am going to use in another application that uses the SetScript) the portion of my SetScript that deals with the actual EventMessage, it might look something like this:
NOTE: I got the sed command from another post. I'm wondering if it would work?
For the other example, another SetScript, renamed to LiveHealthSetScript, would look something like this:
So, you see, even though I am using different event files I am using them the same way, that is, I am parsing the $EVENTMSG for the things I need on a case by case basis.
Is this what you were looking for?
And, at the risk of sounding like a broken record, THANKS!!!!!
Hi all, I have a problem surfacing and I hope you all could help.
What I have to do is take a input file and fill out a fax template from that file. The biggest problem I found was I have to parse the string "//FAX(faxnumber=555-5555;style="style1";
and on and on. The string can be in any... (5 Replies)
I need to pick a field out of a variable record - the field is always found 4 fields after a certain text string, but it can be on any line of the record and in any position across the record on a line. I have had no luck through any of the Unix editors being able to cut a field that isn't always... (17 Replies)
I know solution to this but I was wondering if its easier than what i think
I have to pass 20 parameters to a script, which of course is not working so I parsed $3 to be a pipe deliminated string
for instance below
a.ksh One Two Compa|Compb|Compc|compd|.............
Now i have to read... (5 Replies)
Hi,
I want to get an input from user and parse the input. The legal characters allowed in the input are alnum(a-zA-Z0-0), . , -
Also the first and las characters must be alnum only.
e.g
if the input is abc.ghh-sok.com then the script should return correct, and if the input is like... (2 Replies)
Hi I am new to shell scripting. I need to parse a file which contains the header and detail records and split into n of file based on dept ID, for ex.
INPUT FILE:
DEPT ID: 1
EMPNAME: XYZ
EMPAddress: XYZZZ
DEPT ID: 2
EMPNAME: ABC
EMPAddress: ABCD
DEPT ID: 1
EMPNAME: PQR
EMPAddress:... (6 Replies)
Can someone help me? I have been looking in the archives as I am sure this is very simple to do, but I do not know.
I have a variable which sometimes contains a file name and sometimes contains a fully qualified file name.
I want to be able to separate the directory from the file name into 2... (3 Replies)
Hello,
somewhere in a shell script, i am storing the output of "ls" into a variable. My question is how can i parse this variable to get each filepath. I don't want to create a temporary file to write down all the filenames and then parse it..
is there a easy way out..
here is what... (3 Replies)
I have the following XML
<Audit_Type>1</Audit_Type><Session_Id>34505863</Session_Id>
<StatementId>1</StatementId><EntryId>1</EntryId>
<Extended_Timestamp>2012-03-06T10:25:20.789459</Extended_Timestamp>
<DB_User>KASINIY</DB_User>
<OS_User>majohn1</OS_User><OS_Process>28636</OS_Process>... (3 Replies)
i have a log file that contains something similar to this:
one two three four five six seven eight
nine ten eleven twelve thirteen fourteen
one two three four five six seven eight
nine ten eleven twelve thirteen fourteen
one two three four five six seven eight
nine ten eleven twelve... (3 Replies)
Hi All,
i had to split one files into 10 equally. For that i have coded below awk.
OUTPUT_FILE=/home/sit/path/Files/file_EXPORT.lst
DIR_NM=`dirname ${OUTPUT_FILE}`
awk -v CURR_DATE="$(date +'%d-%m-%Y-%H-%M')" -v pth=$DIR_NM '{print >> pth/"tgt_file_name"CURR_DATE"_"NR%10 }' ${OUTPUT_FILE}
... (7 Replies)