Expiring License Alert and Widget

We have developed 2 different ways to help keep track of your Solarwinds licenses. We have built a widget that will show a dashboard of when your next licenses are going to expire and which ones. We also have built an alert that will trigger when licenses are getting close to expiring. 

Building the alert

            1.  Create the alert, change Evaluation frequency to 24 hours and the severity to critical.

2.  Create the trigger conditions, here is the code we created to use.

—-

JOIN Orion.Licensing.Licenses l ON Engines.ServerType = ‘Primary’
WHERE
LicenseExpiresOn < ADDMONTH(3,GETUTCDATE())

—-

3. Set the trigger action. Below is the code that can be used.  This will show a license that is about to expire and tell you how many will expire in 1 or 2 months.  It will not point out exactly which ones are going to

Orion Licensing Alert
Licenses expiring in the next 

        Next License Expiring:

${N=SWQL;M=SELECT TOP 1 CONCAT(‘<font color=blue>’,CONCAT(LicenseName,CONCAT(‘<br><u>License Expires:</u> ‘,LicenseExpiresOn))) AS ExpiresOn FROM Orion.Licensing.Licenses ORDER BY LicenseExpiresOn ASC,MaintenanceExpiresOn ASC}

Creating the widget

This widget will show you any licenses that will expire in the next 3 months, this can be adjusted depending on your needs. Just change the number next to “GETUTCDATE” to however many months you want to display.

1.  Create a new widget and use Custom Table.

Once the new blank widget has been added to the page you want it on, click Edit in the top right corner of the widget.

2.  We first need to create a data source, for this we will be using custom swql code created by Truepath. Copy and paste the below text into the datasource and make sure SWQL is selected.  You may name the Selection name anything you would like.

SELECT LicenseName, LicenseKey, LicenseVersion, ProductName, ProductVersion, LicenseType, LicenseExpiresOn, MaintenanceExpiresOn, IsTempKey, IsHidden, IsSingleKey
FROM Orion.Licensing.Licenses WHERE MaintenanceExpiresOn > GETUTCDATE() AND LicenseExpiresOn > GETUTCDATE() AND (MaintenanceExpiresOn < ADDMONTH(3,GETUTCDATE()) or LicenseExpiresOn < ADDMONTH(3,GETUTCDATE()))}

3.  Once we have the data source created you can select the data you want to show in the widget.  If you click the plus under Table Layout it will give you a list of the data. For this one I selected, Product Name, License Name, and License Expire on.  You can adjust the position of the columns and sizes to your liking.

Once you have picked your columns and sizes, it should look something similar to this:

Shopping Cart