Forum Discussion
Mikoto_Misaka_1
Nimbostratus
Mar 15, 2006VIP's Current Connection
Hello,
I would like to log the number of VIP's current Connection.
So, Is there the variable of VIP's current Connection on iRule ?
For example,
when a VIP's current connection reaches at 100, BIG-IP logs it,then sends snmp trap or syslog.
However it's alert only. Not connection limmit for VIP, BIG-IP have to accept 100 over request.
when HTTP_REQUEST {
if { [Current::Conn] > 100 }{
log "The current connection reached at 100."
}
}
Is threre a varialble as "[Current::Conn]" ?
Reagards,
Mark
- Deb_Allen_18Historic F5 AccountThere are currently no statistics available to perform this function directly within a rule.
- JRahm
Admin
Try this:when CLIENT_CONNECTED { set curr_conns 0 incr curr_conns if ( $curr_conns >= 100) { log "Total Connections = $curr_conns" } } when CLIENT_CLOSED { incr curr_conns -1 }
- JRahm
Admin
actually, try this:when RULE_INIT { set curr_conns 0 } when CLIENT_CONNECTED { incr curr_conns if ( $curr_conns >= 100) { log "Total Connections = $curr_conns" } } when CLIENT_CLOSED { incr curr_conns -1 }
- unRuleY_95363Historic F5 AccountYou probably want that variable to be global... Add :: to the front of it...
- JRahm
Admin
Doing this will cause a log entry for every new connection while total connections is 100 or more. This is probably not desirable. You might want to include some additional logic to only log total connections once a minute while connections are 100 or more:when RULE_INIT { set ::curr_conns 0 } when CLIENT_ACCEPTED { incr curr_conns if { $::curr_conns > 99 } { if { [clock format [clock seconds] -format {%S}] equals "00" } { log "Total Connections = $::curr_conns" } } } when CLIENT_CLOSED { incr ::curr_conns -1 }
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