Home Directory Plugins Cloud check_o365licenseusage

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_o365licenseusage

Rating
0 votes
Favoured:
0
Current Version
1.0.1
Last Release Date
2024-05-27
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
License
GPL
Hits
1552
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This script check Office 365 licence usage via graph REST API
check o365 License usage

prerequisites

This script uses theses libs :
REST::Client, Data::Dumper, Monitoring::Plugin, File::Basename, JSON, Readonly, URI::Encode

to install them type :


(sudo) cpan REST::Client Data::Dumper JSON Readonly Monitoring::Plugin File::Basename URI::Encode


this script writes the authentication information in the/tmp directory it will be necessary to verify that this directory exists and that the account which will launch the script has the necessary access permissions.

this scrip use an azure app registration azure with access permissions on graph api : type application, Organization.Read.All et Directory.Read.All.

Use case

check_o365licenseusage.pl 1.0.1

This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).

check_o365licenseusage.pl check o365 License usage

Usage: check_o365licenseusage.pl [-v] -T TENANTID -I CLIENTID -p CLIENTSECRET [-N LICENSENAME] [-w WARNING] [-c CRITICAL]

-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See https://www.monitoring-plugins.org/doc/extra-opts.html
for usage and examples.
-T, --tenant=STRING
The GUID of the tenant to be checked
-I, --clientid=STRING
The GUID of the registered application
-p, --clientsecret=STRING
Access Key of registered application
-N, --licensename=STRING
name of the license to check let this empty to get all license usage
-w, --warning=threshold
See https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT for the threshold format.
-c, --critical=threshold
See https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT for the threshold format.
-t, --timeout=INTEGER
Seconds before plugin times out (default: 30)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)

sample :

perl GetLicencesO365.pl -T TENANTID -I CLIENTID -p CLIENTSECRET -N OFFICESUBSCRIPTION -w 80 -c 95

you may get :

OK - Microsoft 365 Apps for enterprise (OFFICESUBSCRIPTION) usage : 29.375 % (235/800) | OFFICESUBSCRIPTION_usage=29.37%;80;95