Greetings friends, I have spoken about Veeam Backup for Azure multiple times here, I think it is the best Data Protection Solution in the Market for those specific workloads on Azure, here is a list of articles about it:
- Veeam: Veeam announces enhancements for new versions of Veeam Backup for AWS v4/Azure v3/GCP v2
- Veeam: New and improved Veeam Backup for Azure v2 is now available – Veeam v11 deep-integration, intelligent storage tier, app-aware, and more
- Veeam: How to connect our Veeam Backup and Replication to Veeam Backup for Azure
- Veeam: An in-depth look at the new Veeam Backup for Microsoft Azure- Creating Backup and Restore Policies
- Veeam: How to Deploy Veeam Backup for Microsoft Azure – step by step
- Veeam: Veeam announces Veeam Backup for Azure Free Edition
- Veeam: How to Secure your Veeam Backup for Microsoft Azure instance with a Let’s Encrypt SSL certificate
A great solution, that can be complemented with Veeam Availability Suite for better monitoring, and integration with the on-prem environment. If you have been using Veeam Backup and Replication for quite some time, and you have deployed Veeam Backup for Azure, you might be missing the HTML Daily Report that can help to understand quickly how everything went.
This HTML Report is quite important, as, with the Cloud offerings, we tend to protect those workloads with an improved RPO, like doing Snapshots more often, even a few Backups per day, etc. Rest assured, after a few hours today, I have taken the truly impressive Veeam Backup for Azure RESTful API, and built the Report for you. IF you follow all the steps on this post, you will have something similar to this on your email every day:
Topology with all the logical components
This entry is quite new, as I have never done any HTML Report from Bash, it was quite good, and great learning curve, tons of echos on the code, a diagram look like this:
As we can see, the shell script will download the metrics from Veeam Backup for Azure using the RESTful API, which will then put together into a nice HTML Report, and send it after to the Backup Admin.
Small system requirements before we continue
We will need two small system requirements before we continue, first will be JQ, which is a package that helps us parsing the JSON, let’s go and install it, yum install if CentOS:
apt-get install jq
The second one is related to the ability to send emails. I am using an advanced SMTP package called s-nail, so let’s go ahead and install it:
apt-get install s-nail
As we do not want them to go to SPAM, we will use an external mail server to send these emails, to do this, we will edit the local configuration file of the package:
And add the following to the file, which was probably empty, change the server, user and pass with your own:
set smtp-use-starttls set ssl-verify=ignore set smtp=smtp://YOURSMTPSERVER:587 set smtp-auth=login set smtp-auth-user="[email protected]" set smtp-auth-password="YOURPASSWORD" set from="[email protected]"
That’s it! Let’s move on to the next thing.
Download, and configure the veeam_azure_email_report.sh script.
We have almost everything ready, we have one last step, the script that will make all this work, we will download the latest version from the Github repository:
This shell script can be downloaded and run from any Linux, it will need to have access to the Veeam Backup for Azure v2 RESTful API, which is HTTPS. We will have to edit the configuration parameters, here you can play if you want more than the last 24 hours, email, plus IP of your Veeam Backup for Azure, user/pass, etc.:
# Configurations ## # Endpoint URL for login action veeamUsername="YOURVEEAMBACKUPUSER" veeamPassword="YOURVEEAMBACKUPPASS" veeamBackupAzureServer="https://YOURVEEAMBACKUPIP" veeamBackupAzurePort="443" #Default Port ## System Variables reportDate=$(date "+%A, %B %d, %Y %r") reportDatePath=$(date "+%A%B%d%Y") reportDateTo=$(date "+%Y-%m-%d") reportDateFrom=$(date -d "$reportDateTo - 1 day" '+%Y-%m-%d') reportPath="/home/oper/vba_azure_reports" html="$reportPath/Azure-Job-Report-$reportDatePath.html" email_add="CHANGETHISWITHYOUREMAIL"
Once the changes are done, make the script executable with chmod:
chmod +x veeam_azure_email_report.sh
We run it, it should not be any output at all, so no errors, once finished checking the reports path and see if you have an HTML Report there:
[email protected]:/home/oper# ls -la vba_azure_reports/ total 124 drwxr-xr-x 2 root root 4096 Jun 4 21:45 . drwxr-xr-x 7 oper oper 4096 Jun 4 21:45 .. -rw-r--r-- 1 root root 116244 Jun 4 21:45 Azure-Job-Report-FridayJune042021.html
If so, please now add this script to your crontab, like for example, every day will be my recommendation:
0 0 * * * /home/oper/veeam_azure_email_report.sh >> /var/log/azurereport.log 2>&1 >/dev/null 2>&1
There, all good and ready!
HTML Daily Report Veeam Backup for Azure
In the case that all the email configuration is alright, SmartHost, etc. You should receive a very nice email like this, with all the sessions that had happened during the last 24 hours:
As said, absolutely amazing to see all of this in a single place, if you take a quick look, you can quickly see that the Snapshot just takes a few seconds, and never moves data to Azure Blob, while a Backup Job, will take a few more minutes, and transfer data of course:
That’s it all, I am planning to add much more details into these HTML Reports, as I can see there seems to be a lot of demand for them. For real-time monitoring, and some great dashboarding, do not forget that we have already the Grafana Dashboard for Veeam Backup for Azure:
- Looking for the Perfect Dashboard: InfluxDB, Telegraf, and Grafana – Part XXIV (Monitoring Veeam Backup for Microsoft Azure)
[…] Veeam: HTML Daily Report for Veeam Backup for Azure is now available – Community Project ̵… […]