Forum Discussion
Identifying the LTM node a vserver runs on in an iRule
I have a cluster of two active/active LTMs from which I'd like to pull some stats from (which I generate with an iRule). The iRule is applied to two virtual servers, normally one of them runs on one LTM, and the other VS on the other LTM. However, in the case of a failure, both virtual servers will run on the same LTM node, so if I grab the stats from both virtual servers then, I will actually be double counting everything. I'd like to avoid that.
So what I was thinking was to have the stats generating iRule output some marker that identified the LTM node it was running from. For example by printing its hostname. Then, in the stats gathering system, I could then simply discard any counters that would have a duplicate marker value.
However I haven't been able to find any variable or function that will allow me to identify the LTM node executing the iRule so far. Is there any such thing, or any other solution to my problem?
2 Replies
- hoolio
Cirrostratus
Hi Tore,
[info hostname] will return the LTM hostname. Or in v11 you can also use $static::tcl_platform(machine).
Aaron - Tore_Anderson_9
Nimbostratus
Thank you! Both work just fine.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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