Sponsored Content
Full Discussion: Shell Script Extraction
Special Forums UNIX and Linux Applications Infrastructure Monitoring Shell Script Extraction Post 302429715 by clx on Tuesday 15th of June 2010 09:08:54 AM
Old 06-15-2010
try:

Code:
$ cat *.lookup
table juniper-MPLS-MIB_sev =
{
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspChange","2","13","1800"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspPathDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspPathUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoChange","2","13","1800"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathUp","1","2","0"}
}
default = {"Unknown","Unknown","Unknown"}
 
# hp-SEMI-MIB.sev.snmptrap.lookup v
SNMPTRAP-hp-SEMI-MIB-hpHttpMgCriticalHealthTrap 1 0 0
SNMPTRAP-hp-SEMI-MIB-hpHttpMgDeviceAddedTrap 1 0 0
SNMPTRAP-hp-SEMI-MIB-hpHttpMgDeviceRemovedTrap 1 0 0
SNMPTRAP-hp-SEMI-MIB-hpHttpMgHealthTrap 1 0 0
SNMPTRAP-hp-SEMI-MIB-hpHttpMgNonRecoverableHealthTrap 1 0 0
SNMPTRAP-hp-SEMI-MIB-hpHttpMgNonRecoverableHealthTrap   1       0 0
$ awk -F "\"| |\t" '/^\{"SNMPTRAP/ {print $2} /^SNMPTRAP/ {print $1}' *.sev.*.lookup 
SNMPTRAP-juniper-MPLS-MIB-mplsLspUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspChange
SNMPTRAP-juniper-MPLS-MIB-mplsLspPathDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspPathUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoChange
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathUp
SNMPTRAP-hp-SEMI-MIB-hpHttpMgCriticalHealthTrap
SNMPTRAP-hp-SEMI-MIB-hpHttpMgDeviceAddedTrap
SNMPTRAP-hp-SEMI-MIB-hpHttpMgDeviceRemovedTrap
SNMPTRAP-hp-SEMI-MIB-hpHttpMgHealthTrap
SNMPTRAP-hp-SEMI-MIB-hpHttpMgNonRecoverableHealthTrap
SNMPTRAP-hp-SEMI-MIB-hpHttpMgNonRecoverableHealthTrap
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with data extraction script

Hello all, Iam newbie here and to unix programming. I have the following text file. A:Woshington,B:London,C:Paris,D:Manchester,C:Lisbon,E:Cape town. Now I would like extract this and store in database. here is the script I have tried but it did work. CITY1:`echo "$text" | grep "A:"... (11 Replies)
Discussion started by: mam
11 Replies

2. Shell Programming and Scripting

Shell script for text extraction from a file

Hi All, I am new to Shell Scripting. I have a file consisting of XML messages.Each message is associated with a timestamp value(it is not a xml field).I need to extract\copy all messages in a particular time interval and put in another new file using Shell Scripting. My XML looks like... (3 Replies)
Discussion started by: vignesh53
3 Replies

3. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

4. Shell Programming and Scripting

Date and time range extraction via Awk or analysis script?

Hello does anyone know of an awk that will extract log file entries between a specific date and time range, eg: awk '/15\/Dec\/2010:16:10:00/, /15\/Dec\/2010:16:15:00/' access_log but one that works? Or a free command line log file analysis tool/script? I'd like to be able to view... (2 Replies)
Discussion started by: competitions
2 Replies

5. Shell Programming and Scripting

Pattern extraction and usage by shell script

Suppose im in a directory A. which has sub-directories x/y/z m/n/p etc. Iam only considered with those which have a file netl.oa at the lowermost level. So i used the find command which gives me a list in the form ./abc/def/ghi/jkl/netl.oa and so on Now i want the names abc def jkl and ghi. My... (3 Replies)
Discussion started by: sid.verycool
3 Replies

6. Shell Programming and Scripting

Correct shell script to Call One shell script from another shell script

Hi All, I have new for shell scripting. Problem : I have one scrip at serv1 and path of server is /apps/dev/provimage/scripts and script name:extract_ancillary.bat. I need to call this script at server2(my working server) and execute at server2 . Please let me know how to build the... (5 Replies)
Discussion started by: Vineeta Nigam
5 Replies

7. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

8. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

9. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. UNIX for Beginners Questions & Answers

Script for extraction of pattern

Anyone can help here, with a script to extract the highlighted details from this two blocks?Actually there are milions of block, this is a sample? dn: EpsStaInfId=EpsStaInf,serv=EPS,mscId=aaaaaa001aaaaaaaa629100100138702,ou=multiSCs,dc=mtncg structuralObjectClass: EpsStaticInf objectClass:... (19 Replies)
Discussion started by: gillesi
19 Replies
rmf(1mh)																  rmf(1mh)

Name
       rmf - remove folder

Syntax
       rmf [ +folder ] [ -help ] [ -[no]interactive ]

Description
       The  command  removes all of the messages within the current folder, and then removes the folder itself.  If there are any files within the
       folder which are not part of MH, they are not removed, and an error message is displayed.

       You can specify a folder other than the current folder by using the +folder argument.  If you do not specify a folder, and cannot find  the
       current folder, asks you whether you want to delete instead.

       If the current folder is removed, it makes current.

       Note that the command irreversibly deletes messages that do not have other links, so use it with caution.

       If  the folder being removed is a sub-folder, the parent folder becomes the new current folder, and tells you that this has happened.  This
       provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list  and  returning  to  the  current
       folder from which the list was extracted.

       Using to delete a read-only folder deletes the private sequence and current message information from the file, without affecting the folder
       itself.	If you have sub-folders within a folder, you must delete all the sub-folders before you can delete the folder itself.

Options
       -help	 Prints a list of the valid options to this command.

       -interactive
       -nointeractive
		 Asks for confirmation before deleting a folder.  By default, deletes a folder and its messages without asking	for  confirmation.
		 If  you  specify  the	-interactive option, asks if you are sure before deleting the folder.  You are advised to use this option,
		 since when deletes a folder its contents are lost irretrievably.

Examples
       This example shows how asks for confirmation when the -interactive option is used:
       % rmf -interactive +test
       Remove folder "test"? y

Profile Components
       Path:   To determine the user's Mail directory

Files
       The user profile.

See Also
       rmm(1mh)

																	  rmf(1mh)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy