cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL query on disk free space

akashsaini
Participant

Hi Team,

We require DQL query on disk free space with OS type.

Information require through dql query --

disk free space for /opt/ directory
os type-like Linux ubuntu , AIX

Thanks in advance !

 

5 REPLIES 5

gbaudart
DynaMight Champion
DynaMight Champion

Hi @akashsaini,

You can try this query :

timeseries avg(dt.host.disk.free), by: { dt.entity.host, dt.entity.disk }
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| fieldsAdd dt.entity.disk.name = entityName(dt.entity.disk)
| lookup [fetch dt.entity.host
  | fieldsAdd osType2=osType], sourceField:dt.entity.host, lookupField:id, fields:{osType2}
| fieldsAdd DiskFree = arrayAvg(`avg(dt.host.disk.free)`)
| fieldsKeep dt.entity.host.name,dt.entity.disk.name, osType2, DiskFree

Let me know if it works

Dynatrace Partner - Professional Certified - DynaMight

Thanks Gbaudart,

query perfectly working.

Please confirm the disk free space in GB ?

 

gbaudart
DynaMight Champion
DynaMight Champion

Hi @akashsaini,
Normally, the unit will match the magnitude of your result. You can change the unit in the query display options.

Dynatrace Partner - Professional Certified - DynaMight

manog1978
Newcomer_

I am creating a Dashboad to pull the disk usage for windows and Linux Servers, for example in windows server (C. D. e) and Linux Server ,(/tmp, /root) can you please advise. should i use Query based or Metric based.

manog1978
Newcomer_

the following query works for percentage based, i would like to get the GB how much used and how much free.

timeseries avg(dt.host.disk.free), by: { dt.entity.host, dt.entity.disk }
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| fieldsAdd dt.entity.disk.name = entityName(dt.entity.disk)
| lookup [fetch dt.entity.host
| fieldsAdd osType2=osType], sourceField:dt.entity.host, lookupField:id, fields:{osType2}
| fieldsAdd DiskFree = arrayAvg(`avg(dt.host.disk.free)`)
| fieldsAdd DiskUsage = 100 - DiskFree
| fieldsKeep dt.entity.host.name, dt.entity.disk.name, osType2, DiskFree, DiskUsage


| sort DiskUsage asc

 

Featured Posts