What is the best way to create a DQL code that lists the local host disk space used for Windows and Linux servers? I need only the local physical disk, not to show the mapped network drives. I’m using this code, and it shows local and network drives. Not sure how to filter for local drives only. Any recommendations? Thanks:
I don’t think there is a dedicated entity attribute to distinguish between local and network drives. This means you may have to filter at the end of the query based on some sort of name pattern that would match local drives and not network drives. Is there a specific pattern in how local drives are named when compared to network drives that you could filter on?
What about this metric?: storage.disk.fstype
I can probably filter by the type of Linux disk to get this done. How can I incorporate a lookup to read this disk type?
Gerald, thanks, this will work for my case. I see in my environment that the data is ok for hosts with newer Dynatrace agents, but older agents like 1.297 and below show as null. Thanks for the recommendations.
I know this thread is a bit old, but I was runnig on some problem. I found an attibute “remoteDiskId” in dt.entity.disk dimension, which is null when disk is local. Checked against many cenarius and worked fine.
Here my query for a Donut visualization:timeseries { dskUsed = max(dt.host.disk.used, scalar: true), dskFree = max(dt.host.disk.avail, scalar: true) }, interval: 1m, by: { dt.entity.host, dt.entity.disk }| fieldsAdd Disco = entityName(dt.entity.disk), remoteDiskId = entityAttr(dt.entity.disk, “remoteDiskId”)| lookup [fetch dt.entity.host | expand managementZones | fields id, managementZones, dt.entity.vmware_datacenter = asString( belongs_to[dt.entity.vmware_datacenter] ) | fieldsAdd DC = entityName( dt.entity.vmware_datacenter ) | filter DC == “DCDF” or DC == “DCSP”], sourceField:dt.entity.host, lookupField:id, prefix:“mz.”| filter mz.managementZones == $Filtro and (mz.DC == “DCDF” or mz.DC == “DCSP”) and isNull(remoteDiskId)| fieldsRemove mz.id, mz.dt.entity.vmware_datacenter, dt.entity.host, interval, timeframe| summarize a=sum(dskUsed), b=sum(dskFree)| fieldsAdd c=array( array(“Usado”, a), array(“Livre”, b)) | fieldsRemove a, b | expand c| fields Tipo=c[0], Valor=c[1]