What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Can PRTG Monitor the License Expiration of ITOps Board?

Votes:

0

Hello.

Since we are highly dependent on ITOps Board for our infrastructure but have a lengthy order process, we would like to keep a close eye on the expiration of the ITOps Board license so that we can trigger the purchase process early enough.

Since we are also using PRTG, is there a way to use PRTG to monitor the license expiration of ITOps Board?

Best Regards,

custom-script-exe custom-sensor exe-script-advanced-sensor exe-script-sensor itops-board license monitoring powershell

Created on Mar 10, 2022 8:57:36 AM by  Luciano Lingnau [Paessler]

Last change on May 17, 2022 11:07:02 AM by  Luciano Lingnau [Paessler]



8 Replies

Votes:

1

This article applies as of PRTG 22.1.74

Monitoring ITOps Board license expiration with PRTG

We have put together an EXE/Script Advanced sensor that you can use to monitor the license expiration of your ITOps Board.

Requirements

  • PRTG Enterprise Monitor 22.1.74 or later
  • ITOps Board 2.11.3 or later
  • You need a user account that has sufficient rights to the license information in ITOps Board. As of version 3.0.4 this means the user must be a group of the Administrators group
  • The probe on which you want to deploy the sensor must be able to reach the ITOps Board instance via HTTP/HTTPS (default port is 59212).
  • The probe on which you want to deploy the sensor must run PowerShell version 3 or later.
  • The probe on which you want to deploy the sensor must be allowed to run unsigned PowerShell scripts. For further information, refer to the Knowledge Base articles Guide for PowerShell-based custom sensors and PowerShell 32-bit or 64-bit and Execution Policy.

Known limitations

  • The sensor will not produce any alerts by default unless it is unable to authenticate and contact the ITOps Board instance altogether or the license is missing/expired. Once the sensor is deployed, we recommend that you set up limits in the channel's settings to get alerted in advance. For example, define a lower error limit when the license is 14 days from expiring. This way, you are notified 2 weeks before it expires. See also the Paessler website: How to set up notifications via the PRTG web interface.
  • While in ITOps Board you can have several licenses stored/saved at once (with each license having it's own separate expiry date) only the license listed under "Summary" is actually taken into account for this sensor. Because of this it makes sense to always delete/remove old licenses once you add a new one, so that the summary also references the newest license at any given time.

Sensor creation and usage

1. Download the provided .zip file and extract it under the following path of the desired probe:

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML

Please keep in mind that, when extracted, you will end up with two files, one of which will be in a subfolder called include, this is by design.

2. Create a new device in PRTG with the address (FQDN) of the ITOps Board instance that you want to monitor.

3. Now, select Add Sensor. In the search field, enter "Script Advanced" and then select the EXE/Script Advanced sensor from the result list.

4. In the Add Sensor dialog, enter the following:

4.1 The Sensor Name and Tags (optional)

4.2 Under EXE/Script, select Get-ITOpsBoardLicenseExpiry.ps1 from the dropdown list.

4.3 The Parameters should be:

-TargetName '%host' -TargetPort 443 -Username '%windowsdomain\%windowsuser' -Password '%windowspassword' -Timeout 20

IMPORTANT: For the % placeholders to work, make sure the settings (Windows credentials, device address) in the parent device in PRTG are correct. We recommend that you use the placeholders but you can also enter any of the values directly if you do not want to work with placeholders. Please also note that while in this example we're working with port 443 the default port for ITOps Board is 59212, so please adjust it accordingly to your setup
Please also note that if your probe does not trust the certificate on the ITOps Board instance, you will also need to add the "-TrustAllCerts" parameter. See Troubleshooting below for details.

4.4 Unless required for other reasons, leave the default Environment, Security Context, and Mutex Name.

4.5 Set the Timeout (Sec.) to 30 seconds. This should be more than enough for the execution.

4.6 The Result Handling should only be enabled if you need to troubleshoot the sensor's execution.

4.7 Disable the inheritance for the Scanning Interval and set it to something more appropriate like 6h or 12h. Tip: Since we are monitoring the number of days until the expiration, there is no point in querying the license status every 1 or 5 minutes.

4.8 Click Continue to create the sensor.

5. The sensor should display channels and values after one scanning interval. Once this happens, you can adjust the channel limits to your requirements (optional, but necessary to get alerts in a timely fashion).

Resulting sensor

The resulting sensors (after setting limits) will look like the following:

Sensor Overview
Click to enlarge.

The sensor's settings will look like this: Sensor Settings
Click to enlarge.

Troubleshooting

Here is a troubleshooting checklist you can go over if you have issues:

  • Check your installed PowerShell version (on the probe) to make sure it meets the minimum requirements. Just enter $PSVersionTable in a PowerShell prompt on the probe that runs the sensor.
  • Make sure that the execution of scripts is allowed on the probe that runs the sensor.
  • Double-check that the parameters are correct and that the credentials are valid by running the script interactively. When running the script interactively, you can also run the following to get more details about it:
Get-Help .\Get-ITOpsBoardLicenseExpiry.ps1 -Detailed

Or, for examples:

Get-Help .\Get-ITOpsBoardLicenseExpiry.ps1 -Examples
  • If you are working with an untrusted certificate for ITOps Board or otherwise get the error Exception on Line 90: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel., add the "-TrustAllCerts" parameter to the query. This should only be used when you are unable to query it otherwise as it introduces a security risk. Alternatively, make sure the probe where the sensor runs trusts the certificate used on the target system.
  • Make sure that the remote probe can reach ITOps Board on the required port. A proxy may not work here.
  • For any other issues: Do not hesitate to contact us by replying to this post or by contacting us via a support ticket. Please also link this Knowledge Base post.

Version history

0.12022/10Initial version (internal only)
0.92022/03First public version, added documentation, help, examples, additional parameters and more details in case of errors
0.922022/03Sensor now produces a clearer error when there's no valid/active license on the server. Thanks to user ct for the input/feedback and assistance

Remarks

  • Please understand that we can neither provide in-depth technical support for custom sensors nor can we guarantee that the sensors described in this article will work on your systems. You use all components at your own risk.
  • Feel free to further modify this script to monitor other properties, or share it (free of charge) as well.
  • The script uses a third-party PowerShell function ConvertFrom-Json2, which is included with the download. Credits of this function go to the original author.

Best regards,
Luciano Lingnau [Paessler]

More

Created on Mar 10, 2022 9:18:38 AM by  Luciano Lingnau [Paessler]

Last change on Apr 25, 2024 5:52:56 AM by  Luciano Lingnau [Paessler]



Votes:

0

Hi! I believe I have this sensor running correctly, however the script returns

{
    "prtg":  {
                 "error":  1,
                 "text":  "Exception (Line 91): The remote server returned an error: (400) Bad Request."
             }
}

The result returned from the ITOps web server request: "https://$($TargetName):$($TargetPort)/api/licenses/summary" using a web browser is:

{"message":"No License was Found. Please add a new license."}

This is probably because our licence has actually now expired. Seems the Try / Catch block is immediately stopping the script on line 91.

The full error when commenting out the Try/catch block is

Invoke-Webrequest : {"message":"No License was Found. Please add a new license."}
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Get-ITOpsBoardLicenseExpiry.ps1:92 char:7
+     $a = Invoke-Webrequest -Uri "https://$($TargetName):$($TargetPort ...
+          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

So I guess it needs code to validate the web server reply and check for no/expired licenses somehow

Thanks!

Created on Mar 17, 2022 11:53:07 PM

Last change on Mar 18, 2022 6:26:27 AM by  Luciano Lingnau [Paessler]



Votes:

0

Hello ct,
thank you for your input and feedback.

I've just bumped the sensor to version 0.92 which introduces additional handling for the case where no license is installed/active. To "update" simply overwrite the script you're using with the latest version available here on the KB Article. It is backwards compatible with the previous settings so just replacing the powershell script file will fix it.

And on a side note, thanks for the help getting this handled in the script, I've credited you for the help in the version history.

Cheers!
Luciano Lingnau [Paessler]

Created on Mar 24, 2022 8:54:34 AM by  Luciano Lingnau [Paessler]



Votes:

1

Hi all,
If you receive the message Exception (Line 91): Unable to connect to the remote server then change the Parameters listed under 4.3 to -TargetName '%host' -TargetPort 59212 -Username '%windowsdomain\%windowsuser' -Password '%windowspassword' -Timeout 20.
As the ITOPS Board uses per default the port 59212 and not 443.
Best Regards,
Alain

Created on Jun 30, 2022 9:41:41 AM



Votes:

1

Thank you for the input/feedback Alain,

I've added a remark about port 59212 below step 4.3 as this is indeed probably an issue that people following the guide could run into.

Best Regards,
Luciano Lingnau [Paessler]

Created on Jul 1, 2022 6:46:42 AM by  Luciano Lingnau [Paessler]



Votes:

0

Hello,

After the update of ITOps Board from Version 2.11.3 to Version 3.5 the sensors shows the following error:
Exception (Line 91): The remote server returned an error: (403) Forbidden.

Could it be, that the API no longer accepts the windowsuser?

Plaese advise how to solve the issue.

Kind regards,
Alain

Created on Sep 5, 2022 7:00:01 AM



Votes:

0

Hello,

Addendum to my previous post.
I have tried a little bit more.
With the previous ITOps Board version it was possible to use the Windows user via on-board means. Now, the Windows user must be added to the Administrators in the ITOps Board so that the API can be queried.

Best Regards,
Alain

Created on Sep 5, 2022 7:32:46 AM



Votes:

0

Hello Alain,
thank you for reaching out.

Yes, your observations are correct. Hence we added this note to the requirements of the sensor in July:

You need a user account that has sufficient rights to the license information in ITOps Board. As of version 3.0.4 this means the user must be a group of the Administrators group

We had also noticed this in our testing, but everything should work fine now that you added the user to the administrators group.

Best Regards,
Luciano Lingnau [Paessler]

Created on Sep 5, 2022 9:22:45 AM by  Luciano Lingnau [Paessler]




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.