Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cloud::microsoft::office365::exchange::mode::emailactivity] Month '-1' out of range 0..11 at #3059

Closed
ermurenz opened this issue Aug 30, 2021 · 17 comments
Labels

Comments

@ermurenz
Copy link

ermurenz commented Aug 30, 2021

Hi.
I don't know if this is the right place to present a problem like this. If not, I apologize in advance
i've a problem with "emailactivity" mode (cloud::microsoft::office365::exchange) .
I've been using it for a few months and have never had any problems, it has always worked from the start.
Since yesterday, however, this error has appeared and the check basically fails:

#/usr/lib/centreon/plugins/centreon_plugins.pl --plugin cloud::microsoft::office365::exchange::plugin --mode=email-activity --tenant='xxxx' --client-id='xxxx' --client-secret='xxxxx'

Use of uninitialized value $2 in subtraction (-) at /usr/lib/centreon/plugins/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.
Use of uninitialized value $1 in subtraction (-) at /usr/lib/centreon/plugins/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.
UNKNOWN: Month '-1' out of range 0..11 at /usr/lib/centreon/plugins/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.

I have not touched anything.
I tried to update, but nothing.
Any help is appreciated

@garnier-quentin
Copy link
Contributor

Could you provide the output with --debug ? you can sent it by email if you prefer

@fixlair
Copy link
Contributor

fixlair commented Aug 31, 2021

Hello !
we do have the same problem here. M365 should have updated something on their side ?

@garnier-quentin
Copy link
Contributor

Maybe. but i need the debug output.

@ermurenz
Copy link
Author

ermurenz commented Aug 31, 2021

Could you provide the output with --debug ? you can sent it by email if you prefer

I had tried --debug to try to get more information but the output is exactly the same, unfortunately.

PS:In the initial post, I would have liked to add that the other "mode", mailbox-usage, runs smoothly as usual.

@fixlair
Copy link
Contributor

fixlair commented Aug 31, 2021

Here is an output with --debug on centreon_plugins.pl --plugin=cloud::microsoft::office365::onedrive::plugin --mode=site-usage --custommode='graphapi'

Use of uninitialized value $2 in subtraction (-) at /var/lib/centreon/plugins/cloud/microsoft/office365/onedrive/mode/siteusage.pm line 39.
Use of uninitialized value $1 in subtraction (-) at /var/lib/centreon/plugins/cloud/microsoft/office365/onedrive/mode/siteusage.pm line 39.
UNKNOWN: Month '-1' out of range 0..11 at /var/lib/centreon/plugins/cloud/microsoft/office365/onedrive/mode/siteusage.pm line 39.

On centreon_plugins.pl --plugin=cloud::microsoft::office365::sharepoint::plugin --mode=users-activity --custommode='graphapi'

Use of uninitialized value $2 in subtraction (-) at /var/lib/centreon/plugins/cloud/microsoft/office365/sharepoint/mode/usersactivity.pm line 39.
Use of uninitialized value $1 in subtraction (-) at /var/lib/centreon/plugins/cloud/microsoft/office365/sharepoint/mode/usersactivity.pm line 39.
UNKNOWN: Month '-1' out of range 0..11 at /var/lib/centreon/plugins/cloud/microsoft/office365/sharepoint/mode/usersactivity.pm line 39.

@garnier-quentin
Copy link
Contributor

The --debug should display informations. Could you test with --http-backend=curl ?

@prohand
Copy link

prohand commented Aug 31, 2021

Same problem : #3062

@prohand
Copy link

prohand commented Aug 31, 2021

The debug show no more information
Same problem with --http-backend=curl

@garnier-quentin
Copy link
Contributor

Could you add following line in file: centreon/plugins/backend/http/curl.pm

    print $msg . "\n";
    $uservar->{output}->output_add(long_msg => $msg, debug => 1);
    return 0;

@prohand
Copy link

prohand commented Aug 31, 2021

At the end of file ?

@garnier-quentin
Copy link
Contributor

garnier-quentin commented Aug 31, 2021

Over the following line:

$uservar->{output}->output_add(long_msg => $msg, debug => 1);

@prohand
Copy link

prohand commented Aug 31, 2021

I have send the debug to you're email.

@ermurenz
Copy link
Author

ermurenz commented Sep 1, 2021

My debug:

#####################################################

== Info: About to connect() to graph.microsoft.com port 443 (#0)

== Info: Trying 40.126.32.99...

== Info: Connected to graph.microsoft.com (40.126.32.99) port 443 (#0)

== Info: Initializing NSS with certpath: sql:/etc/pki/nssdb

== Info: CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none

== Info: SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

== Info: Server certificate:

== Info: subject: CN=graph.microsoft.com,O=Microsoft Corporation,L=Redmond,ST=WA,C=US

== Info: start date: ago 24 03:41:31 2021 GMT

== Info: expire date: ago 19 03:41:31 2022 GMT

== Info: common name: graph.microsoft.com

== Info: issuer: CN=Microsoft Azure TLS Issuing CA 01,O=Microsoft Corporation,C=US

=> Send header: GET /v1.0/reports/getEmailActivityUserDetail(period='D7') HTTP/1.1
Host: graph.microsoft.com
Accept:application/json
Content-Type:application/x-www-form-urlencoded
Authorization:Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6IjRnZEduMGV6ejM0MHhTUWtsdC1JaVdNMnBpODFmYWhrSEVKVDJ3eWYzcVEiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC80ZGJlNTEzYS0wZDRiLTQ5Y2MtODg5NC0yMTdiNDNjNDVkYjgvIiwiaWF0IjoxNjMwNDY2NjczLCJuYmYiOjE2MzA0NjY2NzMsImV4cCI6MTYzMDQ3MDU3MywiYWlvIjoiRTJaZ1lFZ3dZNVAxV3I3TWZtTEJMSWtaRjZRekFRPT0iLCJhcHBfZGlzcGxheW5hbWUiOiJDZW50cmVvbiIsImFwcGlkIjoiMDc1NWY4NjktYmY4ZS00MDczLTkxYzQtNDFjNDdlM2JlMzczIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNGRiZTUxM2EtMGQ0Yi00OWNjLTg4OTQtMjE3YjQzYzQ1ZGI4LyIsImlkdHlwIjoiYXBwIiwib2lkIjoiMTk1OWU5MDQtZTlmMC00ZmYyLWIzMWMtMjc5YTU2YjhmOGU2IiwicmgiOiIwLkFTRUFPbEctVFVzTnpFbUlsQ0Y3UThSZHVHbjRWUWVPdjNOQWtjUkJ4SDQ3NDNNaEFBQS4iLCJyb2xlcyI6WyJSZXBvcnRzLlJlYWQuQWxsIl0sInN1YiI6IjE5NTllOTA0LWU5ZjAtNGZmMi1iMzFjLTI3OWE1NmI4ZjhlNiIsInRlbmFudF9yZWdpb25fc2NvcGUiOiJFVSIsInRpZCI6IjRkYmU1MTNhLTBkNGItNDljYy04ODk0LTIxN2I0M2M0NWRiOCIsInV0aSI6ImpIT0xfSXA2TDAyRlVjejM2N0FJQUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdLCJ4bXNfdGNkdCI6MTUyMzQ1Mzc3MX0.oLcCqnMzr0RXpOx42fGfG0W7YasBBs42IE1-vDNTNDCZzDw1MyWpPxmrIfVM4XsabVlw0bGG4U0kJc5hPVaVyL2SV2KWG2ig0koDIV0DgfQwB_N0U9PjMPw2v6uosrE3S6k1mIMcZcnm3pcOaR_DcV3tZ92Fx9kiWYKrCcOGlNVYuSUPUYC7jyTUixEha-eprPtqp88HKHDNiyl6B2qVr4L23_kMkab_xm_0-_4Lzj_d-b7S-wUrkJPaf9jTAzKyjWdG4tIV9hYEKAThqRHutWjS0JAiixdCBizceIAB5bhFuz97XA6M6hGdW4Ea41BZVO5apzKg9xJsZcyw7Z3M5w

=> Recv header: HTTP/1.1 302 Found

=> Recv header: Date: Wed, 01 Sep 2021 03:56:52 GMT

=> Recv header: Cache-Control: no-store, no-cache, max-age=0, s-maxage=0, private

=> Recv header: Transfer-Encoding: chunked

=> Recv header: Location: https://reportsweu.office.com/data/v1.0/download?token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjRDNThDODAwNTlBQ0VDQjJFQzFDMjA1RkUzMUVBNjRFQzcwMzQzQkEiLCJ0eXAiOiJKV1QifQ.eyJ0aWQiOiI0ZGJlNTEzYS0wZDRiLTQ5Y2MtODg5NC0yMTdiNDNjNDVkYjgiLCJlbnQiOiJnZXRFbWFpbEFjdGl2aXR5VXNlckRldGFpbCIsImFwcCI6IjA3NTVmODY5LWJmOGUtNDA3My05MWM0LTQxYzQ3ZTNiZTM3MyIsImNpZCI6IjM5Nzk4ODBEMEIwODQxMDg5QTgzMTZCN0RBQTNCMzY0IiwiZ3ZlciI6IlYxIiwiYWdnIjoiTTciLCJkYXRlIjoiIiwidHZlciI6IlYxLjAiLCJyZXEiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20iLCJwb3IiOiI0NDMiLCJuYmYiOjE2MzA0Njg2MTIsImV4cCI6MTYzMDQ2ODczMiwiaWF0IjoxNjMwNDY4NjEyLCJpc3MiOiI1MDdiYzlkYS1jNGUyLTQwY2ItOTZhNy1hYzkwZGY5MjY4NWMiLCJhdWQiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20ifQ.bRu_q8R6xdRMxTbhQaOwy1ucubgPidU_Q085iwy29_XWKS5_zvMLXjBhXtR7_6WYl3D0NNumCYaWpQ7Jl1jkH0xr3iJoChEEpa1IlqcTQk_fLCg-o7cncrbcB6GG-UWwh1iMkawQ9BGaCjr6guFE7z5Inx2OJh_LCbwHTjn4K37UG-U1ehaJ1XdbN61snouLekgGGzzyFbkIy6sHYh42RsPRee6Wl11JBJdSrR44vFkwrdS00tV3cNx6xBhO7n9v2zY0S_ee_VocC7VFNjbLXebDlssnZphF_d-c1ZofUm67ULjwSCVHWFQ_m3dXno1LBJBA-ddYMWKrVmcAt238mA

=> Recv header: Strict-Transport-Security: max-age=31536000

=> Recv header: request-id: b69b1e3d-828f-450b-bfa2-f67dcd4fe6db

=> Recv header: client-request-id: b69b1e3d-828f-450b-bfa2-f67dcd4fe6db

=> Recv header: x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"AM1PEPF0000436A"}}

=> Recv header:

== Info: Ignoring the response-body

=> Recv data: 0

== Info: Connection #0 to host graph.microsoft.com left intact

== Info: Issue another request to this URL: 'https://reportsweu.office.com/data/v1.0/download?token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjRDNThDODAwNTlBQ0VDQjJFQzFDMjA1RkUzMUVBNjRFQzcwMzQzQkEiLCJ0eXAiOiJKV1QifQ.eyJ0aWQiOiI0ZGJlNTEzYS0wZDRiLTQ5Y2MtODg5NC0yMTdiNDNjNDVkYjgiLCJlbnQiOiJnZXRFbWFpbEFjdGl2aXR5VXNlckRldGFpbCIsImFwcCI6IjA3NTVmODY5LWJmOGUtNDA3My05MWM0LTQxYzQ3ZTNiZTM3MyIsImNpZCI6IjM5Nzk4ODBEMEIwODQxMDg5QTgzMTZCN0RBQTNCMzY0IiwiZ3ZlciI6IlYxIiwiYWdnIjoiTTciLCJkYXRlIjoiIiwidHZlciI6IlYxLjAiLCJyZXEiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20iLCJwb3IiOiI0NDMiLCJuYmYiOjE2MzA0Njg2MTIsImV4cCI6MTYzMDQ2ODczMiwiaWF0IjoxNjMwNDY4NjEyLCJpc3MiOiI1MDdiYzlkYS1jNGUyLTQwY2ItOTZhNy1hYzkwZGY5MjY4NWMiLCJhdWQiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20ifQ.bRu_q8R6xdRMxTbhQaOwy1ucubgPidU_Q085iwy29_XWKS5_zvMLXjBhXtR7_6WYl3D0NNumCYaWpQ7Jl1jkH0xr3iJoChEEpa1IlqcTQk_fLCg-o7cncrbcB6GG-UWwh1iMkawQ9BGaCjr6guFE7z5OJh_LCbwHTjn4K37UG-U1ehaJ1XdbN61snouLekgGGzzyFbkIy6sHYh42RsPRee6Wl11JBJdSrR44vFkwrdS00tV3cNx6xBhO7n9v2zY0S_ee_VocC7VFNjbLXebDlssnZphF_d-c1ZofUm67ULjwSCVHWFQ_m3dXno1LBJBA-ddYMWKrVmcAt238mA'

== Info: About to connect() to reportsweu.office.com port 443 (#1)

== Info: Trying 13.69.251.46...

== Info: Connected to reportsweu.office.com (13.69.251.46) port 443 (#1)

== Info: CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none

== Info: SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

== Info: Server certificate:

== Info: subject: CN=reports.office.com,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US

== Info: start date: dic 04 00:00:00 2020 GMT

== Info: expire date: dic 03 23:59:59 2021 GMT

== Info: common name: reports.office.com

== Info: issuer: CN=DigiCert Cloud Services CA-1,O=DigiCert Inc,C=US

=> Send header: GET /data/v1.0/download?token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjRDNThDODAwNTlBQ0VDQjJFQzFDMjA1RkUzMUVBNjRFQzcwMzQzQkEiLCJ0eXAiOiJKV1QifQ.eyJ0aWQiOiI0ZGJlNTEzYS0wZDRiLTQ5Y2MtODg5NC0yMTdiNDNjNDVkYjgiLCJlbnQiOiJnZXRFbWFpbEFjdGl2aXR5VXNlckRldGFpbCIsImFwcCI6IjA3NTVmODY5LWJmOGUtNDA3My05MWM0LTQxYzQ3ZTNiZTM3MyIsImNpZCI6IjM5Nzk4ODBEMEIwODQxMDg5QTgzMTZCN0RBQTNCMzY0IiwiZ3ZlciI6IlYxIiwiYWdnIjoiTTciLCJkYXRlIjoiIiwidHZlciI6IlYxLjAiLCJyZXEiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20iLCJwb3IiOiI0NDMiLCJuYmYiOjE2MzA0NTIsImV4cCI6MTYzMDQ2ODczMiwiaWF0IjoxNjMwNDY4NjEyLCJpc3MiOiI1MDdiYzlkYS1jNGUyLTQwY2ItOTZhNy1hYzkwZGY5MjY4NWMiLCJhdWQiOiJyZXBvcnRzd2V1Lm9mZmljZS5jb20ifQ.bRu_q8R6xdRMxTbhQaOwy1ucubgPidU_Q085iwy29_XWKS5_zvMLXjBhXtR7_6WYl3D0NNumCYaWpQ7Jl1jkH0xr3iJoChEEpa1IlqcTQk_fLCg-o7cncrbcB6GG-UWwh1iMkawQ9BGaCjr6guFE7z5Inx2OJh_LCbwHTjn4K37UG-U1ehaJ1XdbN61snouLekgGGzzyFbkIy6sHYh42RsPRee6Wl11JBJdSrR44vFkwrdS00tV3cNx6xBhO7n9v2zY0S_ee_VocC7VFNjbLXebDlssnZphF_d-c1ZofUm67ULjwSCVHWFQ_m3dXno1LBJBA-ddYMWKrVmcAt238mA HTTP/1.1
Host: reportsweu.office.com
Accept:application/json
Content-Type:application/x-www-form-urlencoded

=> Recv header: HTTP/1.1 200 OK

=> Recv header: Cache-Control: no-store, no-cache, max-age=0, s-maxage=0, private

=> Recv header: Pragma: no-cache

=> Recv header: Transfer-Encoding: chunked

=> Recv header: Content-Type: application/octet-stream

=> Recv header: ETag: "OC8yOS8yMDIxIDEyOjAwOjAwIEFNICswMDowMA=="

=> Recv header: Server: Microsoft-IIS/10.0

=> Recv header: X-XSS-Protection: 1; mode=block

=> Recv header: X-Content-Type-Options: nosniff

=> Recv header: Strict-Transport-Security: max-age=31536000; includeSubDomains

=> Recv header: X-Frame-Options: Deny

=> Recv header: Content-Security-Policy: frame-options

=> Recv header: requestId: CA5064979B434E39D60B7771BE9CAA

=> Recv header: Content-Disposition: attachment; filename="EmailActivityUserDetail9/1/2021 3:56:52 AM.csv"

=> Recv header: X-Powered-By: ASP.NET

=> Recv header: Date: Wed, 01 Sep 2021 03:56:52 GMT

=> Recv header:

=> Recv data: 3

=> Recv data: a5
Report Refresh Date,User Principal Name,Display Name,Is Deleted,Deleted Date,Last Activity Date,Send Count,Receive Count,Read Count,Assigned Products,Report Period

=> Recv data: 0

== Info: Connection #1 to host reportsweu.office.com left intact

Use of uninitialized value $2 in subtraction (-) at /usr/lib/centreon/plugins/centreon-pack/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.
Use of uninitialized value $1 in subtraction (-) at /usr/lib/centreon/plugins/centreon-pack/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.
UNKNOWN: Month '-1' out of range 0..11 at /usr/lib/centreon/plugins/centreon-pack/cloud/microsoft/office365/exchange/mode/emailactivity.pm line 39.

############################################################################

@ermurenz
Copy link
Author

ermurenz commented Sep 2, 2021

Hi guys,
I don't know why, all checks with problems are back to normal.I didn't touch or modified anything, of course.
Same for you @prohand ?

For the record, the problem occurs from 30 august 10PM to 01 September 6PM

image

@prohand
Copy link

prohand commented Sep 2, 2021

Hello,
Yes the problem is solved

@garnier-quentin
Copy link
Contributor

garnier-quentin commented Sep 2, 2021

I have checked why. In fact, microsoft graphapi results was empty (no datas) (I don't know why). Maybe it can take more than 7 days (the default period we check).

And the plugin doesn't manage well with no data from the API. I should manage that case.

@prohand
Copy link

prohand commented Sep 2, 2021

Solved by Microsoft :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants