Greetings friends, I have spoken about Veeam Backup for AWS multiple times here, I think it is the best Data Protection Solution in the Market for those specific workloads on native AWS, 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: How to Secure your Veeam Backup for AWS v2 instance with a Let’s Encrypt SSL certificate
- Veeam: How to connect our Veeam Backup and Replication to Veeam Backup for AWS
- Veeam: An in-depth look at the new Veeam Backup for AWS – Creating Backup and Restore Policies
- Veeam: How to Deploy Veeam Backup for AWS – step by step
- Veeam: Veeam Announces Veeam Backup for AWS Free Edition
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 AWS, you might be missing the HTML Daily Report that can help to understand quickly how everything went.
Veeam Backup for AWS comes with this great report natively:
The native HTML Report is great but does not give details inside the Policies, what happened to EC2 instance named X, or RDS named Y, etc.
I understand those are 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 AWS 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 AWS using the RESTful API, which will then put together into a nice HTML Report, and send 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 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:
vi ~/.mailrc
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_aws_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 AWS v3 RESTful API, which is HTTPS, and Port 11005. 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 AWS, user/pass, etc.:
# Configurations ## # Endpoint URL for login action veeamUsername="YOURVEEAMBACKUPUSER" veeamPassword="YOURVEEAMBACKUPPASS" veeamBackupAWSServer="https://YOURVEEAMBACKUPFORAWSIP" veeamBackupAWSPort="11005" #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_aws_reports" html="$reportPath/AWS-Job-Report-$reportDatePath.html" email_add="CHANGETHISWITHYOUREMAIL"
Once the changes are done, make the script executable with chmod:
chmod +x veeam_aws_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:
root@tig-monitor:/home/oper# ls -la vba_aws_reports/ total 744 drwxr-xr-x 2 root root 4096 Jun 11 11:59 . drwxr-xr-x 8 oper oper 4096 Jun 11 11:59 .. -rw-r--r-- 1 root root 751639 Jun 11 12:03 AWS-Job-Report-FridayJune112021.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_aws_email_report.sh >> /var/log/awsrereport.log 2>&1 >/dev/null 2>&1
There, all good and ready!
HTML Daily Report Veeam Backup for AWS
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 AWS S3, while a Backup Job, will take a few more minutes, and transfer data of course. You can see as well your VPC Backups with the detailed region on, RDS Backups, etc.:
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 AWS:
Leave a Reply