Track consumed host units for licensing usage

Hello guys,

you can use the curl call below to track host units (this requires jq tool in linux)

Have a nice day.

curl -k -s "https://YOURMCN/e/YOURENVID/api/v1/oneagents?Api-Token=YOURTOKEN&includeDetails=true&availabilitySta… " | jq | grep ‘^\s*“consumedHostUnits”:’ | sed ‘s/“consumedHostUnits”: //’ | sed ‘s/,//’ | paste -s -d+ - | bc

Hi,

You can use also this built metric for that dsfm:billing.hostunit.connected.

JSON

curl -X GET "https://{ENV_ID}.live.dynatrace.com/api/v2/metrics/query?metricSelector=(dsfm:billing.hostunit.connected:splitBy():sort(value(auto,descending))):names&from=-2h&to=now&resolution=Inf" -H "accept: application/json" -H "Authorization: Api-Token XXXX-XXXX"

CSV

curl -X GET "https://{ENV_ID}.live.dynatrace.com/api/v2/metrics/query?metricSelector=(dsfm:billing.hostunit.connected:splitBy():sort(value(auto,descending))):names&from=-2h&to=now&resolution=Inf" -H "accept: text/csv, application/json; q=0.1" -H "Authorization: Api-Token XXXX-XXXX"

Best regards