Skip to main content

In this tutorial, we'll show how Centreon can monitor Office 365 online services.

Office 365 is a line of online subscription services offered by Microsoft in their Microsoft Office product suite. Office 365 covers document creation and management, emailing, video conferencing and many more collaboration offerings. Already one of the most widely spread office productivity suites, it is still enjoying a high adoption rate.

In this article, we'll demonstrate how Centreon plugins and Plugin Packs can monitor the usage of each service in the Office 365 suite. As usual with mature SaaS solutions, it is not so much the service availability that matters: after all, we can trust the highly redundant Microsoft Azure cloud infrastructure will guarantee an excellent service level availability (but don't worry, we'll still check, we've got your back). What matters most is the cost of the service, which explains why we'll first and foremost monitor the usage and consumption of each service. This includes:

  • How much space is used by the Exchange mailboxes, and in particular the storage volume of inactive mailboxes.
  • How much the OneDrive storage space growing
  • How many SharePoint intranet sites are created and how many of the pages are viewed
  • How many active and inactive Skype or Teams users each month and of those users, which service they use

It's important to track this information for efficiency. Microsoft makes all this information available through the Office 365 management API. With this in mind, the first step is to authorize Centreon to access this API.


1. Authorizing Centreon to access Office 365 management API

The authorize this first step, please register Centreon in the Azure Active Directory and configure its application rights to grant API access. Follow this Microsoft tutorial to register your Centreon application and get a client identifier (Client ID) and its associated secret (Client Secret).

Once you've got your Client ID and Client Secret, you're ready to use Centreon plugins and Plugin Packs dedicated to Office 365 monitoring. Please note that you will also need your Azure Tenant ID, which uniquely identifies your organization within the multi-tenant Office 365 SaaS service.

This diagram shows the Office 365 management API authorization and access flow.

 

2. Installing and testing Office 365 Centreon plugins

Office 365 services are monitored by the centreon-plugin-Cloud-Microsoft-Office365-* plugins. Tasks available on the Centreon standard repository help our users:

To monitor the availability of all services and their functionalities:

  • centreon-plugin-Cloud-Microsoft-Office365-Management-Api

To monitor the usage of each service:

  • centreon-plugin-Cloud-Microsoft-Office365-Exchange-Api
  • centreon-plugin-Cloud-Microsoft-Office365-Onedrive-Api
  • centreon-plugin-Cloud-Microsoft-Office365-Sharepoint-Api
  • centreon-plugin-Cloud-Microsoft-Office365-Skype-Api
  • centreon-plugin-Cloud-Microsoft-Office365-Teams-Api

These six plugins must be installed on the Poller that will access the API. Use the standard CentOS/RedHat yum command:

yum install centreon-plugin-Cloud-Microsoft-Office365-*yum install centreon-plugin-Cloud-Microsoft-Office365-*
Installing these six plugins will also automatically install the following Perl dependencies:
JSON::XS
Text::CSV
DateTime
Digest::MD5
Digest::SHA
LWP::UserAgent
LWP::Protocol::https
IO::Socket::SSL
URI
Encode
HTTP::ProxyPAC

You're now ready to use the plugins.

It is a good practice to test the plugins with command lines and verify Centreon can connect to the Office 365 management API. Use your own Tenant ID, Client ID and Client Secret in the command line parameters below.

Let's start by verifying the availability of all Office 365 services with the centreon-plugin-Cloud-Microsoft-Office365-Management-Api plugin:

/usr/lib/centreon/plugins//centreon_office365_management_api.pl --plugin=cloud::microsoft::office365::management::plugin --mode=service-status --custommode='managementapi' --tenant='b3dd23de-593f3cfe-4d741212-bcf9-f035c1a2eb24' --client-id='76f82731-073b-4eb2-9228-901d252d2cb6-1b0d' --client-secret='9/kRTASjPoy9FJfQZg6iznXAkzCGertBgNq5r3tPfECJfKxj6zA='

You may filter this command to get information about a single service, say Exchange for example, using the --filter-service-name parameter:

/usr/lib/centreon/plugins//centreon_office365_management_api.pl
--plugin=cloud::microsoft::office365::management::plugin
--mode=service-status --custommode='managementapi'
--tenant='b3dd23de-593f3cfe-4d741212-bcf9-f035c1a2eb24'
--client-id='76f82731-073b-4eb2-9228-901d252d2cb6-1b0d'
--client-secret='9/kRTASjPoy9FJfQZg6iznXAkzCGertBgNq5r3tPfECJfKxj6zA='
--verbose --filter-service-name='Exchange Online'
--filter-feature-name='' --warning-status=''
--critical-status='%{status} !~ /Normal/i'

OK: Service 'Exchange Online' Status is 'Normal service' - All features
status are ok |
Checking service 'Exchange Online'
Status is 'Normal service'
Feature 'E-Mail and calendar access' Status is 'Normal service'
Feature 'E-Mail timely delivery' Status is 'Normal service'
Feature 'Management and Provisioning' Status is 'Normal service'
Feature 'Sign-in' Status is 'Normal service'
Feature 'Voice mail' Status is 'Normal service'

Let's continue now with the other five plugins.

Counting active mailboxes:

/usr/lib/centreon/plugins//centreon_office365_exchange_api.pl --plugin=cloud::microsoft::office365::exchange::plugin --mode=email-activity --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='

OK: Active mailboxes on 2019-03-10 : 141/1532 (9.20%) - Total (active mailboxes) Send Count: 9478, Receive Count: 62197, Read Count: 24401 | 'active_mailboxes'=141mailboxes;;;0;1532 'total_send_count'=9478;;;0; 'total_receive_count'=62197;;;0; 'total_read_count'=24401;;;0;
Counting active SharePoint sites:
/usr/lib/centreon/plugins//centreon_office365_sharepoint_api.pl --plugin=cloud::microsoft::office365::sharepoint::plugin --mode=site-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='

OK: Active sites on 2019-03-10 : 31/223 (13.90%) - Total Usage (active sites): 894.19 GB, Usage (inactive sites): 39.96 GB, File Count (active sites): 484988, Active File Count (active sites): 25216, Visited Page Count (active sites): 2100, Page View Count (active sites): 63313 | 'active_sites'=31sites;;;0;223 'storage_used_active'=960124526467B;;;0; 'storage_used_inactive'=42908489124B;;;0; 'total_file_count'=484988;;;0; 'total_active_file_count'=25216;;;0; 'total_visited_page_count'=2100;;;0; 'total_page_view_count'=63313;;;0;

Counting OneDrive active sites and files:

/usr/lib/centreon/plugins//centreon_office365_onedrive_api.pl --plugin=cloud::microsoft::office365::onedrive::plugin --mode=usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='

OK: Active sites on 2019-03-10 : 22/6999 (0.31%) - Total Usage (active sites): 329.71 GB, Usage (inactive sites): 1.32 TB, File Count (active sites): 86072, Active File Count (active sites): 564 | 'active_sites'=22sites;;;0;6999 'storage_used_active'=354024695212B;;;0; 'storage_used_inactive'=1456160306142B;;;0; 'total_file_count'=86072;;;0; 'total_active_file_count'=564;;;0;
-bash-4.2$

Counting devices that are connected to Skype:

/usr/lib/centreon/plugins//centreon_office365_skype_api.pl --plugin=cloud::microsoft::office365::skype::plugin --mode=devices-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='

OK: Active users on 2019-03-10 : 0/11110 (0.00%) - Users count by device type : Windows: 0, iPad: 0, iPhone: 0, Android Phone: 0, Windows Phone: 0 | 'active_users'=0users;;;0;11110 'windows'=0;;;0; 'ipad'=0;;;0; 'iphone'=0;;;0; 'android_phone'=0;;;0; 'windows_phone'=0;;;0;

Counting devices that are connected to Teams:

/usr/lib/centreon/plugins//centreon_office365_teams_api.pl --plugin=cloud::microsoft::office365::teams::plugin --mode=devices-usage --custommode='graphapi' --tenant='c9ee49ef-684g-5e85-cdg8-f146d2b3fc35' --client-id='87g71842-184c-5fc3-8334-813e363e3de7' --client-secret='8/lSUBXhMnz8GHgRYh7jwoYChPr6s4uQgFDKgLyg7wB='

OK: Active users on 2019-03-10 : 11/11154 (0.10%) - Users count by device type : Windows: 10, Mac: 0, Web: 3, iOS: 2, Android Phone: 0, Windows Phone: 0 | 'active_users'=11users;;;0;11154 'windows'=10;;;0; 'mac'=0;;;0; 'web'=3;;;0; 'ios'=2;;;0; 'android_phone'=0;;;0; 'windows_phone'=0;;;0;

Great! Your plugins are installed and can connect to the Office 365 management API. It's now time to start monitoring.

 

3. Installing and monitoring with Office 365 Plugin Packs

Plugin Pack Manager is the name of the Centreon user interface to list, download and update over 300 Plugin Packs.

From the Configuration > Plugin Packs > Manager user interface, search for Office:

Install each Plugin Pack to get the Host configuration templates:

  • Cloud-Microsoft-Office365-Management-Api-Custom
  • Cloud-Microsoft-Office365-Exchange-Api-Custom
  • Cloud-Microsoft-Office365-Onedrive-Api-Custom
  • Cloud-Microsoft-Office365-Sharepoint-Api-Custom
  • Cloud-Microsoft-Office365-Skype-Api-Custom
  • Cloud-Microsoft-Office365-Teams-Api-Custom

This will also install the associated Service configuration templates.

Add a new Host which IP Address / DNS parameter is localhost and add these Host Templates to it. Make sure you check the option to Create Services linked to the Template too: this will automatically create and configure the Services defined by the associated Service Templates. You will need to fill in your Office 365 management API credentials into the relevant Macro:

  • OFFICE365TENANT : Tenant ID
  • OFFICE365CLIENTID : Client ID
  • OFFICE365CLIENTSECRET : Client Secret

You are now ready to generate the configuration, export it and send it to the Poller.

Done! You are now monitoring the availability of the Office 365 services, their usage and consumption.

 

4. Detailing the metrics Centreon is monitoring

Data collected and monitored by the Office 365 Host and Service configuration templates installed with the Plugin Packs is listed in the following tables.

 

Exchange :

Metric Name Description
active_mailboxes Total active mailboxes (Percentage)
total_read_count Read emails (count)
total_receive_count Received emails (count)
total_send_count Sent emails (count)
storage_used_active Storage used by active mailboxes (bytes, Gbytes)
storage_used_inactive Storage used by inactive mailboxes (bytes, Gbytes)

 

OneDrive :

Metric Name Description
active_sites Active sites count (count, percentage)
storage_used_active Storage used by active sites (bytes, Gbytes)
storage_used_inactive Storage used by inactive sites (bytes, Gbytes)
total_file_count Total file count (count)
total_active_file_count Total active file count (count)

 

SharePoint :

Metric Name Description
active_sites Active sites count (count, percentage)
storage_used_active Storage used by active sites (bytes, Gbytes)
storage_used_inactive Storage used by inactive sites (bytes, Gbytes)
total_file_count Total file count (count)
total_active_file_count Total active file count (count)
total_visited_page_count Total visited pages (count)
total_page_view_count Total viewed pages (count)
active_users Total active users (count, percentage)
total_viewed_edited_file_count Total edited files (count)
total_synced_file_count Total synchonized files (count)
total_shared_int_file_count Total shared files (count)
total_shared_ext_file_count Total shared files to external users (count)

 

Skype :

Metric Name Description
active_users Active users (count, percentage)
windows Windows devices connected (count)
ipad iPad connected (count)
iphone iPhone connected (count)
android_phone Android devices connected (count)
windows_phone Windows phone connected (count)
total_peer_to_peer_sessions Active sessions (count)
total_organized_conference Planned Videoconferences (count)
total_participated_conference Completed Videoconferences (count)

 

Teams :

Metric Name Description
active_users  Active users (count, percentage)
windows Windows devices connected (count)
mac Macintosh devices connected (count)
web Web browser connection (count)
ios iOS devices connected (count)
android_phone Android devices connected (count)
windows_phone Windows Phone devices connected (count)
total_team_chat Collaborative Chat sessions (count)
total_private_chat Private Chat sessions (count)
total_call Total Calls (count)
total_meeting Total Meetings (count)

 

5. See & Share monitoring information: it's your time to be creative

Centreon EMS includes two different tools to visualize and share monitoring information:

  • Custom Views are widget-based dashboards that teams in charge of maintaining services, unified communications and infrastructure in Operational Conditions leverage or custom-build to their exact needs
  • MAPs are draw-it-yourself graphical views used to easily share relevant information with all stakeholders

It's your time to be creative! Start by adding Office 365 services availability information into your existing high-level MAP cockpit view that summarize the overall IT service and infrastructure health. You may then create a dedicated Office 365 Custom View to monitor service usage and consumption KPIs and proactively anticipate any capacity shortage.

Office 365 monitoring dashboard in Centreon.

 

Your turn to play with Centreon
Be the first to reply!

Reply