Menu Close

RDS | Write your own monitoring [Part – 1]

Reading Time: 4 minutes

What if you want to monitor your RDS environment but you don’t want to bounded to an default monitoring set. Then you have to create it yourself. There are many advantages when you create it yourself.

  • Be more flexibel;
  • Get to know the RDS product;
  • Use it for multiple customers.

You can easily get great and fast results by using powershell!

First you have to define some default variables:

To keep this into a Microsoft spirit i wanted to use PowerBI for reporting and use an online Azure SQL database as my destination for the logging and as an source for PowerBI.

We have to set some SQL variables:

To accomplish the above we have to use the credentials of the Azure SQL database:

The following line is usefull to store the password to the server in the keystore folder. (Be sure to comment it when using it in production),

The easiest way is to use functions in PowerShell. In the Technet script for RDS Scaling  (link) there are some cool functions, so i reused them for this script.

Load the modules / functions.

In an high available environment with multiple RDS Brokers, you have to get the active RDS Broker for results.

Test if the path exists on the monitoring server, if not create the path.

I wanted to get the active management server for the time, so i logged it to an CSV file on the monitoring server.

Why is the number of active servers important? Because u could use the RDS scaling script and so you can see that there are enough RDS hosts online for the amount of users.


Now we have created the table we have got the information we want so now insert it in the database.

Now with the monitoring in place we create an PowerBI subscription link. You can get a subscription for free. Download and install PowerBI desktop, connect to the Azure SQL database and

Connect to SQL database:

Select a graph and select the data.




Leave a Reply

Your email address will not be published.