Hello! First time poster. I have what feels like a complicated ask (hopefully it's not and i'm overthinking it) and would like to gain insight or assistance coming up with the best way to go about this.
I work at a company with 1100+ sites. Each site should have multiple switches, firewalls, security panels, DVRs, etc. I am wanting to generate an alert or report that is able to validate that each site has the appropriate number of devices added. Ideally the alert/report would identify if a site only has 5 devices, when it should have 6 for example, then relay which site it found that at. All of our sites have custom properties tied to it such as StoreNumber, SiteType, DeviceType, etc.
I'm not 100% sure how to go about this, but here is what i've got so far:
SELECT Nodes.Caption
FROM Orion.Nodes
WHERE Nodes.CustomProperties.SiteType = 'Store' AND Caption LIKE '%' + Nodes.CustomProperties.StoreNumber + '%'
ORDER BY Caption
This returns all the device's that i'm interested in doing a comparison on. I'm not sure how to go about doing a check and/or grouping all the nodes by StoreNumber, then checking that x amount of devices exist per store number.
If it helps, all the devices do follow a standard naming scheme. All the switches will end in S01P, S02P, S03P, etc. All the Firewalls will end in F01P, F02P, etc. DVRs will all end with 'DVR.'
Any help is appreciated on this!