cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

Disk Volumes Widget show Space available

Disk space is a critical monitoring point for us. I have lots of alerts that go to different teams for this. That said, I also have various dashboards that display volumes to teams. The Disk Volumes widget looks like this:

shocko_0-1593525576700.png

This is fine but we have some 1TB + volumes so the percentage based display is misleading sometimes. Can I modify this widget or create my own that display the GB remaining ? I know we could use a custom table but I'd like to keep the graphics also.

0 Kudos
5 Replies

This is what the custom disk volume widget I use looks like, doesn't have the percent bar but it does change color when thresholds get breached or if there are status changes.  I also use it to display a custom attribute we use to route out disk alerts to the various teams as needed. 

 

mesverrum_0-1593548684519.png

 

SELECT
 ' ' as Type, concat('/netperfmon/images/Volumes/',v.Icon) as [_iconfor_Type]  
, v.Caption as [Volume]  
,'/Orion/images/StatusIcons/Small-' + case when v.StatusIcon = '' then 'unknown.gif' else v.StatusIcon end AS [_IconFor_Volume]  
, v.DetailsUrl as [_linkfor_Volume]  
, round(v.size/1073741824,1) as [Size GB]  
, round(v.VolumePercentUsed,1) as [% Used]  
--, round(v.VolumeSpaceUsed/1073741824,1) as [Used GB]  
--, round(v.volumespaceavailable/1073741824,1) as [Free GB]  
,'/ui/perfstack/?presetTime=last24Hours&charts=0_Orion.Volumes_'+tostring(v.volumeid)+'-Orion.VolumeUsageHistory.PercentDiskUsed;0_Orion.Volumes_'+tostring(v.volumeid)+'-Orion.PerfStack.Events,0_Orion.Volumes_'+tostring(v.volumeid)+'-Orion.PerfStack.Status;' as [_linkfor_% Used]  
, case   
when v.volumespaceavailable/1073741824 < v.CustomProperties.V_MinimumGB then '/Orion/images/StatusIcons/Small-Critical.gif'  
when fc.WarningThreshold is null and v.VolumePercentUsed > (Select CurrentValue AS [col1] FROM Orion.Settings WHERE SettingID = 'NetPerfMon-DiskSpace-Error') then '/Orion/images/StatusIcons/Small-Critical.gif'  
when fc.WarningThreshold is null and v.VolumePercentUsed > (Select CurrentValue AS [col1] FROM Orion.Settings WHERE SettingID = 'NetPerfMon-DiskSpace-Warning') then '/Orion/images/StatusIcons/Small-Warning.gif'  
when v.VolumePercentUsed>f.CriticalThreshold then '/Orion/images/StatusIcons/Small-Critical.gif'  
when v.VolumePercentUsed>f.WarningThreshold then '/Orion/images/StatusIcons/Small-Warning.gif'  
else '/Orion/images/StatusIcons/Small-Up.gif'  
end as [_Iconfor_% Used]
, v.CustomProperties.v_OwnerGroup
  
from orion.Volumes v  
left join Orion.ForecastCapacitySettings fc on fc.InstanceId=v.VolumeID and fc.metricid=3  
left join Orion.ForecastCapacity f on f.InstanceId = v.VolumeID and f.EntityType='Orion.volumes'  
  
where   
v.NodeID=${nodeid}  

order by v.Caption

 

- Marc Netterfield, Github

Thanks! When you say 'custom' though how to do you set this up? Is it adding the custom query to a pre-defined canned Widget (i.e. drop the widget onto a view and define the query) or are you building the widget from scratch (if that's even possible!)?
0 Kudos

There is a widget called "Custom Query" and you just paste in SWQL code to get the data you want.  It only outputs tables but it has some built in functions for adding icons and links and if you get creative you can make it do all kinds of useful things.  I find that *almost* everything I need can usually be accomplished through a custom query widget or a custom chart resource.  Going one step more meta I think the custom html widget opens up a pretty infinite range of possibilities for someone with the web dev skill set, unfortunately that's not terrible common on most ops teams.

- Marc Netterfield, Github

Thanks Marc. Am I being dense in relation to the custom HTML widget (I am using 2019.04) ? It seems to accept static HTML to it cannot be populated with query results can it? Also, you say:

  •  It only outputs tables but it has some built in functions for adding icons and links and if you get creative you can make it do all kinds of useful thing

Are these functions documented anywhere or are there examples?

0 Kudos

 

You should be using the resource called "Custom Query" for the code I pasted in.  I just mentioned the custom HTML as the example for if you need to do something that somehow can't be accomplished with the Custom Query or Custom Chart widgets.  

 

This thread is probably one of the oldest I know if where the _linkfor and _Iconfor syntaxes are mentioned, https://thwack.solarwinds.com/t5/SAM-Discussions/Link-on-a-Custom-Query-resource-SWQL/m-p/340156 all the way back in 2013.

Other potentially relevant links:

https://thwack.solarwinds.com/t5/Orion-SDK-Discussions/Having-problem-pulling-in-Node-Icon-and-Node-...

https://thwack.solarwinds.com/t5/NPM-Documents/Custom-SWQL-Views-Manager/ta-p/532869

https://thwack.solarwinds.com/t5/NPM-Discussions/NPM-Dashboard-Customisation/m-p/229530

- Marc Netterfield, Github