PRTG and Exchange 2016: Sensor for HealthCheck URLs

In this article I had already presented a small script that checks the Exchange HealthCheck URLs. Since I use PRTG for monitoring in my private environment, I used a separate sensor for the HealthCheck URLs. Although PRTG comes with a whole range of sensors for Exchange Server, I have to be economical with my sensors due to the limit of 100 sensors for the free version. Hence the custom sensor, which displays the HealthCheck URLs as channels within a sensor.

PRTG users can download the sensor here:

Integration of the sensor in PRTG

First, the PowerShell sensor must be copied to the PRTG sensor directory, normally the directory is located under the following path:

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

SNAGHTMLd07d0

Now a new sensor can be added to the Exchange Server, since the script only checks the HealthCheck URLs, it does not necessarily have to be assigned directly to the Exchange Server, any other device can also use the sensor. In this example, the sensor is created directly for the Exchange Server:

image

"Program/Script (Advanced)" must be selected as the sensor type:

image

A name can now be assigned to the new sensor. The PowerShell script that was first copied to the sensor directory can now be selected under "Program/Script". The "Parameter" field is used to specify which Exchange server is to be checked. The script only processes one Exchange Server here; for several Exchange Servers, several sensors must be created or the script must be adapted accordingly:

image

After a short time, the sensor should deliver the first data, the value 200 corresponds to "HTTP status code 200" (everything ok). A different HTTP status code results in an error.

image

The individual channels can still be customized. For example, the "Unit" can be changed to "HTTP Response":

image

In this example, one channel of the sensor is in error status, which indicates problems with Outlook Anywhere:

image

If desired, the primary channel can be changed in the sensor settings; the default setting is "OWA":

image

Next item on my to-do list: PRTG and Sophos UTM Webserver Protection.

15 thoughts on “PRTG und Exchange 2016: Sensor für HealthCheck URLs”

  1. Hallo Frank,

    ich erhalte den Fehler: XML: Das zurückgelieferte XML entspricht nicht dem erwarteten Schema. (Code: PE233)
    Ich habe deine Anleitung 1:1 befolgt.
    Ich habe auch schon ein paar Dinge aus dem Kommentarverlauf ausgetestet:
    – Das Script wird von der Powershell von verschiedenen Rechnern korrekt ausgeführt (u.A. vom PRTG Server)
    – Das generierte XML sieht nach den Beispielen von PRTG i.O. aus
    – Statuscodes der URLs sind korrekt eingetragen.
    Nur PRTG scheint das XML nicht zu gefallen.

    PRTG-Version: 19.2.50.2842 x64

    Hier ist die Ausgabe von dem Script ausgeführt auf dem PRTG-Server:
    PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\ExchangeHealthChecks.ps1

    OWA Healthcheck
    200
    10
    1

    ECP Healthcheck
    200
    10
    1

    Outlook Anywhere Healthcheck
    200
    10
    1

    EWS Healthcheck
    200
    10
    1

    MAPI Healthcheck
    200
    10
    1

    OAB Healthcheck
    200
    10
    1

    ActiveSync Healthcheck
    200
    10
    1

    Autodiscover Healthcheck
    200
    10
    1

    Gruß,
    Theo

    Reply
  2. Falls die Abfrage nicht über den Namen des Servers gemacht werden kann, sondern nur über IP, hilft folgendes, um Zertifikatsmeldungen zu ignorieren (Einfügen nach Zeile 8):

    add-type @“
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
    ServicePoint srvPoint, X509Certificate certificate,
    WebRequest request, int certificateProblem) {
    return true;
    }
    }
    „@
    [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

    $AllProtocols = [System.Net.SecurityProtocolType]’Ssl3,Tls,Tls11,Tls12′
    [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols

    Reply
  3. Hallo,
    bei mir läuft das prima.
    Nur ab und zu ist OWA Check als Fehler drin beim nächsten mal ist alles wieder OK.
    Abruf Intervall alle 5-10min.
    jemand eine Idee?

    Gruß Frank

    Reply
    • Danke Peter,
      das XML sieht auf dem ersten Blick OK aus, jedoch liefert es den Statuscode 0, hier müsste bei Erreichbarkeit eigentlich 200 stehen. Du könntest das Script Zeile für Zeile ausführen und die Variablen prüfen, damit sollte sich das Problem feststellen lassen. Schreib mir bei Bedarf einfach eine Mail, ich antworte dann nach meinem Urlaub :-)
      Gruß, Frank

      Reply
  4. Hi,

    Bei mir bleiben die Rot. Wenn ich die Seiten aufrufe bekomme ich die 200 angezeigt.

    Irgendeine Idee?

    Reply
  5. Hi Frank,

    ja ich bekomme eine folgende XML zurück.. auf dem PRTG-Server.

    PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\ExchangeHealthChecks.ps1

    OWA Healthcheck
    0
    10
    1

    ECP Healthcheck
    0
    10
    1

    Outlook Anywhere Healthcheck
    0
    10
    1

    EWS Healthcheck
    0
    10
    1

    MAPI Healthcheck
    0
    10
    1

    OAB Healthcheck
    0
    10
    1

    ActiveSync Healthcheck
    0
    10
    1

    Autodiscover Healthcheck
    0
    10
    1

    Gruß Peter

    Reply
  6. Hallo,

    auf welcher Hardware läuft denn bei Dir Privat PRTG?
    Ich habe bei mir daheim einen Microserver Gen 8 mit 3x Server 2012 R2 (DC, FS, Exchange 2016) im Einsatz und würde jetzt auch gerne die Überwachung einführen.
    Installiere ich das Programm am besten auf den DC oder den FS oder wo wäre der PRTG am besten aufgehoben?

    Gruss,
    Michael

    Reply
    • Hi Michael,
      ich habe PRTG als eigene VM laufen, 2 Cores 3 GB RAM, wobei 3 GB RAM schon fast zu viel sind, mit 2 GB würde die VM auch laufen. Wahrscheinlich auch mit 1 Core. Die VM läuft auf ESXi, Hardware ist ein Core i7 6700 mit 32 GB RAM.
      Gruß, Frank

      Reply
  7. Hi Frank,

    ich erhalte in PRTG folgende Meldung:, bin 1:1 deiner Anleitung nachgegangen.
    Letzte Meldung:
    XML: Structural error in xml file, 1 open items. — JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Access violation at address 0594F9A8. Execution of address 0594F9A8). (Code: PE231)

    Gruß Peter

    Reply
    • Hallo Peter,
      ich schaue mir das noch einmal an. Hast du das Script mal direkt aus der PowerShell aufgerufen? Bekommst du dann ein XML zurück?
      Gruß, Frank

      Reply
  8. Hallo Franky,

    bin auf deine Sensoren für die Sophos UTM gespannt. Wir Monitoren z.b. die REDs via SSH-Ping.

    Grüße
    Uwe

    Reply

Leave a Comment