cancel
Showing results for 
Search instead for 
Did you mean: 

XMC NBI endstations by network CIDR

XMC NBI endstations by network CIDR

wew
New Contributor

Is there a optimal way of querying the NBI to find endStation data under a network CIDR?  I can successfully query individual addresses with the query below so expect I could iterate through each IP address inside the CIDR but that seems inefficient.  Can the NBI take inputs somehow with an actual CIDR or worst case, string wildcards?  So far I haven't found anything in documentation for a non-iterative way.

I am primarily interested in mac and last seen data.  Example query for a single IP (i.e. 192.168.10.100) that I am trying to implment over a whole CIDR (i.e. 192.168.10.0/24).

query = {
accessControl {
  endSystemByIp(ipAddress: "192.168.10.100") {
    endSystem {
    macAddress
    ipAddress
    operatingSystemName
    hostName
    lastSeenTime
    }
  }
}
}

1 ACCEPTED SOLUTION

OscarK
Extreme Employee

The NBI is meant for scripting so the idea here is to get all end systems and iterate over that using a script. I dont see an option to filter based on a subnet.

View solution in original post

2 REPLIES 2

OscarK
Extreme Employee

The NBI is meant for scripting so the idea here is to get all end systems and iterate over that using a script. I dont see an option to filter based on a subnet.

wew
New Contributor

Thanks for the response, and verifying I didn't just miss a CIDR filter option.  I had looked at getting all end systems and processing them in my code but we have around 125k end systems currently (school is out at the moment so that is low).  Doing a big batch get with paging overhead then getting it down to a subset of ~512 or smaller endpoints seemed just as inefficient as calling each IP address directly.  I wish there was an option to make a CIDR or at the very least wildcard address query happen.

GTM-P2G8KFN