Forum Discussion
LyonsG_85618
Cirrostratus
Aug 25, 2011running BIGPIPE commands in an IRULE
Hi.
Does anyone know if it's possible to run BIGPIPE commands in an IRULE?
I would like to run 'b failover show' and then extract the response.
If the unit is in ACTIVE mode then the IRULE will continue (its doing HSL logging to a remote syslog server).
If the unit is in STANDBY mode the irule will end (no remote logging).
Many thanks.
6 Replies
- hoolio
Cirrostratus
Hi Graham,
iRules should only ever execute on an active unit, so I am not sure this is necessary. Are you seeing otherwise?
There isn't a way to run bigpipe commands from an iRule. I remember Unruley mentioning a bit of a hack you could use to determine the unit number from an iRule. I think this involved a shell script writing to a datagroup. If you wanted to get arbitrary, real time-ish data from a shell script, you could try this method.
Aaron - LyonsG_85618
Cirrostratus
Thanks for quick reply!
We ARE seeing IRULES being executed on the standby unit. We do have connection mirroing setup though so this may be why this is happening? - LyonsG_85618
Cirrostratus
"I remember Unruley mentioning a bit of a hack you could use to determine the unit number from an iRule. "
Do you know what this hack is? I am keen to find out as we are seeing duplicate log entries on a syslog server due to the irule being executed on the activ & standby BIG-IP's. - hoolio
Cirrostratus
Hi Graham,
The idea is that you'd run a bash or Perl script from cron on LTM which gets the failover status, writes the output to a file which is referenced in an external datagroup and then use iControl to force a reread of the datagroup contents. You could then access the datagroup from an iRule and check to see it returns active before calling HSL commands.
The external datagroup format is:
External Class Format:class namevalue { "name1" := "value", }
As you don't need a value, you could use:
class active_status_class {
"active",
}
For 10.2.x you can use 'bigpipe failover' or 'tmsh run /util bigpipe failover' to get the failover status. For 11.0.x you can use 'tmsh show /sys failover'
Here's a Perl iControl example from Joe for updating the datagroup:
http://devcentral.f5.com/wiki/iControl.PingExternalClass.ashx
Aaron - LyonsG_85618
Cirrostratus
Thanks for this - hoolio
Cirrostratus
It would make sense for us to have a default TCL variable that gives the HA status of the unit in an iRule. You could open an RFE case with Support to request this. If you do, could you reply back with the RFE ID so others can pile on?
Thanks, Aaron
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
