cancel
Showing results for 
Search instead for 
Did you mean: 

BigIQ example to get pool member counts vi API

simon_tipper
Nimbostratus
Nimbostratus

using this doc https://clouddocs.f5.com/products/big-iq/mgmt-api/v7.1.0/ApiReferences/bigiq_public_api_ref/entity_catalog/bigip-pool-members.html?highlight=pool. Looking for real world examples as mine always returns a "0" count. Any help would be appreciated

 

request body is

{

  "kind": "ap:query:stats:byTime",

  "module": "bigip-pool-members",

  "timeRange": {

      "from": "-1h",

      "to": "now"

  },

  "timeGranularity": {

      "duration": 30,

      "unit": "SECONDS"

  },

  "aggregations": {

      "server-concurrent-connections$avg-value-per-sec": {

          "metricSet": "server-concurrent-connections",

          "metric": "avg-value-per-sec"

      }

  },

  "dimensionFilter": {

      "type": "eq",

      "dimension": "uk-lbr01.ptns.com",

      "value": "tde.test-pool.com_80"

  }

}

 

which appears to work but return values of 0 when pool and pool members have multiple connections on them

 

{

  "result": {

    "source": "bigip",

    "module": "bigip-pool-members",

    "timeRange": {

      "from": "1600261710000",

      "to": "1600265280000",

      "timezone": "Etc/Zulu",

      "durationInMillis": 3570000,

      "durationInSec": 3570

    },

    "timeGranularity": {

      "duration": 30,

      "unit": "SECONDS"

    },

    "result": [

      {

        "timeMillis": 1600261740000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261770000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261800000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261830000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261860000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261890000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261920000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261950000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600261980000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600262010000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

      {

        "timeMillis": 1600262040000,

        "count": 0,

        "server-concurrent-connections$avg-value-per-sec": 0

      },

 

................output chopped to save space

1 REPLY 1

simon_tipper
Nimbostratus
Nimbostratus

Found my own anwser here

https://clouddocs.f5.com/products/big-iq/mgmt-api/v7.1.0/ApiReferences/bigiq_public_api_ref/r_analytics_metric_query.html

 

Virtual Server Connection Count, Pool Connection Count, Pool Member Connection Count

 

Virtual Server Count

 

{

  "kind": "ap:query:stats:byTime",

  "source": "bigip",

  "module": "http",  

  "timeRange": {

      "from": "-1h",

      "to": "now"

  },

  "timeGranularity": {

      "duration": 30,

      "unit": "SECONDS"

  },

  "aggregations": {

      "transactions$avg-count-per-sec": {

          "metricSet": "transactions",

          "metric": "avg-count-per-sec"

      },

      "transaction-request-size$avg-value-per-sec": {

          "metricSet": "transaction-request-size",

          "metric": "avg-value-per-sec"

      },

      "transaction-response-size$avg-value-per-sec": {

          "metricSet": "transaction-response-size",

          "metric": "avg-value-per-sec"

      }

  },

  "dimensionFilter": {

    "type": "and",

    "args": [{

      "type": "eq",

      "dimension": "hostname",  

      "value": "uk-lbr01.test.com"

  },

  {

  "type": "eq",

  "dimension": "virtual",  

  "value": "/Common/test.pool.com_443"

  }

  ]

 }

}

 

Pool Connection Count

{

  "kind": "ap:query:stats:byTime",

  "source": "bigip",

  "module": "bigip-pool-members", 

  "timeRange": {

      "from": "-1h",

      "to": "now"

  },

  "timeGranularity": {

      "duration": 30,

      "unit": "SECONDS"

  },

  "aggregations": {

      "server-concurrent-connections$avg-value-per-sec": {

          "metricSet": "server-concurrent-connections",

          "metric": "avg-value-per-sec"

      }

  },

  "dimensionFilter": {

    "type": "and",

    "args": [{

      "type": "eq",

      "dimension": "hostname", 

      "value": "uk-lbr01.testcom"

  },

  {

  "type": "eq",

  "dimension": "pool-name", 

  "value": "/Common/test.pool.com_80"

  }

  ]

 }

}

 

 

Pool Member Count

 

{

  "kind": "ap:query:stats:byTime",

  "source": "bigip",

  "module": "bigip-pool-members",

  "timeRange": {

      "from": "-1h",

      "to": "now"

  },

  "timeGranularity": {

      "duration": 30,

      "unit": "SECONDS"

  },

  "aggregations": {

      "server-concurrent-connections$avg-value-per-sec": {

          "metricSet": "server-concurrent-connections",

          "metric": "avg-value-per-sec"

      }

  },

  "dimensionFilter": {

    "type": "and",

    "args": [{

      "type": "eq",

      "dimension": "hostname",

      "value": "uk-lbr01.test.com"

  },

  {

  "type": "eq",

  "dimension": "pool-name",

  "value": "/Common/test.pool.com_80"

  },

    {

  "type": "eq",

  "dimension": "pool-member",

  "value": "10.1.2.3:80"

  }

  ]

 }

}