-
How would i do the following. I want to get a list of sites where there is or is not a specific type of switch installed. I know i can filter on the device type and then export the list and get the site names where it does exist quite simple, but i also want the list of sites where it does not exist So i would like to write an export template that says the logic below. Ie loop through all the devices in a site and determining if any of them are the device in question and if so add the word True or False to a column. it does not matter if there are 1 or 100 devices of the type at a site, just want to really know what sites don't have them. How do i nest loops and create a query set of child groups, in this case loop through all the devices assigned to the given site. {% for site in queryset %} As a side point would it ever be possible to have a custom field populated by a regex or Jinia Query? In this case i want to know all sites that have SD WAN hardware (or not). When we are deploying new AP model for example to be able to at a site level see what has been completed and what has not. Or when we are migrating ISP's. With many ongoing projects being able to place a custom field at the site level can be very useful for quickly seeing what has been done or is left to do. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Something like (untested):
(There is no need to iterate over site.devices in a for loop; you just want the single answer) Here's an example of a working filter I use in a custom link, for checking whether a device has exactly one management-only interface with exactly one IP address:
|
Beta Was this translation helpful? Give feedback.
Something like (untested):
(There is no need to iterate over site.devices in a for loop; you just want the single answer)
Here's an example of a working filter I use in a custom link, for checking whether a device has exactly one management-only interface with exactly one IP address: