PRTG: Monitor your office 365

In my daily job i use prtg to monitor all my enterprise it system. and now we are going to migrate our exchange 2010 to office365.

We quickly needed to be able to monitor the proper functioning of office365 I had to find a solution for that. So I found this post :  https://www.team-debold.de/2016/07/22/prtg-office-365-status-ueberwachen/ from Marc’s IT BLOG I followed the procedure with google translate and now my prtg monitor my office 365.

Today I translate the article in English

Installation

First step download the powershell script and the ovl files here : https://github.com/debold/PRTG-O365Monitoring

Drop the powershell file in C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML

and drop the ovl file in C:\Program Files (x86)\PRTG Network Monitor\lookups\custom

now load the ovl files PRTG ⇒ setup ⇒ system administration ⇒ administrative tools ⇒ load lookups and file lists ⇒ Go!

 

Office 365 preparation

Login in https://portal.office.com and open Azure AD 

Click on All services ⇒ App registrations

Click on New registration

fill the name 

Select who can use this API (here in my case single tenant) 

in Redirect URI select web and fill a random local url

Click on Register

On this screen copy in a notepad your client id and your tenant ID

Click on Certificates & secrets ⇒ New client secret

Set the description and the expires time

copy your secret in a safe place

an exemple

Then click on API permission ⇒ Add a permission and select: ServiceHealth.Read – Read service health information for your organization

So now we need to autorise our api to get informations from our organisation 

Go to this url https://login.windows.net/common/oauth2/authorize?response_type=code&resource=https%3A%2F%2Fmanage.office.com&client_id=your_client_id 

and accept 

 

PRTG Sensor creation

For the sensor creation you need your clientID,Client secret, Tenant ID from previous steps

  1. Create a xmlexesensor
  2. in the EXE/Script field selsect Get-Office365Status.ps1
  3. in the Parameters field  -ClientID <your client id> -ClientSecret <your secret> -TenantIdentifier <your tenant id>
  4. save 
 
 

Troubleshooting

  • Powershell must be run in a version 3.0 or higer
  • The powershell execution policy must be RemoteSigned Set-ExecutionPolicy RemoteSigned -Force

  • If there is still a message that the script has not been signed, then really run the 32 bit version of the Power Shell.
  • Do not forget the secret expiry

Source

Leave a Reply