N-able N-central HTTP and HTTPS monitoring, how to do a URL comparison test using Powershell

Last Modified

Sat Mar 28 17:18 GMT 2020

Description

  • How to do a URL comparison test using Powershell
  • N-able N-central HTTP and HTTPS monitoring - Comparison testing a url using Powershell
  • In some cases, the HTTP or HTTPS service will fail due to site unreachable or HTTP Status code. This script will help you to compare "outside of N-able N-central " to N-able N-central 's monitoring result.

Environment

  • N-able N-central 11.0 or later

Solution

  • The script given below is a basic script to test a URL.
  • This will allow you to test whether or not there is a connection issue to the desired URL
  • To test this, please do the following:
    1. On the local device, open a Powershell window as Administrator
    2. Paste the following script:
      • $url = 'https://update.microsoft.com/v6/ClientWebService/client.asmx'$HTTP_Request = [System.Net.WebRequest]::Create($url)$HTTP_Response = $HTTP_Request.GetResponse()$HTTP_Status = [int]$HTTP_Response.StatusCodeIf ($HTTP_Status -eq 200) {    Write-Host "Site is OK! (Status: 200 OK)"} Else {    Write-Host "The Site may be down. The returned status code is: " + $HTTP_Status}$HTTP_Response.Close()
        • NOTE: Please replace the URL given in the $url variable to your desired link.