pattern matching question - java with two parameters to check (349 Views)
Reply
Occasional Contributor
Senir Christian
Posts: 10
Registered: ‎06-03-2009
Message 1 of 5 (349 Views)
Accepted Solution

pattern matching question - java with two parameters to check

We have plenty of java process monitors in place but a new requirement came before us.  Monitor a java with these two strings...

 

-Dweblogic.Name=AdminServer

And

-Daismt.env=prod

 

So I would think that

 

-Dweblogic.Name=AdminServer<*> -Daismt.env=prod

 

would work as parameter and in fact does pass my matching test when i copy the grep result into pattern matching test box.  But when I deploy the policy it does not find a match and sends an alert.

 

I am reluctant to post entire grep for ps -ef | grep java but just know there is a string between the two parameters I am checking for.

 

Guy (not Senir, he was selfish and used his name in our account)

 

Thanks for any suggestions :-)

Please use plain text.
Valued Contributor
gope
Posts: 51
Registered: ‎09-05-2005
Message 2 of 5 (315 Views)

Re: pattern matching question - java with two parameters to check

Hello,

 

Does the parameter string end with "-Daismt.env=prod"?

 

Try the following ( add <*> at the end of parameter list)...
-Dweblogic.Name=AdminServer<*>-Daismt.env=prod<*>
Note :- Assuming the parameter starts with "-Dweblogic.Name=AdminServer"
 

Best Regards,
Gopinath Manickam

To show your appreciation, click KUDOS !!!
Please use plain text.
Valued Contributor
Raymond Meijer
Posts: 98
Registered: ‎02-20-2008
Message 3 of 5 (301 Views)

Re: pattern matching question - java with two parameters to check

Is the managed node a Solaris box?

 

If so, if you use ps -ef to list the process not all parameters may be shown and you'll have to use /usr/ucb/bin/ps auxwww instead to display all command parameters...

Please use plain text.
Occasional Contributor
Senir Christian
Posts: 10
Registered: ‎06-03-2009
Message 4 of 5 (271 Views)

Re: pattern matching question - java with two parameters to check

Great idea, thank you, testing now.

 

-Guy

Please use plain text.
Occasional Contributor
Senir Christian
Posts: 10
Registered: ‎06-03-2009
Message 5 of 5 (270 Views)

Re: pattern matching question - java with two parameters to check

Redhat box.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation