Forum Discussion
How to reset pool statistics using Python API?
I am trying to duplicate the functionality that exists in the GUI of the "Reset" button that exists on the pool statistics page to clear the stats of all members in the current pool. I am able to GET these stats with Python, but cannot figure out how to reset stats such as serverside.bitsIn and serverside.bitsOut. Does anyone have any examples of how this can be accomplished?
- JRahmAdmin
We need to add the ability to reset stats in the SDK, which as Jason indicated is being tracked in issue 1454, but natively via rest you can do this like this for now:
POST /mgmt/tm/ltm/pool {"command": "reset-stats", "name": "testpool"}
It doesn't appear that this was actually implemented although it was discussed when stats support was added:
https://github.com/F5Networks/f5-common-python/issues/293
I suggest opening an RFE for this on GitHub.
The stats class is read-only, unfortunately:
- Tim_HarberCirrus
Thanks a lot for doing that. I assumed there wasn't a reset function, but I was hoping as a workaround I could individually set each value to 0, but I haven't been able to figure out how to do it.
I went ahead and opened this RFE as I had the related info handy:
https://github.com/F5Networks/f5-common-python/issues/1454
- Jason_NanceNimbostratus
It doesn't appear that this was actually implemented although it was discussed when stats support was added:
https://github.com/F5Networks/f5-common-python/issues/293
I suggest opening an RFE for this on GitHub.
- Jason_NanceNimbostratus
The stats class is read-only, unfortunately:
- Tim_HarberCirrus
Thanks a lot for doing that. I assumed there wasn't a reset function, but I was hoping as a workaround I could individually set each value to 0, but I haven't been able to figure out how to do it.
- Jason_NanceNimbostratus
I went ahead and opened this RFE as I had the related info handy:
https://github.com/F5Networks/f5-common-python/issues/1454
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com