F5Networks / f5-common-python

Python SDK for configuration and monitoring of F5® BIG-IP® devices via the iControl® REST API.
https://f5-sdk.readthedocs.org
Apache License 2.0
262 stars 133 forks source link

Close the connection after execution #1538

Open selvam33 opened 5 years ago

selvam33 commented 5 years ago

I have logged into the F5 and ran my script, but how to make sure the connection closed or not after script ran. I dont see anything like session.close . please advise, thanks !!!

kisbam commented 4 years ago

Hi, I had the same concerns. After testing a script, I noticed that after opening a bigip session and making some calls (display VS) if nothing happens afterwards (user input), the websocket disconnect after 60s of inactivity. Here are the logs on the F5: [admin@f5:Active:Changes Pending] ~ # netstat -na | grep 192.168.1.1 tcp 0 0 ::ffff:10.10.10.10:443 ::ffff:192.168.1.1:59018 ESTABLISHED tcp 0 52 ::ffff:10.10.10.10:22 ::ffff:192.168.1.1:58727 ESTABLISHED [admin@f5:Active:Changes Pending] ~ # netstat -na | grep 192.168.1.1 tcp 0 0 ::ffff:10.10.10.10:443 ::ffff:192.168.1.1:59018 FIN_WAIT2 tcp 0 52 ::ffff:10.10.10.10:22 ::ffff:192.168.1.1:58727 ESTABLISHED [admin@f5:Active:Changes Pending] ~ # netstat -na | grep 192.168.1.1 tcp 0 52 ::ffff:10.10.10.10:22 ::ffff:192.168.1.1:58727 ESTABLISHED [admin@f5:Active:Changes Pending] ~ # /sbin/sysctl net.ipv4.tcp_fin_timeout net.ipv4.tcp_fin_timeout = 60

Hope it helps.

Len4i commented 3 years ago

bump It's kinda strange for security device not to have a way to explicitly close mgmt session

Aitor13 commented 1 year ago

I have the same problem. When i change the f5 devices on runtime, i see connections to the previous devices. Anyone knows how i can close the previous session?