Forum Discussion

LoyalSoldier's avatar
LoyalSoldier
Icon for Altostratus rankAltostratus
Apr 12, 2017

TMSH Command in iRules

Hello,

 

I'm trying to figure out a way to run a tmsh show command from an iRule. Have tried learning about iCall and iControl, but getting lost on those as to the process to incorporate into an iRule, if even possible. The purpose is to pull some stats for an HTML page (see https://devcentral.f5.com/codeshare/pool-member-status-html5-page-1035).

 

Example of commands:

 

  • show ltm virtual | grep -e 'Ltm|Availability|State|Reason|Destination|Traffic|Bits|Packets|Connections|Conn|CPU|Last'
  • show ltm pool | grep -e 'Ltm|Availability|State|Reason|Current Active|Traffic|Bits|Packets|Connections'

Can anyone provide guidance on a solution to this?

 

2 Replies

  • There is not provision to call tmsh command from irule in v11.x. Other option is to run command via iCall and iControl.

     

    • LoyalSoldier's avatar
      LoyalSoldier
      Icon for Altostratus rankAltostratus

      Have tried figuring out how to do that with iCall or iControl, but lost on how to implement it. Can you advise on the process?

       

      Thanks