cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query Client Counts per Network

Highlighted
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
Highlighted
Kind of a big deal

Re: Query Client Counts per Network

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.

Kind of a big deal

Re: Query Client Counts per Network

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.

Highlighted
Getting noticed

Re: Query Client Counts per Network

Fortunately I'd never have enough for it to ever meaningfully skew the data, good point though!
Highlighted
Getting noticed

Re: Query Client Counts per Network

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

Re: Query Client Counts per Network


@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?

Highlighted
Getting noticed

Re: Query Client Counts per Network

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.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.