Nagios – Checking CAL licenses in Remote Desktop

Very good! This document can be used by all of us who have a Remote Desktop Licensing service in our organization, It will always be good to know how many licenses we consume to analyze future needs or receive alerts in case there are few free licenses left. Therefore, if you have a service of this type in your organization, why not monitor your organization's RDP CAL licenses to avoid problems?

 

We'll use a small script called 'check_rds_cals.wsf', this WSF or Windows Script File must be downloaded to the Remote Desktop License Server. We will use NRPE for remote execution, therefore, if you don't have the NSClient agent installed on that machine, Please review This previous article. We will download the script from the website: https://exchange.nagios.org/directory/Plugins/Remote-Access/check_rds_cals/details

 

GOOD, after leaving it in the scripts folder, We try to run it to see the results we get and how many free licenses we have, Run:

[SourceCode]cscript.exe //NoLogo check_rds_cals.wsf /w:VALOR_WARNING /c:VALOR_CRITICAL[/SourceCode]

 

 

We add the configuration file nsclient.ini the configuration to allow this script to be executed from a remote machine such as our Nagios or Centreon. Leaving something like this:

[SourceCode][/settings/external scripts/scripts]
check_rds_cals = cscript.exe //T:30 //NoLogo scripts\check_rds_cals.wsf /w:15 /c:10

[/settings/external scripts/alias]
check_rds_cals = check_rds_cals[/SourceCode]

 

As we can see, I directly put the values of Warning and Critical in the configuration file so as not to complicate it further, but remember that we can also pass these values as arguments! If you are interested, review it at This document!

 

We remind you to restart the NSClient++ service so that it rereads the configuration,

 

And optionally, if we want to validate it from the Nagios shell… Well, it would be enough to go to the path of the plugins and execute:

[SourceCode]./check_nrpe -H DIRECCION_IP_SERVIDOR_LICENCIAS -C check_rds_cals[/SourceCode]

 

 

But, well, creating the Service directly from Centreon would be enough, come on, without trying this it will work for us! We're going to “Configuration” > “Services” and we add one to the Host that is the license server,

  • Description: We indicate the name with which we will see you from the monitoring, something like 'RDP CAL Licenses' can be useful to us.
  • Template: Normally, Select 'generic-active-service-custom'.
  • Check Command: Select from the list of commands, 'check_nrpe'.
  • Args: Here we must fill in the alias that we define in the INI file, in this example we will pass through NRPE the check 'check_rds_cals'.

 

We record with “Save”,

 

And well, if we export the Centreon data and restart the engine as usual after a configuration, we will be able to start from "Monitoring" > "Status Details" verify that we have RDP CALs monitored, filter by name and force the Service to be checked if necessary. With this we will have fully controlled and supervised the Remote Desktop CAL licenses!

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!

Nagios - Monitoring OTRS Queues

10 de October de 2017