CPUStats Central Portal API

From Wiki

Jump to: navigation, search

CPUStats Central Portal API

Contents

API URL

http://portal-hostname-or-ip/~1h/portal/cpustats.pl

If you have configured a separate hostname for the portal, you can skip the /~1h.

Basic options

Daily CPU Stats

Output the Data for the Graphs

Request

Default parameters:

txt		1
service 	0
start		0
limit		4
min_count	0
min_real	0
min_user	0
max_count	1000000
max_real	1000000
max_user	1000000

You can change the service to limit the output only for a particular service.

Response

You are receiving a JSON encoded servers array of arrays. It looks like this:

{
  "servers" : [
     {
        "dname" : "ns32.example.com",
        "data" : [
           {
              "hour" : "12:00",
              "count" : "21183",
              "sys" : "1987.71",
              "user" : "7264.18",
              "real" : "13225.21"
           },
           {
              "hour" : "13:00",
              "count" : "22254",
              "sys" : "1931.45",
              "user" : "7831.38",
              "real" : "13497.53"
           },
           ..... 24 entries like these ......
           {
              "hour" : "12:00",
              "count" : "21050",
              "sys" : "2211.01",
              "user" : "6566.49",
              "real" : "10577.82"
           }
        ],
        "hname" : "ns32.example.com"
     },
     {
        "dname" : "cl43.example.com",
        "data" : [
           {
              "hour" : "11:00",
              "count" : "130",
              "sys" : "16.4",
              "user" : "49.37",
              "real" : "3130.03"
           },
           {
              "hour" : "10:00",
              "count" : "18504",
              "sys" : "2411.56",
              "user" : "6053.66",
              "real" : "13712.35"
           }
        ],
        "hname" : "1h.cl43.example.com"
     },

The number of received server arrays depends on the value of the limit argument.

dname - Display name
hname - Host name
hour - The hour for which the following count, sys, user and real stats are collected
count - The total executions during this hour
sys - The total system time used during this hour
user - The total user time used during this hour
real - The total real time used during this hour

Daily User Stats

Output the Data for the Graphs

Request

Default parameters:

txt		3
service 	0
start		0
limit		4
min_count	0
min_real	0
min_user	0
max_count	1000000
max_real	1000000
max_user	1000000

You can change the service to to limit the output only for particular service.

Response

You are receiving a JSON encoded servers array of arrays. It contains the top 25 users from each server and looks like this:

{
  "servers" : [
     {
        "dname" : "ns32.example.com",
        "data" : [
           {
              "count" : "72913",
              "sys" : "10048.1",
              "real" : "175831.23",
              "username" : "revist13"
           },
           ..... 25 entries like these ......
           {
              "count" : "4564",
              "sys" : "278.6",
              "real" : "2487.72",
              "username" : "milagro1"
           }
        ],
        "hname" : "ns32.example.com"
     },
     {
        "dname" : "cl01.example.com",
        "data" : [
           {
              "count" : "59456",
              "sys" : "11760.97",
              "real" : "32789.73",
              "username" : "laregion"
           },
           ..... 25 entries like these ......            
           {
              "count" : "46218",
              "sys" : "1229.1",
              "real" : "25919.76",
              "username" : "fix1tco"
           }
        ],
        "hname" : "1h.cl01.example.com"
     },

The number of received server arrays depends on the value of the limit argument.

dname - Display name
hname - Host name
count - The total executions for this user for the last 24 hours
sys - The total system time used by this user for the last 24 hours
real - The total real time used by this user for the last 24 hours
username - The username on the local server
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox