Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to write a Shell Scripting to know the services running or not in linux

Hi, 

How to write a Shell Scripting to know the services running or not in linux. 

Ex: If service is stopped automatically get the mail notification "JIRA Service has stopped". 

after wrote the scripting by using shell and Where to keep the scripting file in JIRA. 

 

 

1 answer

0 votes
Leo Community Leader Nov 11, 2019

Hi @Chandramouli Bollareddy ,

I'm not sure it answers your question or not.but you can try this out

the below rest api will give you the status of your confluence/jira service: BASE-URL/status

you can include this in your shell script and based on the result trigger mail

To check periodically set a cron job for the same

200

{"state":"RUNNING"}

Running normally

500 

{"state":"ERROR"}

An error state

503

{"state":"STARTING"}

Application is starting

503

{"state":"STOPPING"}

Application is stopping

200

{"state":"FIRST_RUN"}

Application is running for the first time and has not yet been configured

404

 

Application failed to start up in an unexpected way (the web application failed to deploy)

 

BR,

Leo

I don't want to check jira service status in browser. 

I need shell scripting..if service is stopped then automatically recevied an email. 

Derek Fields Community Leader Nov 11, 2019

You can do this using curl. 

curl http://localhost:8080/status | grep RUNNING > /dev/nul
[ $? -eq 0 ] && echo "Running" || echo "Error"

Obviously, you would do something other than echo based on success or failure 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you