Python Report fo Users- HELP!

MauroF
Building a reputation

Python Report fo Users- HELP!

Hi, im doing a script to create a daily report stating who was connected in the last 24 hours and when it was the last time they got disconnected from the network (wired and wireless).

 

An example of what i created.

networkNameuserId                       description    mac    ipV4     usage     clientType    lastSeen(UTC+2) 
Cincinnatifrank.zappa@rock.comZU103CSCdd:c6:af:21:e1:97192.168.17.20882.786 MBWired8/29/2024 23:07

 

There is one big issue thou. The lastSeen section is not true. The client left at 16:48 but ,dont know why Dashboard shows that.

The part that show the real disconnession thou is going to the switch,under the interface configuration.

 

MauroF_0-1725005091710.png

Im trying to understand what python code i should script to get that info. Im not using Meraki library. Any Help?

3 Replies 3
MauroF
Building a reputation

Part of my script:

 

MauroF_0-1725005368781.png

 

PhilipDAth
Kind of a big deal
Kind of a big deal

I'm guessing you are using something like getNetworkClients, which reports "disconnection" based on the "last traffic seen" by the client (actually I think it might be last traffic + 15 mins or 30 mins).  If you use this approach, you should label the report "Last traffic seen".

 

If you wanted to take it a step further you could need to look at what they were attached to in the network, and then see when they disconnected from that (such as a switch port going down).

MauroF
Building a reputation

i dont use Meraki library.so i didnt user getNetworkClients thing

Get notified when there are additional replies to this discussion.