VeeamHub / grafana

Grafana dashboard for Veeam solutions
MIT License
59 stars 19 forks source link

"unable to parse" - HTTP/1.1 400 Bad Request - veeam_microsoft365.sh #19

Closed Gletru closed 2 years ago

Gletru commented 2 years ago

Hi,

First off, thank you very much for all the work you have put into this project. I'm very excited about having all the dashboards up and running here in the office. I have startet out with the m365 dashboard, but i run into some issues with getting data out of the RestAPI.

I should mention that i'm totally new to InfluxDB and Grafana. This is the first time in my life using it. But i managed to get InfluxDB 2.1.1 up and running, and Grafana on a CentOS 7 VM. (Grafana was the easy part :) )

I have downloaded the M365 dashboard for grafana and imported it, and i have downloaded the veeam_micrososoft365.sh script and edited the configuration section to match my real info. This seems to work well and when i run the script i get "some" data transferred to Influx and i can view the data in Grafana. But while running the script i get some "errors" and i believe that is why not all fields in the dashboard are populated. For example i get no info on Licensed users and no Job information either. Information on new users count is there and also information on Self-service Portal Restore operators. Also i get information on storage usage in object storage.

I will try and paste the error i see when i run the script. I will not paste it all, as i have rather many users who all get the same error. But here is an example of the errors:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: 2.1.1
X-Platform-Error-Code: invalid
Date: Thu, 31 Mar 2022 11:04:09 GMT
Content-Length: 209

{"code":"invalid","message":"unable to parse 'veeam_office365_overview_OD,veeamOrgName=ateaitos.onmicrosoft.com,veeamUserName=**I Removed Mail address** protectedUser=1,licensedUser=': missing field value"}HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: 2.1.1
X-Platform-Error-Code: invalid
Date: Thu, 31 Mar 2022 11:04:09 GMT
Content-Length: 209

{"code":"invalid","message":"unable to parse 'veeam_office365_overview_OD,veeamOrgName=ateaitos.onmicrosoft.com,veeamUserName=**Removed Mail address** protectedUser=1,licensedUser=': missing field value"}HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: 2.1.1
X-Platform-Error-Code: invalid
Date: Thu, 31 Mar 2022 11:04:09 GMT
Content-Length: 210

Any idea what could be the issue here? Thank you very much in advance.

jorgedlcruz commented 2 years ago

Hello, Thanks for letting me know, which version of Veeam Backup for Microsoft 365 are you running, and which version of the script? Thank you!

Gletru commented 2 years ago

Hi, I'm running the newest version of the script: LASTEDIT: 11/03/2022 VERSION: 6.0 And i'm running VBO 6.0.0.367

jorgedlcruz commented 2 years ago

That is really weird, the licenseduser comes empty it seems. If you go to swagger https://YOURB365:4443/swagger try to do Auth with user credentials, then click on Explore.

After you are in, navigate to the LicensedUser section, expand the endpoint GET, click try it now, and copy-paste a bit of what you get there, removing your personal data, please.

This is what I have:

image

Thanks! Can you see anything on the dashboard at all?

Gletru commented 2 years ago

Hi,

The Swagger UI returns the licensed user fine it seems. Here is a snip of what i see.

"self": { "href": "/v6/LicensedUsers?offset=0&limit=30" } }, "results": [ { "id": "ed4eb262-f07c-4b71-95d4-49ca316722c7:00000000-0000-0000-0000-000000000000", "name": "Email remoed", "isBackedUp": true, "lastBackupDate": "2022-03-20T22:00:15.7003078Z", "licenseState": "Licensed", "organizationId": "12613905-7cff-4c7a-9add-", "backedUpOrganizationId": "ateaitos.onmicrosoft.com:00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000", "organizationName": "ateaitos.onmicrosoft.com", "_links": { "organization": { "href": "v6/organization/12613905-7cff-4c7a-9add-" } } }, { "id": "6df86ff2-57b2-4703-9f65-96a74590dc4f:00000000-0000-0000-0000-000000000000", "name": "Email remoed", "isBackedUp": true, "lastBackupDate": "2022-03-31T22:00:17.8344773Z", "licenseState": "Licensed", "organizationId": "12613905-7cff-4c7a-9add-215c0", "backedUpOrganizationId": "ateaitos.onmicrosoft.com:00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000", "organizationName": "ateaitos.onmicrosoft.com", "_links": { "organization": { "href": "v6/organization/12613905-7cff-4c7a-9add" } } }, { "id": "5fb8d8f2-c610-4fa6-b76e-f2b56db3d133:00000000-0000-0000-0000-000000000000", "name": "Email remoed", "isBackedUp": true, "lastBackupDate": "2022-03-31T22:00:17.8344773Z", "licenseState": "Licensed", "organizationId": "12613905-7cff-4c7a-9add-215c", "backedUpOrganizationId": "ateaitos.onmicrosoft.com:00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000", "organizationName": "ateaitos.onmicrosoft.com", "_links": { "organization": { "href": "v6/organization/12613905-7cff-4c7a-9add-215c" } } },

Yes, i have rather many data in the Dashboard, to mention some: Storage Usage New Users Change Rate Job Status

Thank you in advance.

Gletru commented 2 years ago

Licensed User Swagger

jorgedlcruz commented 2 years ago

I have downloaded the code and ran it to my VB365 server, I have three tenants, and two are the Contoso ones, all ran fine.

You said the job statistics fail as well, would you mind sharing the error from those?

Have you downloaded the file with wget directly to the linux? Without copy paste from any editor, right?

Thanks, hope we can get to the bottom of this

Gletru commented 2 years ago

Hi, I downloaded the script directly with wget yes, and used VI to edit the Conf section.

But now i actually managed to get things up and running! I'm not sure how or why its suddenly working. The only thing i changed in between was that my InfluxDB was running as a daemon, in a shell in the CentOS vm. Now i stopped that daemon retrieved Influx once more, installed it, and started it "as a service" Changed my script config with the new token, and hooked the new influx db up with Grafana. And now, i get no errors at all, when running the script.

Not sure why it made a difference, but i'm happy that it did :)

jorgedlcruz commented 2 years ago

Hhahaha, amazing, well, hope you enjoy it. And if you are happy, please feel free to close the issue.

Appreciated a lot you spend some of your time troubleshooting, Take care!

Gletru commented 2 years ago

Thank you very much, and thank you for taking time to assist me. On to the next Dashboard :) Take care!