Polled Data

Attributes

id (read-only) Unique ID for the polled data item in our system.
name (read-only) The name for this polled data item.
server_id (read-only) The ID of the server this item is running on.
server_hostname (read-only) The hostname of the server this item is running on.
command_name (read-only) The command name of the server this item is running on.
command_line (read-only) The command line of the server this item is running on.
alert_id (read-only) The ID of the alert on this item.
url (read-only) The url to get more information about this item.

Available APIs

/api/polled-data/

Lists all available polled data items. See above for the attributes each item has.

GET

Returns the list of polled data items.

Arguments

  • limit (optional, default:2500, max:2500) – Sets the page size to a limit set by the user.
  • page (optional, default:0) – Retrieve the specific page of data of size limit.

Argument Examples

  • limit=10 – will get the first page of the first 10 items.
  • limit=25&page=3 – will get the 4th page of size 25 items.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/polled-data/
{
    "pagination": {
        "count": 1740, 
        "next": null, 
        "previous": null
    }, 
    "data": [
        {
            "id": 67768, 
            "name": "metric.gauge.Hbase.load0.hbr0.regions", 
            "server_id": 255832, 
            "server_hostname": "load0-hbregion0", 
            "command_name": "HBase,name=RegionServer,sub=Server", 
            "command_line": "HBase,name=RegionServer,sub=Server -A regionCount", 
            "alert_id": [
                189333
            ], 
            "url": "/api/v5/polled_data/67768/"
        }, 
        {
            "id": 67766, 
            "name": "metric.gauge.Hbase.load0.hbr0.writeRequestCount", 
            "server_id": 255832, 
            "server_hostname": "load0-hbregion0", 
            "command_name": "HBase,name=RegionServer,sub=Server", 
            "command_line": "HBase,name=RegionServer,sub=Server -A writeRequestCount", 
            "alert_id": [
                189331
            ], 
            "url": "/api/v5/polled_data/67766/"
        }, 
    ]
}

/api/polled-data/{polled_data_id}/

View a polled data item.

GET

Get info about a specific polled data item, given by the polled_data_id in the URL. It takes no additional parameters.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/polled-data/1/
{
    "id": 67768, 
    "name": "metric.gauge.Hbase.load0.hbr0.regions", 
    "server_id": 255832, 
    "server_hostname": "load0-hbregion0", 
    "command_name": "HBase,name=RegionServer,sub=Server", 
    "command_line": "HBase,name=RegionServer,sub=Server -A regionCount", 
    "alert_id": [
        189333
    ], 
    "url": "/api/v5/polled_data/67768/"
}

/api/polled-data/{polled_data_id}/data/

Retrieves data for the given polled data item. Each piece of polled data data may have the following attributes (if some data isn’t given it means the values don’t exist for this polled data script for that minute):

time The minute this data is for.
status The status of this item, one of: OK, WARNING, CRITICAL, UNKNOWN.
text The text string of the data.
values A dictionary mapping parameter names to an array with 4 items:

  • The parameter name.
  • A dictionary of mapping “val” to its value for Minute data. For Hour or Day data, we don’t know how to combine the Minutes together, so we provide values for “avg”, “sum”, “max” and “min” in this dictionary.
  • The units of these values. If the unit is given by the script. If the script doesn’t specify a unit, we use “d” (meaning digits).
  • Optional dictionary containing optional values if it’s a Nagios script:
    warn Threshold for WARNING.
    crit Threshold for CRITICAL.
    min Minimum value possible.
    max Maximum value possible

GET

Gets data for the given polled data item. It gets up to “num” points starting from “end” and going back to “start.” Because the polling interval is usually longer than 1 minute, this data has lots of holes. The default interval is 5 minutes. So to get two points of data, by default, you would need to pass num=6, so it would retrieve the last point and the one 5 minutes before that one.

Arguments

  • num (optional, default:1) – Retrieve up to this many number of points. Note that there can be gaps in the data if the server this process is on has an outage.
  • end (optional, default:most recent point) – Retrieve data from this timestamp backwards. If not given, it gets the most recent data.
  • start (optional) – Don’t retrieve any points before this date, if given. From V3, If both start and num are given, end will be assigned to start + time_step_in_epoch (default to be 60) * num.
  • time_step (optional, default:Minute) – Time step for the points, can only be ‘Minute’.

Argument Examples

  • num=3 – will get the three most recent minutes of data.
  • num=1440&start=<12:00am today> – will get all of today’s data (which will probably be less than 1440 points).
  • num=3&end=1288584000 – will get the three minutes of data just before Nov. 11, 2010 UTC (which is 1288584000). If all the data exists, this will be 1288584000, 1288583940, and 1288583880. If the middle minute of data didn’t exist it would return 1288584000 and 1288583880.
  • num=30&end=1288584000&start=1288583940 – will get 2 minutes of data (if they exist) from 1288584000 and 1288583940.
  • num=3&time_step=Minute – will get the three most recent hours of data.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/polled-data/1/data/?num=2
{
    "pagination": {
        "count": 1, 
        "previous": null, 
        "next": null
    }, 
    "data": [
        {
            "status": "OK", 
            "text": "metric.gauge.Hbase.load0.hbr0.regions OK | val=72", 
            "values": {
                "val": [
                    "val", 
                    {
                        "val": 72
                    }, 
                    "d"
                ]
            }, 
            "time": 1410559800
        }
    ]
}