Forum Discussion

Bmccli_180167's avatar
Bmccli_180167
Icon for Nimbostratus rankNimbostratus
Jun 26, 2015

User iControl Rest to retreive iRule Stats

I am currently using iControl to retrieve iRule statistics like number of execututions and CPU Cycles. My goal is to switch to iControl REST to retrieve the same information without the overhead of iControl. Most modules within the REST api allow for /stats to be placed at the end of the URL which return module stats. Here are some working examples:

 

  curl -k https://f5.somewhere.com/mgmt/tm/ltm/virtual/myvip.somewhere.com/stats
  curl -k https://f5.somewhere.com/mgmt/tm/ltm/pool/myvip-pool/stats

But, for iRules, I am unable to retrieve the stats using the following command:

 

  curl -k https://f5.somewhere.com/mgmt/tm/ltm/rule/~Common~myirule/stats

In response, I get:

 

 {"code":404,"message":"Object not found - /Common/myirule","errorStack":[]}

F5 Version: 11.5.3.

 

What am I doing wrong?

 

Brent

 

1 Reply

  • I have 11.6.0 HF4 and it's working fine (for a simple irule.. result below). Which eventType do you have in your iRule?

    {
        "entries": {
            "aborts": {
                "value": 0
            },
            "avgCycles": {
                "value": 0
            },
            "eventType": {
                "description": "ACCESS_POLICY_AGENT_EVENT"
            },
            "failures": {
                "value": 0
            },
            "maxCycles": {
                "value": 0
            },
            "minCycles": {
                "value": 0
            },
            "priority": {
                "value": 500
            },
            "tmName": {
                "description": "/Common/masked___"
            },
            "totalExecutions": {
                "value": 0
            }
        },
        "generation": 1,