How to monitor if Bitbucket Server is up and running

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Purpose

Administrators may wish to monitor if Bitbucket Server is up and running at any given time. This can also be used as a health check status endpoint for load balancers or proxies. This article suggests a simple approach to address this requirement.

Solution

For monitoring if your Bitbucket Server is up, you can periodically send the <Bitbucket_Base_URL>/status request and interpret the response received to such request.
For example, the following command:

curl <Bitbucket_Base_URL>/status

will return one of the following responses, depending on the current status of your Bitbucket Server:

ResponseHTTP response codeMeaning

curl: (52) Empty reply from server

OtherTomcat/Bitbucket Server is too busy to respond to this request.
{"state":"STARTING"}503The application is starting up, but not yet available Not yet ready to receive in-coming requests. It is optional to forward requests in this state. Users will see the Starting Bitbucket with the progress bar and Git requests will be queued until Bitbucket is ready for them. Requests could time out.
{"state":"FIRST_RUN"}200

The application is running for the first time and has not yet been configured. All requests to the web UI will be redirected to the First Run Wizard. Not ready to receive in-coming requests but request should still be forwarded to Bitbucket.

{"state":"RUNNING"}200Bitbucket is up and running Ready to receive in-coming requests.
{"state":"MAINTENANCE"}200The application is currently not available because the application is under maintenance. Blocking with the Load Balancer or proxy could block Bitbucket from coming out of maintenance mode. Should allow in-coming requests.
{"state":"ERROR"}500The application is currently not available because of an error. Not ready to receive in-coming requests.
{"state":"STOPPING"}503The application is shutting down.

Note

DescriptionMonitor Bitbucket Server
ProductBitbucket Server, Bitbucket Data Center

Last modified on Dec 20, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.