Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Icon for VMAN Datastore Name

$
0
0

Hello SWQL Ninjas!

 

I'm trying to identify where to pull the icon status from for VMware datastores within the VMAN product. For Nodes within Orion core this is found in the [Orion.Nodes].StatusIcon column, however, the same column does not exist within the [Orion.Vim.Datastores] table. 

 

I see the following options under [Orion.Vim.Datastores]:

     StatusDescription (Null values)

     StatusIconHint (Null values)

     StatusLED (Null values)

     Status (Int values)

Obviously, the first three columns are useless.  The "Status" column will require a lookup table and further logic via a case statement matching up the given value with the meaning and then linking that to the appropriate .gif file. I think I found a table that can be used in the Orion core db [Orion.StatusInfo]. 

 

Now for my questions...Is this the only option for pulling in the datastore icons or is there a better way?  If this is the only option, does anyone have the logic already before I dive in? I know Solarwinds is doing this in the backend somehow because when you hover on the datastore name (pulled from DetailsUrl) there is a status icon showing.

 

Related question, is there an ERD available for the Solarwinds Databases (including all products)? I found a thread from around 2014 that didn't look promising, I'm hoping four years has allowed for a better response.

 

Code included below for clarity - I'm just trying to get a view of datastores with low space that I can customize further down the road. Screenshot of query attached, the names are blocked out for obvious reasons.

SELECT d.Name, Type, Accessible as [Available],    CASE        WHEN (d.Capacity/1024/1024/1024/1024) > 1 THEN (TOSTRING(ROUND(d.Capacity/1024/1024/1024/1024,2))+ ' TB')        WHEN (d.Capacity/1024/1024/1024) > 1 THEN (TOSTRING(ROUND(d.Capacity/1024/1024/1024,2))+ ' GB')        WHEN (d.Capacity/1024/1024) > 1 THEN (TOSTRING(ROUND(d.Capacity/1024/1024,2))+ ' MB')    END AS [Datastore Size],    CASE         WHEN (d.FreeSpace/1024/1024/1024/1024) > 1 THEN (tostring(ROUND(d.FreeSpace/1024/1024/1024/1024,2))+ ' TB')        WHEN (d.FreeSpace/1024/1024/1024) > 1 THEN (TOSTRING(ROUND(d.FreeSpace/1024/1024/1024,2))+ ' GB')        WHEN (d.FreeSpace/1024/1024) > 1 THEN (TOSTRING(ROUND(d.FreeSpace/1024/1024,2))+ ' MB')    END AS [Free Space],    ROUND(d.SpaceUtilization,2) as [% Used],    CASE         WHEN (d.ProvisionedSpace/1024/1024/1024/1024) > 1 THEN (tostring(ROUND(d.ProvisionedSpace/1024/1024/1024/1024,2))+ ' TB')        WHEN (d.ProvisionedSpace/1024/1024/1024) > 1 THEN (TOSTRING(ROUND(d.ProvisionedSpace/1024/1024/1024,2))+ ' GB')        WHEN (d.ProvisionedSpace/1024/1024) > 1 THEN (TOSTRING(ROUND(d.ProvisionedSpace/1024/1024,2))+ ' MB')    END AS [Provisioned],    ROUND(d.ProvisionedSpaceAllocation,2) as [% Provisioned],    d.DetailsUrl AS [_linkfor_Name]
FROM Orion.Vim.Datastores AS d
--WHERE d.Name LIKE '%${SEARCH_STRING}%'
ORDER BY [% Used] DESC

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>