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 monitor licenses in my network?

Votes:

0

Your Vote:

Up

Down

I need to monitor multiple licenses on several Hosts (like firewall appliances, antivirus servers, etc.). How can I do that with PRTG?

firewalls license license-expiration

Created on May 27, 2014 8:39:26 AM by  Stephan Linke [Paessler Support]

Last change on May 27, 2014 8:39:55 AM by  Stephan Linke [Paessler Support]



14 Replies

Accepted Answer

Votes:

2

Your Vote:

Up

Down

To monitor the licenses that are used in your network, regardless of the appliance or software, please create an EXE/Script Advanced sensor which uses the PowerShell script given below.

Set up Monitoring of license status

  • Open a text editor.
  • Copy the following code and paste it into the editor:
Param([string]$ExpirationDate)

$DateDifference = New-TimeSpan -Start (Get-Date) -End $ExpirationDate
$Days = $DateDifference.Days
$DaysPassed = ($Days * -1)
if($Days -gt 0){
                Write-Host "$($Days):License expires in $($Days) day(s)."
                exit 0 }
if($Days -eq 0){
                Write-Host "$($Days):The license expires today!";
                exit 1
}
if($Days -lt 0){
                Write-Host "0:License expired for $($DaysPassed) days!"
                exit 1
}
  • Save the file and name it, e.g., license_status.ps1
  • Place the script in the \Custom Sensors\EXE sub-directory of your PRTG installation to ensure that the EXE/Script Advanced sensor can pick up the same.
  • Create a new EXE/Script Sensor .
    • Choose license_status.ps1 as executable.
    • As Parameter, pass the following: ExpirationDate="2015-31-12"
    • Please note that the date format must suit your system default (i.e. DD.MM.YYYY for german)

The sensor will show you the remaining days of your license. It also shows how many days the license is already expired if that is the case. Please don't forget to set lower limits in the channel settings to get notified a few days earlier.

Best regards.

Created on May 27, 2014 8:53:00 AM by  Stephan Linke [Paessler Support]

Last change on Sep 27, 2018 10:03:31 AM by  Erhard Mikulik [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

This script doesn't work anymore (error code PE231). Do you have one that works with version 18.3.42?

Thanks & regards

Created on Jul 17, 2018 12:38:00 PM by  prtg_eurogentec (0)



Votes:

0

Your Vote:

Up

Down

It should work properly. How are you passing the parameters?


Kind regards,
Stephan Linke, Tech Support Team

Created on Jul 17, 2018 12:49:34 PM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Has somebody already test it with PRTG 18x ? If it doesn't work, has somebody an update ?

Regards

Frederic

Created on Jul 24, 2018 12:31:19 PM by  prtg_eurogentec (0)



Votes:

0

Your Vote:

Up

Down

It should work properly. How are you passing the parameters?

Created on Jul 24, 2018 1:09:25 PM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

@prtg_eurogentec

I copied the above code in an ps1 file: expdate.ps1 then execute it in powershell with .\expdate.ps1 "01-12-2018" this works for me. (datetime is german, you may need to enter 'expdate.ps1 2018-12-01' for your country"

ergards Thomas

Created on Jul 25, 2018 7:49:54 AM by  Thomas Umbricht (2,819) 3 3



Votes:

0

Your Vote:

Up

Down

Thomas is correct here, make sure the date notation matches the region of the PRTG server (i.e. the Windows setting). Otherwise, it'll probably error. Regardless of PRTG's version :) Thanks for chiming in, Thomas!


Kind regards,
Stephan Linke, Tech Support Team

Created on Jul 25, 2018 8:47:35 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Getting this error: New-TimeSpan : Cannot bind parameter 'End'. Cannot convert value "" to type "System.DateTime"

Any idea on how to fix this?

Created on Mar 20, 2019 3:34:05 PM by  ChrisN01 (0)



Votes:

0

Your Vote:

Up

Down

What's your server region and what does the end date look like?


PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Mar 20, 2019 3:41:45 PM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

United States

DD/MM/YYYY

Created on Mar 20, 2019 3:53:52 PM by  ChrisN01 (0)



Votes:

0

Your Vote:

Up

Down

Try MM/DD/YYYY instead :) That should work with that region.


PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Mar 21, 2019 7:47:40 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

I have created this sensor but the result it returns is not correct, the sensor is in warning state with the message 'License expired for days!' and the value is showing as 0. I have ran the powershell manually and that works fine, returning the correct number of days. The parameter I am passing is in the correct date format (the same as when I run the powershell manually on the probe). Any ideas as to why this might be happening?

Thanks

Andy

Created on Mar 25, 2019 10:22:02 AM by  aojari (0) 1

Last change on Mar 25, 2019 10:31:01 AM by  aojari (0) 1



Votes:

0

Your Vote:

Up

Down

Seems that the answer to my question is to set the parameter in PRTG to just the date i.e. "16-12-2019" rather than ExpirationDate="16-12-2019"

Created on Mar 25, 2019 10:44:38 AM by  aojari (0) 1



Votes:

0

Your Vote:

Up

Down

@aojari thanks for the update, glad it's working now. The proper syntax would be the following
-ExpirationDate '16-12-2019'

Created on Mar 25, 2019 11:06:03 AM by  Stephan Linke [Paessler Support]



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.