Sail Knowledgebase

Monitoring Uptime and Application Health with Sail CLI

In this guide you will learn how to enable WordPress application monitoring, configure contacts and alerts with Sail CLI.

If you like Sail, don't forget to give us a star on GitHub!

Note: The uptime and health monitoring is a paid feature available only for users with an active Sail Premium subscription.

What is monitoring

The Sail Monitor can check whether your site is working or not every minute, and send you e-mail and text alerts if it's down. In addition to that, the Monitor runs periodic health-checks on your Sail server, to make sure everything is running and up-to-date.

Enable the monitor

To enable the monitor for your Sail project, run:

sail monitor enable

This will enable both the uptime monitor as well as the health-check monitor. Note that it may take a couple of minutes for the metrics to start showing.

View monitor status

You can view the status of your monitor using:

sail monitor status

This will show you the current uptime data, and the results of the last successful health-check on your server. Here's an example output:

Sail Monitor Status

The uptime data shows:

  • Status: The current UP/DOWN status, response code and duration
  • Reason: If the site is DOWN, the reason will be displayed on this line
  • Uptime: The uptime in percent over the last 24 hours, 7 days and 30 days
  • Avg. Resp: The average response time in the last 24 hours
  • Alerts: The number of alert contacts configured

This data is available in almost real-time.

The health section shows:

  • Core: The current WordPress core version and whether an update is available
  • Plugins: The number of plugins that are up-to-date
  • Themes: Number of installed WordPress themes that are up-to-date
  • Server: The number of server packages that have an update available
  • Disk: The server disk usage
  • Updated: The last time the health data was updated

Health data is updated after a health-check runs against your server. Typically we run one when monitoring is first enabled, and then a couple of times per day.

Working with contacts

If you'd like to be notified when your site goes DOWN and back UP, you should add contacts to the Sail Monitor. We currently support phone and e-mail contacts. To add a contact run:

sail monitor contact add

To add a phone number use:

sail monitor contact add +140411223344

Make sure you use the full phone number with country and area codes, no spaces or any other non-numeric characters, except the leading plus sign.

Before a contact can receive alerts, it has to be verified. A message will be sent to the contact, containing a 6-digit verification code. Use this code to verify the contact, for example:

sail monitor contact verify 123456

After a contact is verified, it will receive alerts from Sail Monitor.

To list all existing contacts for your Sail application, use:

sail monitor contact list

Delete a contact with:

sail monitor contact delete

Snooze alerts

The monitor will send up/down notifications to the defined and verified contacts. If you wish to pause the alerts, when undergoing maintenance for example, use:

sail monitor snooze 30m

This will snooze the alerts for 30 minutes. If you wish to unsnooze alerts, run:

sail monitor unsnooze

Disable monitoring

You can disable monitoring with:

sail monitor disable

This will stop the downtime monitor and health checks completely.

Site is down, what's next?

If your site is DOWN, here's a general list of things you should do:

  • Confirm that the site is actually down
  • If you deployed any recent changes to the site, consider rolling them back
  • If your have not deployed any changes via Sail but have made changes in production, consider restoring a remote backup or a local one
  • If that does not help and the server is online, check your server logs with sail logs
  • If your server is offline completely, check your cloud provider status pages and/or reach out for support
  • If you're out of ideas, feel free to ask in #help on our community Slack

If you have any questions about uptime and health monitoring, managing contacts and alerts, feel free to get in touch.