‎01-03-2019 11:47 PM
Select Top 1000000 tblAssets.AssetID,
tblAssetCustom.Model,
tblAssetCustom.Manufacturer,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblLinuxSystem.OSRelease,
tblAssets.Memory,
tblAssets.NrProcessors,
tblLinuxHardDisks.Size
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblLinuxSystem On tblAssets.AssetID = tblLinuxSystem.AssetID
Inner Join tblLinuxHardDisks On tblAssets.AssetID = tblLinuxHardDisks.AssetID
Where tsysAssetTypes.AssetTypename <> 'router'
‎01-07-2019 03:59 PM
97605 86171 Filesystem 1K-blocks Used Available Use% Mounted on 2017-06-14 17:34:14.910
189963 118969 Filesystem 1K-blocks Used Available Use% Mounted on 2018-01-16 11:41:05.890
504822 331371 Filesystem 1K-blocks Used Available Use% Mounted on 2018-10-02 10:10:11.290
667996 360675 Filesystem 1K-blocks Used Available Use% Mounted on 2019-01-03 10:02:28.820
‎12-15-2021 09:26 PM
tcilmo wrote:
I tried:
Cast(tblLinuxHardDisks.Size / 1024 / 1024 As numeric) As TotalSizeGB
and got the error:
Msg 248, Level 16, State 1, Line 1
The conversion of the nvarchar value '2147483648' overflowed an int column.
I also discovered that I have a few Linux assets that are reporting disk size as "1K-Blocks", this might be a problem.97605 86171 Filesystem 1K-blocks Used Available Use% Mounted on 2017-06-14 17:34:14.910
189963 118969 Filesystem 1K-blocks Used Available Use% Mounted on 2018-01-16 11:41:05.890
504822 331371 Filesystem 1K-blocks Used Available Use% Mounted on 2018-10-02 10:10:11.290
667996 360675 Filesystem 1K-blocks Used Available Use% Mounted on 2019-01-03 10:02:28.820
Select Top 1000000 tblAssets.AssetName,
Cast((Convert(numeric(12),tblLinuxHardDisks.Size) / 1024 / 1024) As numeric)
As TotalGB,
Cast((Convert(numeric(12),tblLinuxHardDisks.Used) / 1024 / 1024) As numeric)
As UsedGB,
Cast((Convert(numeric(12),tblLinuxHardDisks.Available) / 1024 /
1024) As numeric) As FreeGB
From tblLinuxHardDisks
Inner Join tblAssets On tblLinuxHardDisks.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Where tblLinuxHardDisks.MountedOn Like '/volume_' And tblAssetCustom.State = 1
Order By tblAssets.AssetName
‎01-07-2019 03:35 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now