mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Add limit 1 to disk space queries (#2063)
This commit is contained in:
parent
e9d3460877
commit
15cf91dcc0
2 changed files with 3 additions and 2 deletions
1
changes/ensure-only-one-row-disk-space
Normal file
1
changes/ensure-only-one-row-disk-space
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Ensure only one row is returned when checking for disk space in hosts.
|
||||
|
|
@ -340,7 +340,7 @@ var detailQueries = map[string]DetailQuery{
|
|||
Query: `
|
||||
SELECT (blocks_available * 100 / blocks) AS percent_disk_space_available,
|
||||
round((blocks_available * blocks_size *10e-10),2) AS gigs_disk_space_available
|
||||
FROM mounts WHERE path = '/';`,
|
||||
FROM mounts WHERE path = '/' LIMIT 1;`,
|
||||
Platforms: []string{"darwin", "linux", "rhel", "ubuntu", "centos"},
|
||||
IngestFunc: ingestDiskSpace,
|
||||
},
|
||||
|
|
@ -348,7 +348,7 @@ FROM mounts WHERE path = '/';`,
|
|||
Query: `
|
||||
SELECT ROUND((sum(free_space) * 100 * 10e-10) / (sum(size) * 10e-10)) AS percent_disk_space_available,
|
||||
ROUND(sum(free_space) * 10e-10) AS gigs_disk_space_available
|
||||
FROM logical_drives WHERE file_system = 'NTFS';`,
|
||||
FROM logical_drives WHERE file_system = 'NTFS' LIMIT 1;`,
|
||||
Platforms: []string{"windows"},
|
||||
IngestFunc: ingestDiskSpace,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue