cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Starfighter Starfighter
Starfighter
  • 303 Views

How to validate my JVM is running or not via bash script

Hi All,

 

In my machine Jboss EAP 7 product and three instances are up and running.


here 2 scenarios 

1) 3 JVM is up and running then how to validate via bash script 

2) if 1 JVM is up and running & remains 2 is not up and running, how to validate via bash script.

above mentioned both scenarios should execute one bash script for validation.

 

Example : 

JVM names :

JVM-Dev , JVM-QC  & JVM-UAT.


Please provide me above mentioned 3 JVM is up and running or not validate via bash script.

I hope , explained problem clearly.

I am waiting for your valuable information.

 

Regards, 

Jeesshnasree

Labels (1)
1 Reply
Chetan_Tiwary_
Community Manager
Community Manager
  • 280 Views

You can use "pgrep -f java_app"  or "pgrep -x java_app" in your script to identify the java process ( https://man7.org/linux/man-pages/man1/pgrep.1.html ) and then use if - else statement in your script to echo the desired output based on number of JVM processes running. 

0 Kudos
Join the discussion
You must log in to join this conversation.