Kbox not showing correct Hard Disk size on RHEL 5.4
We are experiencing problem that Kbox not showing correct Hard disk partition information of the machines where Red Hat Enterprise Linux 5.4 is installed. The situation becomes worst when we try to calculate the total HDD space via custom report, it is adding up MB and GB all together, so the size 4 GB in one partition and 800 MB in other partition becomes 804 . I am using the following SQL and it is working fine for my Windows XP and windows 7 machines.
SELECT MACHINE.IP AS MACHINE_IP ,sum(MACHINE_DISKS.DISK_SIZE) AS MACHINE_DISKS_DISK_SIZE, sum(MACHINE_DISKS.DISK_FREE) AS MACHINE_DISKS_DISK_FREE, sum(MACHINE_DISKS.DISK_USED) AS MACHINE_DISKS_DISK_USED FROM MACHINE_DISKS JOIN MACHINE ON (MACHINE.ID = MACHINE_DISKS.ID) group by MACHINE.IP ORDER BY MACHINE_DISKS.DISK_SIZE asc
Please note that we have most of the machines with 80 GB and more HDD size.
SELECT MACHINE.IP AS MACHINE_IP ,sum(MACHINE_DISKS.DISK_SIZE) AS MACHINE_DISKS_DISK_SIZE, sum(MACHINE_DISKS.DISK_FREE) AS MACHINE_DISKS_DISK_FREE, sum(MACHINE_DISKS.DISK_USED) AS MACHINE_DISKS_DISK_USED FROM MACHINE_DISKS JOIN MACHINE ON (MACHINE.ID = MACHINE_DISKS.ID) group by MACHINE.IP ORDER BY MACHINE_DISKS.DISK_SIZE asc
Please note that we have most of the machines with 80 GB and more HDD size.
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
GillySpy
13 years ago
Yes, I see the problem. I would open a ticket and log a bug but as a workaround you can use a query like this which parses the name to determine if the value is in Mb or Gb and translates all values in to Gb
SELECT MACHINE.IP AS MACHINE_IP ,
sum(MD.REAL_SIZE) AS MACHINE_DISKS_DISK_SIZE,
sum(MD.REAL_FREE) AS MACHINE_DISKS_DISK_FREE,
sum(MD.DISK_USED) AS MACHINE_DISKS_DISK_USED
FROM (
select *,
case when NAME RLIKE 'Total: [0-9]+[[...]]?[0-9]*M' THEN DISK_SIZE/1024
when NAME RLIKE 'Total: [0-9]+[[...]]?[0-9]*G' then DISK_SIZE
ELSE DISK_SIZE/1024/1024 /*KB*/ END REAL_SIZE,
case when NAME RLIKE 'Total: [0-9]+[[...]]?[0-9]*M' THEN DISK_FREE/1024
when NAME RLIKE 'Total: [0-9]+[[...]]?[0-9]*G' then DISK_FREE
ELSE DISK_FREE/1024/1024 /*KB*/ END REAL_FREE
FROM MACHINE_DISKS) MD
JOIN
MACHINE ON (MACHINE.ID = MD.ID)
group by MACHINE.IP
ORDER BY MD.DISK_SIZE asc
Posted by:
afzal
13 years ago
Posted by:
GillySpy
13 years ago
Posted by:
afzal
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.