Security

Reply
Contributor II

Sending COA via ClearPass API

I was trying to us the sample code on github, but I keep getting an empty set when try to search for the active sessions (even though the count value returned is 151).

I pulled out the code into my script, and can reproduce the issue

Here is the Request I'm sending:

https://clrpass-e-1-m.its.uiowa.edu:443/api/session?filter={"mac_address":"20ab375a1c4f"}&sort=-id&offset=0&limit=1&calculate_count=true

Here is the json I'm receiving:

{
    "count":151,
    "_links":{
        "self":{
            "href":"https://clrpass-e-1-m.its.uiowa.edu/api/session?calculate_count=true&offset=0&limit=1&sort=-id&filter=%7B%22mac_address%22%3A%2220ab375a1c4f%22%7D"
        },
        "first":{
            "href":"https://clrpass-e-1-m.its.uiowa.edu/api/session?calculate_count=true&offset=0&limit=1&sort=-id&filter=%7B%22mac_address%22%3A%2220ab375a1c4f%22%7D"
        },
        "next":{
            "href":"https://clrpass-e-1-m.its.uiowa.edu/api/session?calculate_count=true&offset=1&limit=1&sort=-id&filter=%7B%22mac_address%22%3A%2220ab375a1c4f%22%7D"
        },
        "last":{
            "href":"https://clrpass-e-1-m.its.uiowa.edu/api/session?calculate_count=true&offset=150&limit=1&sort=-id&filter=%7B%22mac_address%22%3A%2220ab375a1c4f%22%7D"
        }
    },
    "_embedded":{
        "items":[]
    }
}

As you can see the items array is empty, even though the count calcuated is 151.

 

I'm sure I'm missing something obvious, but I can't figure it out.

 

Thanks!

 

-Neil

 

--
Neil Johnson
Guru Elite

Re: Sending COA via ClearPass API

If you remove the filter query, do results get returned?

Tim Cappalli | Aruba Security
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Contributor II

Re: Sending COA via ClearPass API

It's a production network with +10K clients. When I try it without the filter, it appears the API hangs.

 

In addition, I get the same results  using the API explorer.

 

Thanks.

-Neil

 

--
Neil Johnson
Contributor II

Re: Sending COA via ClearPass API

Do I need Interim accounting enabled?

 

--
Neil Johnson
Guru Elite

Re: Sending COA via ClearPass API

No. If you're seeing the sessions in the GUI under Active Sessions, the same data is available via the API. I would work with TAC to debug.

Tim Cappalli | Aruba Security
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Contributor II

Re: Sending COA via ClearPass API

Case open. Thanks for your help!

 

--
Neil Johnson
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: