Forum Discussion
Jon_Bartlett_10
Aug 11, 2006Historic F5 Account
Current Connections v9.x
Can you give a detailed example of how to get the current global connections for a node in perl? So not pool specific.
Thanks!!
Jon
6 Replies
- I take your "current global connections for a node" to mean the connection metrics for a Node Address:
If this is the case, the SDK has a sample that displays all statistics for a node address.
sdk\samples\soap\perl\soaplite\LocalLB\LocalLBNodeAddress.pl
-Joe - Jon_Bartlett_10Historic F5 AccountYep - I looked through the sdk and searched devcentral before I posted. In the example from the sdk, I do not see current connections, just high and low ~ maybe I just don't see it. I saw some examples for 4.5 and in C but I am not sure how to apply these for version 9.2.3 in perl.
We have created an iControl app to allow our Windows Admins and Ops teams to remove nodes from pools during maintenance windows. We would like to give them the ability to see the current connections as well so they can wait for the connections to completely drain before starting their server maintenance.
Thanks for the quick reply! - Did you run the sample against your device and look at the output? Here's what I just got from running the sample:
NODE 10.10.10.149 Session Status : SESSION_STATUS_ENABLED Enabled State : STATE_ENABLED Monitor Status : MONITOR_STATUS_UNCHECKED Availability : AVAILABILITY_STATUS_BLUE Connection Limit : 0 Ratio : 1 Statistics : STATISTIC_SERVER_SIDE_BYTES_IN : 2812080 STATISTIC_SERVER_SIDE_BYTES_OUT : 23441694 STATISTIC_SERVER_SIDE_PACKETS_IN : 34505 STATISTIC_SERVER_SIDE_PACKETS_OUT : 40234 STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS : 10 STATISTIC_SERVER_SIDE_MAXIMUM_CONNECTIONS : 12 STATISTIC_SERVER_SIDE_TOTAL_CONNECTIONS : 5760 ...
The current connections are presented in the STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS statistic.
-Joe - Amrit_Lalli_952
Nimbostratus
(note i am using php)
Did the reply answer this question?
I also see high, and low ?
If you look at the image i supplied, this is all information i am getting via soap.
Until i figure out which i should be using, I am showing only the 'low' value, if the high value == null or '0' or ''.
otherwise, I am showing (high)low
So are we supposed to be taking the 'low' value for all of these?
Also, if you look at the bytes out column in my attached file,
the 'high' value == 37
the 'low' value == -1816712694
Is that because of signed integer / unsigned integer differences ? (if so, how do i convert that number to the actual number of an unsigned integer? -- or is it some other reason why its negative. Also is the high value some type of multiplier?)
Thanks. - The statistics are returned as 64 bit numbers. Since the type encoding on SOAP doesn't support 64 bit numbers, we had to create a structure with the low and high 32 bit values in the resulting 64 bit number.
To calculate the 64 bit number you'll have to do something like this((64bittype)value.high<<32)|(64bittype)value.low;
Where "64bittype" is the appropriate 64 bit type for you given langauge.
Examples:C: ulong value64 = ((ulong)value.high<<32)|(ulong)value.low; Perl: $value64 = Math::BigInt->new(Math::BigInt->new($high)->blsft(32))->bxor($low);
I can't help you out with PHP.
Oh, and yes, the negative values is probably due to the fact that you are displaying a signed value where our stats are all unsigned.
-Joe - Amrit_Lalli_952
Nimbostratus
Ah!, I understand now.
thanks for the quick reply!
Amrit
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects