Insert html code into SQL query
Activate only when node down alert is triggered:
Down EventType 5000
Up EventType 5001
HTML has a CASE clause in order to take control of percent availability.
This script has a filter to show only events in a time frame 7 am to 4 pm

Script Update, first count all nodes grouped by country, you can edit as you needed.

This is because when one node could stay in down state for several time and this impact the availability, with this update first count all nodes and then calculate the availability taking in count all nodes in this country