When looking at a volume details view, you may have noticed that the threshold colors (green/yellow/red) of the percent used of a volume only use the global thresholds and not the custom volume thresholds you have specified.
For example, you will see something like:
which shows all green even though in my example I've changed the thresholds on /tmp to warning>30% and critical >36% and /boot to warning>15% and critical>19% (see below for the threshold setting screen for /tmp):
What I've done is to write some custom SQL that shows the volume information in a more pleasant way. Now I see:
where the coloring actually uses the per-volume (filesystem) thresholds instead of the system wide generic volume threshold defaults. It also graphically/textually shows the thresholds. I accomplished this by specifying the following SQL in a custom table. The SQL is shown below. Using CSS might be a better way to accomplish the 'graph' instead of HTML tables, but I copied code I'd previously written and it accomplishes what I desire.
SELECT
Caption AS InstanceCaption,
VolumeSize,
(
CAST(WarningThreshold AS varchar) +
'% / ' +
CAST(CriticalThreshold AS varchar) +
'%'
) AS Thresholds,
(
CASE
WHEN ROUND(CAST(VolumePercentUsed as float), 0) >= CAST(CriticalThreshold as float) THEN '<span style="background-color:#FF9999;color=black">'
WHEN ROUND(CAST(VolumePercentUsed as float), 0) >= CAST(WarningThreshold as float) THEN '<span style="background-color:#ffff66;color:black">'
ELSE '<span>'
END +
'<b>' +
CAST(ROUND(CAST(VolumePercentUsed as float), 0) as varchar) +
' %</b></span>'
) AS VolumePercentUsed,
(
'<table style="display: inline-block; width:100px; height:10px; border-collapse:collapse; vertical-align:top;" cellspacing="0" cellpadding="0">' +
'<tbody>' +
'<tr>' +
'<td style="background-color:' +
CASE
WHEN ROUND(CAST(VolumePercentUsed as float), 0) >= CAST(CriticalThreshold as float) THEN '#FF0000'
WHEN ROUND(CAST(VolumePercentUsed as float), 0) >= CAST(WarningThreshold as float) THEN '#FFFF00'
ELSE '#00FF00'
END +
';width:' +
CAST(ROUND(CAST(VolumePercentUsed as float), 0) as varchar) +
'px;height:8px;border:1px solid black;padding:0px;">' +
'</td>' +
'<td style="width:' +
CAST(ROUND(100 - CAST(VolumePercentUsed as float), 0) as varchar) +
'px;border:1px solid black;padding:0px;">' +
'</td>' +
'</tr>' +
'<tr>' +
'<td colspan="2" style="height:2px;border:1px solid black;padding:0px;" valign="bottom">' +
'<table style="width:100px; height:2px;" cellspacing="0" cellpadding="0">' +
'<tbody>' +
'<tr>' +
'<td style="background-color:#00FF00; width:' +
CAST(WarningThreshold as varchar) +
'px;border:0;padding:0;">' +
'</td>' +
'<td style="background-color:#FFFF00; width:' +
CAST(CriticalThreshold as varchar) +
'x;border:0;padding:0;">' +
'</td>' +
'<td style="background-color:#FF0000; width:' +
CAST((100 - CAST(CriticalThreshold as float)) AS varchar) +
'px;border:0;padding:0;">' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>'
) AS USED,
('/Orion/NetPerfMon/VolumeDetails.aspx?NetObject=V:' + CAST(InstanceId as varchar)) AS DetailsUrl
FROM
(
SELECT
n.NodeID,
v.[VolumeID] AS InstanceId,
v.[VolumeSize] AS VolumeSize,
v.Caption,
ISNULL(fm.[ThresholdType], 0) AS ThresholdType,
v.[VolumePercentUsed] AS VolumePercentUsed,
Floor((CASE WHEN (fcs.[WarningThreshold] IS NOT NULL)
THEN fcs.[WarningThreshold]
WHEN (fm.[ThresholdType] IS NULL OR fm.[ThresholdType] = 0)
THEN global.[GlobalWarningThreshold]
ELSE NULL END)) AS WarningThreshold,
Floor((CASE WHEN (fcs.[CriticalThreshold] IS NOT NULL)
THEN fcs.[CriticalThreshold]
WHEN (fm.[ThresholdType] IS NULL OR fm.[ThresholdType] = 0)
THEN global.[GlobalCriticalThreshold]
ELSE NULL END)) AS CriticalThreshold
FROM
[dbo].Nodes n
CROSS JOIN
(SELECT
Id,
Name,
ThresholdType,
GETUTCDATE() AS CurrentTime,
NULL AS ThresholdName
FROM [dbo].[ForecastMetrics]
WHERE
(EntityType = N'Orion.Volumes' AND [Name] = N'Forecast.Metric.PercentDiskUsed')
) fm
CROSS APPLY
(SELECT
ISNULL
((SELECT TOP 1 sts.CurrentValue
FROM [dbo].[ForecastMetrics] AS fmm WITH (NOLOCK)
INNER JOIN [dbo].[Settings] AS sts WITH (NOLOCK) ON sts.[SettingID] LIKE fmm.[CriticalThresholdSettingID]
WHERE fmm.EntityType = N'Orion.Volumes'), 0) GlobalCriticalThreshold,
ISNULL
((SELECT TOP 1 sts.CurrentValue
FROM [dbo].[ForecastMetrics] AS fmm WITH (NOLOCK)
INNER JOIN [dbo].[Settings] AS sts WITH (NOLOCK) ON sts.[SettingID] LIKE fmm.[WarningThresholdSettingID]
WHERE fmm.EntityType = N'Orion.Volumes'), 0) GlobalWarningThreshold
) global
JOIN [dbo].[Volumes] AS v ON v.[nodeID] = n.nodeID
LEFT JOIN ForecastCapacitySettings AS fcs ON v.[VolumeID] = fcs.[InstanceId] AND fcs.[MetricId] = fm.[Id]
where n.nodeid = ${NodeID}
) AS ForecastThresholds
I'll leave it up to you to specify all of the table layout settings.