CPUStats Local Interface API

From Wiki

Jump to: navigation, search


CPUStats Central Portal API

Contents

API URL

http://server's-hostname-or-ip/~1h/cpustats/cpustats.pl


Basic options

Daily Server Stats

Request

Default parameters:

txt        1
split      0
srvc       0
interval   1

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

Response

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

[ 
 ["2011-03-16 04:00:00","107.05","18.65","25.09","190","0.56"],
 ["2011-03-16 03:00:00","3811.87","172.37","67.91","252","15.13"],
 ............... 24 lines like these ................
 ["2011-03-15 06:00:00","107.47","18.25","26.38","188","0.57"],
 ["2011-03-15 05:00:00","10.17","6.93","3.20","15","0.68"]
]

Each line of the array represents the stats for a single hour.

Weekly Server Stats

Request

Default parameters:

txt        1
split      0
srvc       0
interval   7

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

Response

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

[
 ["2011-03-16 05:00:00","0.80","0.00","0.00","1","0.8"],
 ["2011-03-16 04:00:00","107.05","18.65","25.09","190","0.56"],
 ["2011-03-16 03:00:00","3811.87","172.37","67.91","252","15.13"],
 ...... 168 lines line these .....
 ["2011-03-09 06:00:00","126.53","37.75","32.31","203","0.62"]
]

Daily User Stats

Request

Default parameters:

txt	2
split	0
srvc	0
date	2011-3-9

Response

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

[
 ["root","96.18","34.20","142.00","0.68","0.00"],
 ["onehtest","32.22","0.00","60.00","0.54","0.00"]
]

It contains maximum of 25 users. These are the top 25 users.

Each line of the array represents the stats for a single user for a period of 24hours.

Weekly User Stats

Request

Default parameters:

Response

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

[
 ["root","96.18","34.20","142.00","0.68","0.00"],
 ["onehtest","32.22","0.00","60.00","0.54","0.00"]
]

It contains a maximum of 25 users. These are the top 25 users.

Each line of the array represents the stats for a single user for a period of 24hours.

History - Custom User

Request

Default parameters:

txt	3
srvc	1
user	onehtest
from_date	2011-03-02 00:00:00
to_date	2011-03-10 00:00:00

Response

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

[
 ["2011-03-16 00:00:00","28.97","0.00","0.00","60","0.48","300","200"],
 ["2011-03-15 23:00:00","38.25","0.00","0.00","60","0.64","300","200"],
 .... 24 entries per day ....
 ["2011-03-14 01:00:00","34.29","0.00","0.00","60","0.57","300","200"],
 ["2011-03-14 00:00:00","35.38","0.00","0.00","60","0.59","300","200"]
]


Each line of the array represents the stats for a single hour.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox