Query Client Counts per Network

boomi
Getting noticed

Query Client Counts per Network

I'd like to retrieve the the count of each type of client for a network during a time span -- e.g., how many VPN, wired, and wireless.

 

Is the correct way to do so (currently, in the v0 API) to use:

 

 /networks/{networkId}/clients

 

 

Then parse through them and count:

 

 

if switchport
  wired user
elif ssid
  wireless user
else
  vpn user

 

 

I don't know if this will deterministically identify these "types" of users though. 

6 Replies 6
BrechtSchamp
Kind of a big deal

Do you have any MXs that have clients connected directly to them either wired or wireless? Because those may also need to be considered then.

 

If I were you I'd experiment a bit to observe the behavior.

boomi
Getting noticed

Fortunately I'd never have enough for it to ever meaningfully skew the data, good point though!
Nash
Kind of a big deal

You'll need to do a rummage in the JSON return, but something roughly like that should work. VPN users look to have an SSID of null (obviously), and a vlan of 0.

boomi
Getting noticed

Yep, I've been getting used to just looking at output over and over until I find exceptions 🙂
Nash
Kind of a big deal


@boomi wrote:
Yep, I've been getting used to just looking at output over and over until I find exceptions 🙂

I would laugh except then I'd start crying because yes, this is in fact my life when writing stuff. Find my client who is the most X, then look at the outputs for that until I start finding the weird stuff.

 

I'd joke that I dream about parsing JSON with Python sometimes except, you know, I actually do. I guess I'm a real programmer now, huh?

boomi
Getting noticed

I definitely know the feeling!

Really hoping that as v1 gets developed this becomes less of an issue. It looks like that's happening, based on the layout of the new web page. I'm assuming the "schema definition" section will list out all potential field values.
Get notified when there are additional replies to this discussion.