Microsoft 365 Monitoring
TCG Office Connector
The GroundWork TCG Office connector lets you use the API that Microsoft™ exposes to the Internet for monitoring any Microsoft 365™ accounts to which you have access. The metrics you gather are defined in a json file and are not configurable with the user interface, but are all generally useful. In some cases you may want to modify the json file to customize the items you monitor.
Requirements
All you need to use this connector is an Internet connection from your GroundWork Monitor server and the Tenant ID, Client ID and Client Secret for the account you want to monitor. You can't set up multiple Office connections on the same GroundWork Server, however.
The tenant used must have the following permissions:
Service | Permission |
---|---|
O365 Services Status | ServiceHealth.Read |
OneDrive Usage | Files.Read.All |
Mailbox monitoring | Mail.ReadBasic.All |
List licenses in use | Organization.Read.All |
Sharepoint Monitoring | Sites.Read.All |
Setting Up TCG
The easiest way to run the TCG instance that handles the connection to Microsoft 365 is to run it as a container under docker-compose on a GroundWork server. Of course, TCG is just a Go program and it's possible to deploy it differently, so it's up to you. Here's how to set it up as a container:
Edit the docker-compose.override.yml file in the gw8 directory of your GroundWork server. In the services: section, add:
tcg-office: image: groundworkdevelopment/tcg:${TAG} entrypoint: ["/app/docker_cmd.sh", "office-connector"] volumes: - tcg-var:/tcg
CODEAt the bottom of the file, under the volumes: section, make sure that volumes: is uncommented, and tcg-var: is listed as a volume, for example:
volumes: tcg-var:
Pay close attention to the indenting as you are editing a YAML file and it is sensitive to order and to white space.
Restart your GroundWork server:
docker-compose down docker-compose up -d
CODE
Setting Up the Connector
Sign in to your GroundWork server as an administrative user.
Go to Configuration > Connectors.
- Click the Add
fas fa-plus-square
icon and select the Office connector from the menu.
- Enter the following information:
- Connector Name: Provide a unique name
- TCG Host Address: Enter 172.17.0.1:8099, unless you have changed where TCG is running with a custom configuration
- Tenant ID: Provide your Microsoft 365 Tenant ID
- Client ID: Provide your Microsoft 365 Client ID
- Client Secret: Provide your Microsoft 365 client secret
Interval: Set a polling Interval, Timeout and Retries as desired
Microsoft may impose throttle limits on the API. While your polling interval can be set as fast as 1 minute, this may start failing if throttled. We recommend 30 minutes as an interval unless you really need it to be less, and not to go below 5 mins.
- Click Create.
- After a few moments, you will see a new host group called Microsoft Apps appear in Status. This will contain two hosts and several services representing the state of your Microsoft 365 services.
- Drilling down onto any services in a Warning or Critical state will give you a message about the issues detected. For example, in the image above, the Exchange Online and Microsoft 365 Suite services are up, but experiencing issues that affect some users.
In addition, unread email, license consumption and storage limits are monitored. While it is not possible to set the thresholds a priori, you can override them in the Status Summary. The default thresholds are:
Metric Default Threshold Description Onedrive.total none One Drive Total Disk Space Onedrive.remaining none One Drive Remaining Disk Space Onedrive.free Warning 15%, Critical 5% One Drive Percent Remaining Disk Space Sharepoint.total Warning 10, Critical 100 Share Point Total Disk Space Per Drive Sharepoint.remaining none Share Point Disk Space Remaining Per Drive Subscriptions.prepaid none Subscriptions Prepaid Count Subscriptions.consumed none Subscriptions Consumed Count Unread.emails Warning 5, Critical 10 Microsoft Office Unread Emails To adjust, browse to the service you want to adjust in Status, click More Actions and select Edit Thresholds. Your choice will override the defaults.
Related Resources
-
Page:
-
Page:
-
Page:
-
Page: