Monitoring Backup Solutions via Email
The subject backup is getting more and more complicated for service companies with many customers as well as for end-user companies: there are many kinds of backup solutions, the amount of data rises, etc. Not only in big companies, even in small or medium-sized companies the kinds of backup solutions rather vary:
- Backups in the area of virtualization, for example, Veeam
- Additional backups of the operating system, for example, complete Images, SQL backup, Exchange backups, etc.
- Tape backups, for example, CA ARCserve, Symantec Backup Exec, etc.
- Online Backups
With these various options it is difficult to keep an overview of what is going on with your backups.
Email Notifications as Common Ground
Most backup services can send email notifications to inform you about the status of the last backup. Though, with a certain amount of backups to be checked, it is not practicable to analyze manually every email for malfunctioning backups day by day. You will need a system that displays all backup jobs at a glance and indicates if they succeeded or not.
Monitoring Backups with PRTG
Because of email notifications as common ground for different backup solutions, this is an universal method to centrally receive status messages from almost every backup job. With PRTG you will not need to check any more all individual emails that your backups send to your personal inbox. PRTG will analyze these emails for you and keep track of all your backup jobs.
PRTG’s IMAP Sensor has specific filter options and automatically runs through your emails, checking them for keywords in the subject line and in the text. Also it can notify the responsible person if there were not received any emails by a backup during a certain time span. You will know that everything is fine with your backups as long as the IMAP sensors are green.
You only need two things to set up backup monitoring with PRTG:
- Configure your backup software to send emails to a dedicated email account, and
- configure PRTG’s IMAP sensor so it checks your backup mails.
Backup Monitoring via Email(enlarge)
Use Case Scenario
You run two different backup solutions. Both send emails to your in-house mail server with information about their respective backup status. Now you would like PRTG to retrieve the emails regularly to check them for keywords in order to show you the backup status, as well as trigger an alert if there has not been any incoming email during the last 24 hours.
Following are listed the necessary steps for this scenario.
Step 1—Configure Your Backup Solution
Your backup software must be enabled to send emails. Furthermore, we recommend that for each of your backup solutions there is particularly one dedicated email account. Thus, in this use case scenario you will need two dedicated email accounts on your in-house mail server. These accounts have to be accessible via IMAP.
Emails sent by your backup software most likely look like this:
Email Indicating a Successful Backup
Email Indicating a Partially Successful Backup
Email Indicating a Failed Backup
Step 2—Configure IMAP Sensor in PRTG
Following are listed the steps how to configure IMAP sensors in PRTG for backup monitoring:
- Create a new device in PRTG for your mail server: add a new device to your desired group, for example, by clicking Add Device… in its context menu.
Add a Device to PRTG
- In the appearing setup assistant, enter a suitable name and the corresponding IP/DNS of your mail server. Click on Continue.
Device Settings (enlarge)
- Add two IMAP sensors, one for each of your email accounts on the mail server, for example, right-click on the device, and from the context menu, choose Add Sensor…. In the "Add sensor" dialog, filter for Email Server under Target System Type to find the IMAP sensor in a fast way. Click on Add This >.
Add IMAP Sensor (enlarge)
- In the appearing setup assistant, enter a suitable name. You can leave IMAP Specific unchanged for the moment.
IMAP Sensor Basic Settings (enlarge)
- Enter the credentials (username/password) for the respective mailbox under Authentication.
IMAP Sensor Mailbox Credentials (enlarge)
- In the Identify Email section, set Process Email Content to Process emails in this mailbox. Enter the name of the corresponding mailbox. Because you use only one dedicated email account per backup, you can leave the other identify fields unchanged: Don’t check.
IMAP Sensor Identify Email (enlarge)
- Still in the Identify Email section, set Check Last Message Date to Check for new messages received within the last x hours. Because we would like to trigger an alert if there has not been any incoming backup mail for the last 24 hours, enter 24 in the Error Threshold (Hours) field. Enter a lower number of hours without any backup mail in the Warning Threshold (Hours) field to receive an additional Warning status earlier already.
IMAP Sensor Check Last Message Date (enlarge)
- In the Sensor Behavior section, customize your filters for warnings and alarms. In our use case we want green sensors if the backup job succeeded and warnings for backup emails containing both “error” and “partially” in the subject. Additionally, we want a red alarm status for emails containing “error” only. If we get an email with any other text, but without the word “success”, this is an unknown email and indicates an error. We want to have a red alarm status in this case, too.
- For Set to Alarm, choose If subject does not contain and String search as Check Method. Entersuccess in the Search Text field. This sensor behavior states that if there is no (sub-)string “success” in the subject line, the sensor is set to a Down status. Enter an Error Message for this case.
- For Set to Warning, choose If subject contains and Regular expression as Check Method. To match subjects like the one in our example (ERROR: Backup backup_xyz is partially successful) use the following regular expression (regex):
(?=.*\berror\b)(?=.*\bpartially\b).*
This regex finds matches containing the words error and partially in any order. Enter a Warning Message for this case.
- Set No Matching Mail Behavior to None, so if none of the defined filter matches, everything is fine and the sensor will stay green.
IMAP Sensor Behavior (enlarge)
- Click on Continue.
- Repeat these configuration steps for your second IMAP sensor.
PRTG will start monitoring your backups immediately! Note: Of course, you can also define filters for the mail body of your backups.
Step 3: Test Your Configuration
To test your configuration, send some test mails to the accounts you use for your backups. Try several subjects. For example:
- try a subject that simulates a successful backup,
- try a subject for which you want a Warning status,
- try to trigger a Down status, for example, by using an error term without “partially”, and by using some other text, for example, “Acronis True Image Notification from exchanger.johnqpublic.com”.
Using One Mailbox Only for Several Backup Services
For an easier setup, we recommend using separate dedicated mailboxes, one for each backup service. However, it is possible to monitor several backup services within one mailbox. This means that all of your backup solutions will send mail to the same target address. However, each of your solutions will use a different "from" address, or at least a unique identifier in the subject field.
To set up monitoring for this scenario, you need specific criteria in your sensor settings in order to identify the emails. You can either use a specific sender ("from") address, an ID; or a URL. In any case, you need one IMAP sensor for every backup job, and each of these sensors will query the same IMAP mailbox.
- Configure the IMAP sensor as above.
- Under Process Email Content, configure the criteria how the sensor will discern emails. Use theIdentify by fields. For example, if backup mails from backup@example.com are supposed to be analyzed, choose Check using string search in Identify by “From” Field and enter this email address. The sensor will now ignore mails from other addresses.
- If the backup emails contain an ID or another distinctive term in the subject, for example, “Backup successful (ID 12345)”, you can use Identify by “Subject” Field the same way.
Debugging
If your IMAP sensors do not work as expected, ensure that the following requirements are met:
- Your IMAP mailbox receives emails from your backup software.
- You entered the correct credentials in PRTG for your IMAP mailbox. Ensure that PRTG can log in.
- You set the email content filters correctly. Especially ensure that you use the right syntax for regular expressions! If in any doubt about what they are matching, check your regex with a regex tester like REGex TESTER.
- The error/warning thresholds of your IMAP sensors are set correctly.
- Note: We strongly recommend setting up a mailbox that is only used for monitoring. If a user connects to this mailbox via any email client or web GUI, the IMAP sensor will not be able to correctly calculate the last message date and will therefore likely send false alarms, especially when using error thresholds.