Get a Count of Data Sources Per NetApp OCI Server

 If you've got multiple NetApp OnCommand Insight servers and you want to get a count of datasources per OCI server, this simple SQL query will do the trick:

SELECT count(*) AS 'Data Sources',au.siteName AS 'OCI Server'
FROM dwh_inventory.acq_data_source AS ds
JOIN acq_acquisition_unit AS au ON au.id = ds.acquisitionUnitId
GROUP BY au.siteName ORDER BY 1 DESC;

If you want to just count the NetApp Clustered ONTAP datasources for instance, you'd add the following lines before the 'GROUP BY':

WHERE ds.type = 'NetApp'
AND ds.model LIKE '%Clustered%'

Along the same lines, a query to get the datasource 'Additional DataSource Message' which will tell you whether the datasource is working, configured for 'inventory only', etcetera, is this one:

SELECT au.siteName,ds.name,ds.type,ds.model,ds.additionalDataSourceMessage
FROM dwh_inventory.acq_data_source AS ds
JOIN dwh_inventory.acq_acquisition_unit AS au ON au.id = ds.acquisitionUnitId




Comments