New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How can I set up a monitor for Citrix license use on license server?

Votes:

0

Your Vote:

Up

Down

Trying to set up monitor to show real time license use on our Citrix license server. I used a template from PRTGPlugins, but it doesn't list the licenses. Only shows RDP and Ping monitors.

citrix licensebacklun-each prtg

Created on Dec 8, 2011 9:40:28 PM by  Bill Leonard (0) 1



12 Replies

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello,

I'm afraid that might only be possible with Custom EXE-Sensors, but of course you could also contact the developer of PRTGPlugins.

best regards.

Created on Dec 9, 2011 9:36:23 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

I have a custom WMI sensor setup that was monitoring license use fine, until I renewed my Citrix Licenses and restarted the license server. Now the sensor fails with "Query returned more than one record error: PE078". I have uninstalled the license server and re installed and also deleted and recreated the sensor. Still no luck getting the sensor to work again.

Created on May 22, 2012 6:07:40 PM by  Bill Leonard (0) 1



Votes:

0

Your Vote:

Up

Down

As the sensor mentions, it seems more than one result is returned, and you need to adjust the query as it needs to be only one. You can use the WMI Tester to help with the testing.

Created on May 22, 2012 6:30:12 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Looks like it does indeed return two records, one looks bogus as it lists 0 in the in use count. They both look identical except for the fact one returns 0 in the in use count. Any idea how to get to read only the correct one?

Created on May 22, 2012 6:38:54 PM by  Bill Leonard (0) 1



Votes:

0

Your Vote:

Up

Down

Sorry, no. How would we know that?

Created on May 23, 2012 11:56:15 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Apparently that record is supposed to be there. I see it on all our license servers. So I'm back to the original problem of getting the "Query returned more than one record error: PE078" when running the custom WMI sensor with a WQL statement of "SELECT InUseCount FROM CITRIX_GT_LICENSE_POOL". Is there a way to get it to total the two records and present that to PRTG? I installed the PRTG Plugins, but it didn't have a template for Citrix Licensing. They have zero support and I haven't been able to get in touch with anyone from there to figure out why it doesn't work.

Created on May 23, 2012 8:03:51 PM by  Bill Leonard (0) 1



Votes:

0

Your Vote:

Up

Down

You could try expanding the query with something like

... Where Name ="_Total"

Or if this does not help, do this with a vb-script which calculates the total itself.

Created on May 24, 2012 8:52:14 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Unfortunately with Citrix licensing you need to enumerate them all to get the full license count and usage since all licenses are individually in WMI. This is why we made the plugin.

Created on Aug 24, 2012 7:00:20 PM by  Olli Jokinen (10) 1



Votes:

0

Your Vote:

Up

Down

I've been beating this horse on and off for a couple days. Here is my powershell script. No promises. It gets the total licenses, the amount in use, computes a percentage, and returns a value. Just copy and paste it the Powershell ISE on your sensor server and try it. You will need to adjust the server...it's all in the comments.

# Setup Variables
$Total = 0
$InUse = 0
$PercentUsed = 0
$Retstring = 0
$RetValue = 0

# Get Citrix licensing Info
# Use the IP address of the License server(-comp switch).  I got inconsistent results using the hostname
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp 172.16.10.14

# This will display all the license info....Uncomment for troubleshooting
# $licensePool | Select-Object @{n="Product";e={$_.PLD}},
#                            @{n="Installed";e={$_.Count}},
#                            @{n="In Use";e={$_.InUseCount}},
#                            @{n="Available";e={$_.PooledAvailable}},
#                            @{n="% in use";e={($_.InUseCount/$_.Count)*100}}
                            
# This loops through all the license info and adds up the total license count and in use count for MPS_ENT_CCU licenses
# If you do not have MPS_ENT_CCU licenses, uncomment the section above and look at the output.  Figure out your license count from that.  Edit Script as needed                            
$LicensePool | ForEach-Object{ If ($_.PLD -eq "MPS_ENT_CCU"){
    $Total = $Total + $_.count
    $InUse = $InUse + $_.InUseCount
    }
}

#  Uncomment to confirm values are correct    
# "Total = ", $Total
# "In Use = ", $Inuse

$PercentUsed = [Math]::Round($inuse/$total*100,0)

#  Determine return code.  Less than 90%, ok, 90-97 Warning, 98-100 Error
switch ($PercentUsed)
    {
        {$PercentUsed -lt 90} {
            $RetString = "0:OK"	
            $RetVal = 0
            break
            }
        {$PercentUsed -ge 90 -and $PercentUsed -lt 98} {
            $RetString = "1:Warning 90-97% License Usage"	
            $RetVal = 1
            break
            }
        {$PercentUsed -ge 98} {
            $RetString = "2:ALERT 98-100% License Usage"	
            $RetVal = 2
            }
}

# Return Info
Write-Host $RetString
exit $RetVal

Created on Jan 8, 2013 6:46:35 PM by  jcayer (0)

Last change on Jan 9, 2013 10:21:57 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

It was requested that we keep track of the actual number of licenses used. I changed the switch statement to return that value instead of 0, 1, or 2. So your graph will now reflect the actual number of licenses used.

switch ($PercentUsed)
    {
        {$PercentUsed -lt 90} {
            $RetString = [string]$Inuse+":OK"	
            $RetVal = 0
            break
            }
        {$PercentUsed -ge 90 -and $PercentUsed -lt 98} {
            $RetString = [string]$Inuse+":Warning 90-97% License Usage"	
            $RetVal = 1
            break
            }
        {$PercentUsed -ge 98} {
            $RetString = [string]$Inuse+":ALERT 98-100% License Usage"	
            $RetVal = 2
            }
}

Created on Jan 9, 2013 9:13:04 PM by  jcayer (0)

Last change on Jan 10, 2013 10:42:58 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

hello, i have added your script to my exe folder and added a custom sensor. but it display me 0 # . when i run the powershell script on the prtg server it shows me the correct entry like 100 licenses are active.

can you please help me adding the custom sensor and its settings?

kind regards,

sebastian

Created on Feb 6, 2017 10:54:33 AM by  sebastianmair (0)



Votes:

0

Your Vote:

Up

Down

Gret Job, but i get this error:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Citrix_LIC03.ps1 Get-WmiObject : Zugriff verweigert (Ausnahme von HRESULT: 0x80070005 (E_ACCESSDENIED)) Bei C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Citrix_LIC03.ps1:16 Zeichen:20 + $licensePool = gwmi <<<< -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp $server + CategoryInfo : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

Es wurde versucht, durch 0 (null) zu teilen. Bei C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Citrix_LIC03.ps1:37 Zeichen:37 + $PercentUsed = [Math]::Round($inuse/ <<<< $total*100,0) + CategoryInfo : NotSpecified: (:) [], RuntimeException + FullyQualifiedErrorId : RuntimeException

Can you help me?

Created on Jul 18, 2017 9:18:47 AM by  Marvin Heyder (0) 1



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.