We are trying to monitor a few things related to Microsoft Graph. For this we need to POST for a Bearer token first. This works in an item:
https://login.microsoftonline.com/{$TENANT.ID}/oauth2/v2.0/token
This returns the following:
Then we created a discovery rule with a preprocessing rule:
This returns the full Bearer token as value for this, but how can we use this as a variable/macro?
As the LLD Macro function needs a JSON path this doesn't work, there is just a string which is the token.
If we remove the preprocessing rule, and create a LLD Macro:
Then Zabbix returns
When discovering SNMP, we can use {#SNMPVALUE} which returns the value of the discovery. Can it be as simple as that for HTTP agent?
Any solution would be appreciated!
https://login.microsoftonline.com/{$TENANT.ID}/oauth2/v2.0/token
This returns the following:
Code:
{"token_type":"Bearer","expires_in":3599,"ext_expi res_in":3599,"access_token":"TOKEN_STRING_HERE"}
Code:
JSONPath : $.access_token
As the LLD Macro function needs a JSON path this doesn't work, there is just a string which is the token.
If we remove the preprocessing rule, and create a LLD Macro:
Code:
{#BEARER} : $.access_token
Code:
Cannot find the "data" array in the received JSON object.
Any solution would be appreciated!
Comment