How to monitor your MySQL database server and get an E-mail when it goes down

This comprehensive guide teaches you to configure automated email notifications for database connection failures or restorations. Packed with a clear system schematic, a concise video tutorial, and a detailed walkthrough with screenshots, this guide caters to all learning styles. Learn how to personalize notification settings in just 10 minutes and gain the power to stay informed about the status of your database connections. Take control with Ozeki SMS Gateway – dive into the guide today!

What is an e-mail alert?

An e-mail alert is an automatic response to a certain event occurring. When that event happens, Ozeki SMS Gateway sends a custom e-mail to a designated e-mail address, letting the owner know the event has occurred.

Monitoring MySQL database server and getting an E-mail when it goes down

Figure 1 explains how the alarm works. Ozeki SMS Gateway monitors your database connection. When the database connection's connectivity changes from online to offline or vice versa, Ozeki SMS Gateway sends an alert message to the e-mail server through SMTP, which upon the alert message's arrival, sends an e-mail to the system admin's e-mail address.

database alarm
Figure 1 - Database alarm

Monitoring MySQL database server and getting an E-mail when it goes down (Video tutorial)

This quick video guides you through setting up Gmail notifications for database connection changes. See how easily you can configure email alerts for critical events within Ozeki SMS Gateway, ensuring you stay on top of your system's health, all within barely two minutes, making this watch worthy of your time.

Video 1 - How to monitor MySQL database server and getting an E-mail when it goes down (Video tutorial)

Monitoring MySQL database server and getting an E-mail when it goes down (short steps)

  1. Setup Gmail client
  2. Test Gmail client
  3. Create new alarm
  4. Set up alarm
  5. Turn database connection offline
  6. Check alarm if it sent out the e-mail
  7. Check Gmail client if it received the e-mail
  8. Turn database connection back online
  9. Check if alarm sent the e-mail
  10. Check if Gmail client received the e-mail

Monitoring MySQL database server and getting an E-mail when it goes down (Detailed guide)

Inside Ozeki SMS Gateway, click on the Connect icon as shown in Figure 2, and install the Gmail client.

Install gmail client
Figure 2 - Install gmail client

Configure the Gmail client by entering your desired credentials, as you can see in Figure 3.

Configure gmail account
Figure 3 - Configure gmail account

To see if everything is working so far, head over to the Test tab, highlighted in red in Figure 4, and send a test e-mail. If done correctly, you should see a similar pop-up window saying 'Success!'.

Test gmail client
Figure 4 - Test gmail client

Select the Edit option in the toolbar and click on Alarms in the dropdown menu (Figure 5).

Open alarm page
Figure 5 - Open alarm page

Click the Create new Alarm button and select One offline in the appearing right panel (Figure 6).

Create new alarm
Figure 6 - Create new alarm

Scroll down, and from the dropdown menus highlighted in red in Figure 7, select which connection you would like to monitor, and through which connection you would like to send the alert.

Select connections to watch and send through
Figure 7 - Select connections to watch and send through

Configure the alarm to your liking. When you are finished, click on Ok as shown in Figure 8.

Set email address
Figure 8 - Set email address

When your database connection goes offline, the little check turns into a red cross, as it can be seen in Figure 9.

Database offline event
Figure 9 - Database offline event

To check if the alert e-mail has been sent out, consult the alarm's Details page (Figure 10).

Offline alert message sent
Figure 10 - Offline alert message sent

To see if the sent-out alert e-mail has been received, you can navigate to the Gmail client's page and see the Events, highlighted in Figure 11 by a red arrow.

Email sent
Figure 11 - Email sent

When your database connection comes back online, the little red cross next to it turns into a green check, similarly to Figure 12.

Database online event
Figure 12 - Database online event

To see if the alert about the database connection coming back online has been sent out, navigate to the Details page of the alarm (Figure 13).

Online alert message sent
Figure 13 - Online alert message sent

And finally, to check is the Gmail client is receiving these e-mail alerts, go to its page inside Ozeki SMS Gateway, as seen in Figure 14.

Email sent
Figure 14 - Email sent

Can Ozeki SMS Gateway monitor other databases?

Yes, for example, Oracle, PostgreSQL, SQLAnywhere and more.

Can I personalize the contents of the alert e-mail?

Ozeki SMS Gateway allows you to personalize the alert e-mail's content to include specific details relevant to your needs. During the configuration process, you can define the message template. This template can include dynamic elements such as the name of the disconnected/reconnected SMPP client or timestamps for added context.

More information