Need to collect & compare JVM arguments


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to collect & compare JVM arguments
# 1  
Old 04-02-2015
Need to collect & compare JVM arguments

I have a server.out file which looks like the below...

Code:
JAVA Memory arguments: -XX:ParallelGCThreads=12 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Xms2048m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=800m -XX:MaxNewSize=800m -XX:SurvivorRatio=8 -XX:-UseBiasedLocking -XX:-UseThreadPriorities -XX:LargePageSizeInBytes=128m -XX:+CMSParallelRemarkEnabled -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+DisableExplicitGC -Dcom.wily.introscope.agentProfile=/opt/app/wlserver_12.1/wilyAgent/wily/IntroscopeAgent.profile -javaagent:/opt/app/wlserver_12.1/wilyAgent/wily/Agent.jar
.
WLS Start Mode=Production
.
CLASSPATH=/opt/app/weblogic_patch.jar:/opt/app/weblogic_patch.jar:/opt/app/jdk/jdk1.6.0_45/lib/tools.jar:/opt/

Question 1:
I need to read all the JVM args in variables and compare them like
if -Xms is not found display " -Xms not Found" and if Found then compare if valueof-Xms <= valueof-Xmx echo "Good" else echo "Bad".

Question 2:
How will i understand that all the JVM arguments have been read from the server.out

Last edited by mohtashims; 04-02-2015 at 10:20 AM..
# 2  
Old 04-02-2015
HINT:
First parse using "-" as the delimiter, then for each argument found (23 of them), parse each using ":".

For example, assuming JAVA MEMORY ARGUMENTS up to the Agent.jar file is one line...

Code:
egrep "^JAVA Memory arguments" server.out | awk -F\- '{print NF}'
23

I just counted the arguments. Your script should loop NF times and parse those arguments for ":" and handle cases of -Xmsxxx.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ps command does not output JVM arguments

Hi, My OS is: SunOS mymachine 5.10 Generic_148888-04 sun4v sparc SUNW,SPARC-Enterprise-T5220 I wish to get as much detailed information regarding a java process like the JVM args etc however my current ps command does not yield any detailed output but just one short line. bash-3.2$ ps -ef... (4 Replies)
Discussion started by: mohtashims
4 Replies

2. Shell Programming and Scripting

How to Read & Compare Two Files

Hi forumers, How is it going. Ok i need some advice on the following problem. I have 2 files to read and compare data.FileA and FileB. FileA will return either status 1 or 0. FileB on the other hand is trickier and has the following details:- Count DeviceID CurrentStatus ... (7 Replies)
Discussion started by: prakash1111
7 Replies

3. Shell Programming and Scripting

Compare two files A & B and accordingly modify file A

Friends, i have two huge complex files (for eg :A & B)as output , the sample contents of the files are as follows : A == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2) A5066,20/04/2010,25000,50000,75000 A5049,20/04/2010,25000,60000,85000 B == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)... (2 Replies)
Discussion started by: appu2176
2 Replies

4. UNIX for Dummies Questions & Answers

How to compare 2 files & get specific value & replace it in other file.

Hiiii Friends I have 2 files with huge data. I want to compare this 2 files & if they hav same set of vales in specific rows & columns i need to get that value from one file & replace it in other. For example: I have few set data of both files here: a.dat: PDE-W 2009 12 16 5 29 11.11 ... (10 Replies)
Discussion started by: reva
10 Replies

5. Shell Programming and Scripting

compare & split files

Hi All, I've 1 big file like: cat nid_lec_rej_20090804_merged 10084MOCLEC 0408090061480739nid090804132259.03.148990533 2526716790000008947850036448540401014 R030007150692000 2535502720000000010100036165742685000 R030007150354000 ... (12 Replies)
Discussion started by: ss_ss
12 Replies

6. Shell Programming and Scripting

How to search & compare paragraphs between two files

Hello Guys, Greetings to All. I am stuck in my work here today while trying to comapre paragraphs between two files, I need your help on urgent basis, without your inputs I can not proceed. Kindly find some time to answer my question, I'll be grateful to you for ever. My detailed issue is as... (10 Replies)
Discussion started by: NARESH1302
10 Replies

7. Shell Programming and Scripting

Compare & append

I need to write a Shell Script to compare two files & display the result. If the two files are different append them and store them in a new file. How do i proceed...can someone give me a coding ? (3 Replies)
Discussion started by: rohits1991
3 Replies

8. Shell Programming and Scripting

Compare two file & output

Hi every body i have a problem need help urgently file 1 (approx 200K entries) aaaaa bbbb cccccc dddd ffff file 2 (approx 2 million entries) aaaaa,1,ee,44,5t,6y, bbbb,3,ff,66,5u,8r, cccccc, ..... dddd, ..... eeeeee, ..... ffff, ...... (5 Replies)
Discussion started by: The_Archer
5 Replies

9. Shell Programming and Scripting

Sum values & compare with footer

Hi All, I have a file abc.txt with 3 fileds. Field 3 contains amount. Also at the end of file there is a Footer record, which contains total amount. I need to calculate total sum of these fields & need to compare it with footer record. I have serched in thi site, many has asked this... (7 Replies)
Discussion started by: Amit.Sagpariya
7 Replies

10. Shell Programming and Scripting

How do i collect Date & Time from Different Directories in a script

How do i collect Date & Time from Different Directories in a script The script iam using for a single directory is : ls -l | grep awk '{print $8}' (2 Replies)
Discussion started by: laknar
2 Replies
Login or Register to Ask a Question