LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2008, 11:48 AM   #1
PKrishna
LQ Newbie
 
Registered: Mar 2008
Posts: 10

Rep: Reputation: 0
URGENT: Please validate this script


Friends, I work on Cisco routers and switches and dont know much about Scripting. I had to pull the syslogs from 2000 plus routers and swithches and add the device names to the logs after removing not so important messages. i wrote the following in linux and tested it many times without any errors on many dummy syslog messages. but now it has to go live. could someone please validate this please. missing any messages from important devices could be fatal for me.

1) i used grep -v options to remove all non critical syslog messages
2) cat syslog | awk '{print $3 " " $9 " " $10 " " $11 }' > imposyslogs
3) sort and then uniq to get unique messages
4) join inventory syslog > final

* inventory has 2000 devices and its IP addresses

* syslog is 200MB file with around 5000000 messages of the following format


Mar 29 23:19:46.824 GMT: %C4K_IOSMODPORTMAN-4-POWERSUPPLYFANBAD: Fan of power supply 2 has failed
Mar 30 08:19:46.824 JST: %SW_VLAN-3-VLAN_PM_NOTIFICATION_FAILURE: VLAN Manager synchronization failure with Port Manager over port mode change
Mar 10 09:55:22.109 IST: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/38, changed state to up
Mar 10 09:55:24.877 IST: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/38, changed state to down
Mar 10 09:55:46.260 IST: %SYS-2-MALLOCFAIL: Memory allocation of 36688 bytes failed from 0x5E4204, alignment 8


Do you see any chances of failure in this logic? Please let me know if you find any mistakes. I have never run this on a 200MB syslog file
Your comments would be very much appreciated. thanks in advance!
 
Old 04-01-2008, 12:03 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
This is not urgent for us, so please do not mark it as such. It is not on to demand priority attention from a voluntary community.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent : creating folder using bash script prernasin Linux - Newbie 2 09-26-2007 02:58 AM
need urgent help with bash script ferradura Linux - General 4 09-11-2007 05:32 PM
URGENT: script dhcp options nunuschi Programming 4 08-27-2006 09:09 AM
Urgent - Duplicate Script File Colly McKenna Linux - Newbie 8 03-16-2006 02:18 AM


All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration