API functions
Functions are passed to the API with each request in the c parameter. See the usage guide for more details.
Functions
- Alerts
- iPhone
- Metrics
- Get latest
- Get Apache status
- Get Apache status by range
- Get disk usage
- Get disk usage by range
- Get load average
- Get load average by range
- Get physical memory usage
- Get physical memory usage by range
- Get swap memory usage
- Get swap memory usage by range
- Get MySQL status
- Get MySQL status by range
- Get network traffic
- Get network traffic by range
- Get Nginx status
- Get Nginx status by range
- Get process count
- Get process count by range
- Servers
- Users
Values
- Alerts
- Users
Alerts - get latest
Return a list of the last 5 triggered alerts.
| Command | alerts/getlatest |
| Parameters | None |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=alerts/getlatest
Returns
alerts- an item will exist for each triggered alert, up to the 5 latestalert- details about the triggered alertalertIdtimeAlerted- the time the alert was triggered, ISO 8601 formatted, converted to the user's timezone.timeAlertedGMT- the time the alert was triggered, ISO 8601 formatted, always GMT/UTC.checkType- seecheckTypeTextfor a friendly description of the check type and the list of checkType values.triggeredValue- the value that triggered the alert.notificationType- seenotificationTypeTextfor a friendly description of the notification type and the list of notificationType values.
user- details about the user notifieduserIdusernamefirstNamelastNameadmin- admin user or not (bool)
server- details about the server the alert was triggered forserverIdnameipgroup
{"status":1,"data":{"alerts":[{"alert":{"alertId":"4","timeAlerted":"2010-08-17T10:21:13+0000","checkType":"noData","tri
ggeredValue":"5","notificationType":"emailsms","fixed":"1","checkTypeText":"No data
received","notificationTypeText":"E-mail &
SMS"},"user":{"userId":"1","firstName":"David","lastName":"Mytton"},"server":{"serverId":"1","name":"lyra.boxedice.net",
"ip":"67.23.6.201", "group":"Rackspace"}}]}}
Alerts - list
Return a list of all alerts on the account.
| Command | alerts/list |
| Parameters | None |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=alerts/list
Returns
alerts- an item will exist for each alertalert- details about the triggered alertalertIdpaused- 1 = paused; 0 = active.checkType- seecheckTypeTextfor a friendly description of the check type and the list of checkType values.comparisontriggerThreshold- the value that will trigger the alert compared bycomparison.notificationType- seenotificationTypeTextfor a friendly description of the notification type and the list of notificationType values.
user- the user the alert belongs touserIdusernamefirstNamelastNameadmin- admin user or not (bool)
server- the server the alert is attached toserverIdnameipgroup
{"status":1,"data":{"alerts":[{"alert":{"alertId":"4","paused":"0","checkType":"noData","comparison":">=","triggerThresh
old":"5","notificationType":"emailsms","checkTypeText":"No data received","notificationTypeText":"E-mail &
SMS"},"user":{"userId":"1","firstName":"David","lastName":"Mytton"},"server":{"serverId":"1","name":"lyra.boxedice.net",
"ip":"67.23.6.201", "group":"Rackspace"}}]}}
Alerts - pause
Pause the specified alert. The parameters for this function must be sent by POST.
| Command | alerts/pause |
| Parameters | (int)alertId - requires POST |
| Added in | v1.0 |
| Account types | All |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=alerts/pause Host: api.serverdensity.com Content-Length: 10 Content-Type: application/x-www-form-urlencoded &alertId=4
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
paused- 1 = success
{"status":1,"data":{"paused":1}}
Alerts - resume
Resume the specified alert. The parameters for this function must be sent by POST.
| Command | alerts/resume |
| Parameters | (int)alertId - requires POST |
| Added in | v1.0 |
| Account types | All |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=alerts/resume Host: api.serverdensity.com Content-Length: 10 Content-Type: application/x-www-form-urlencoded &alertId=4
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
resumed- 1 = success
{"status":1,"data":{"resumed":1}}
iPhone - set device token
Set the device token for the current user to enable push notifications. The parameters for this function must be sent by POST. The first time this is set for the user, an e-mail will be sent notifying them.
| Command | iphone/setdevicetoken |
| Parameters | (str)deviceToken device token in hex format, as >generated by iPhone OS/APNS - requires POST |
| Added in | v1.0.2 (use 1.0 endpoint) |
| Account types | Paid only |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=iphone/setdevicetoken Host: api.serverdensity.com Content-Length: 77 Content-Type: application/x-www-form-urlencoded &deviceToken=02da851dXXXXXXXXb4f2b5bfXXXXXXXXce198270XXXXXXXX0d3dac72bc87cd60
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
setDeviceToken- 1 = success
{"status":1,"data":{"setDeviceToken":1}}
Metrics - get latest
Returns the latest data for all available checks for the specified server.
| Command | metrics/getlatest |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | Available metrics depend on account type |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getlatest&serverId=1
Returns
latestMetrics- latest metrics for all types. See individual API functions for return details.apacheStatus(paid accounts only)diskUsage(paid accounts only)loadAvrgmemPhysmemSwapmysqlStatus(paid accounts only)networkTraffic(paid accounts only)nginxStatus(paid accounts only)processCount
{"status":1,"data":{"latestMetrics":{"apacheStatus":{"timeAdded":"2010-08-17T10:21:13+0000","reqPerSec":"1.65","busyWork
ers":"1","idleWorkers":"9"},"diskUsage":{"volumes":[{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"\/dev\/sda1","
used":"40","available":"30","capacity":"58%","mountedOn":"\/"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"pro
c","used":"0","available":"0","capacity":"-","mountedOn":"\/proc"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":
"none","used":"0","available":"0","capacity":"-","mountedOn":"\/dev\/pts"},{"timeAdded":"2010-08-17T10:21:13+0000","file
system":"none","used":"0","available":"1","capacity":"0%","mountedOn":"\/dev\/shm"},{"timeAdded":"2010-08-17T10:21:13+00
00","filesystem":"none","used":"0","available":"0","capacity":"-","mountedOn":"\/proc\/sys\/fs\/binfmt_misc"}]},"network
Traffic":{"interfaces":[{"timeAdded":"2010-08-17T10:21:13+0000","interface":"lo","transmitted":"0.10","received":"0.10"}
,{"timeAdded":"2010-08-17T10:21:13+0000","interface":"eth1","transmitted":"0.00","received":"0.00"},{"timeAdded":"2010-0
8-17T10:21:13+0000","interface":"eth0","transmitted":"0.28","received":"1.46"}]},"loadAvrg":{"timeAdded":"2010-08-17T10:
21:13+0000","value":"0.76"},"memPhys":{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"2026","valueFree":"22","value
Cached":"1702"},"memSwap":{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"0","valueFree":"4095"},"processCount":{"t
imeAdded":"2010-08-17T10:21:13+0000","value":"78"}}}}
Metrics - get Apache status
Returns the latest data for the Apache status metric for the specified server.
| Command | metrics/getapachestatus |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getapachestatus&serverI d=1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).reqPerSec(rounded to 2DP)idleWorkersbusyWorkers
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","reqPerSec":"1.32","busyWorkers":"1","idleWorkers":
"9"}}}
Metrics - get Apache status by range
Returns the Apache status metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getapachestatusrange |
| Parameters | |
| Added in | v1.0 |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getapachestatusrange&se rverId=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:05:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).reqPerSec(rounded to 2DP)connections
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","reqPerSec":"1.40664","busyWorkers":"1","idleWork
ers":"9"},{"timeAdded":"2010-08-17T10:22:13+0000","reqPerSec":"1.40667","busyWorkers":"1","idleWorkers":"9"}]}}
Metrics - get disk usage
Returns the latest data for the disk usage metric for the specified server. The mountedOn volume / will always appear first.
| Command | metrics/getdiskusage |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getdiskusage&serverId=1
Returns
volumes- an item will exist for each disk volumetimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).filesystemused- used disk space (in GB) (rounded to 0DP)available- available disk space (in GB) (rounded to 0DP)capacity- used disk space %mounedOn
{"status":1,"data":{"volumes":[{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"\/dev\/sda1","used":"25","available
":"9","capacity":"73%","mountedOn":"\/"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"proc","used":"0","availab
le":"0","capacity":"-","mountedOn":"\/proc"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"none","used":"0","ava
ilable":"0","capacity":"-","mountedOn":"\/dev\/pts"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"none","used":
"0","available":"0","capacity":"0%","mountedOn":"\/dev\/shm"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"none
","used":"0","available":"0","capacity":"-","mountedOn":"\/proc\/sys\/fs\/binfmt_misc"}]}}
Metrics - get disk usage by range
Returns the disk usage metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getdiskusagerange |
| Parameters | |
| Added in | v1.0 |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getdiskusagerange&serve rId=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:02:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).filesystemused- used disk space (in GB) (rounded to 0DP)available- available disk space (in GB) (rounded to 0DP)capacity- used disk space %mounedOn
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"\/dev\/sda1","used":"25","available
":"10","capacity":"71%","mountedOn":"\/"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"proc","used":"0","availa
ble":"0","capacity":"-","mountedOn":"\/proc"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"none","used":"0","av
ailable":"0","capacity":"-","mountedOn":"\/dev\/pts"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"none","used"
:"0","available":"0","capacity":"0%","mountedOn":"\/dev\/shm"},{"timeAdded":"2010-08-17T10:21:13+0000","filesystem":"non
e","used":"0","available":"0","capacity":"-","mountedOn":"\/proc\/sys\/fs\/binfmt_misc"},{"timeAdded":"2010-08-17T10:22:
13+0000","filesystem":"\/dev\/sda1","used":"25","available":"10","capacity":"71%","mountedOn":"\/"},{"timeAdded":"2010-0
8-17T10:22:13+0000","filesystem":"proc","used":"0","available":"0","capacity":"-","mountedOn":"\/proc"},{"timeAdded":"20
10-08-17T10:22:13+0000","filesystem":"none","used":"0","available":"0","capacity":"-","mountedOn":"\/dev\/pts"},{"timeAd
ded":"2010-08-17T10:22:13+0000","filesystem":"none","used":"0","available":"0","capacity":"0%","mountedOn":"\/dev\/shm"}
,{"timeAdded":"2010-08-17T10:22:13+0000","filesystem":"none","used":"0","available":"0","capacity":"-","mountedOn":"\/pr
oc\/sys\/fs\/binfmt_misc"}]}}
Metrics - get load average
Returns the latest data for the load average metric for the specified server.
| Command | metrics/getloadaverage |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getloadaverage&serverId =1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).value(rounded to 2DP)
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","value":"0.72"}}}
Metrics - get load average by range
Returns the load average metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getloadaveragerange |
| Parameters | |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.comc=metrics/getloadaveragerange&serv erId=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:02:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).value(rounded to 2DP)
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","value":"0.73"},{"timeAdded":"2010-08-17T10:22:13
+0000","value":"0.81"}]}}
Metrics - get physical memory usage
Returns the latest data for the physical memory metric for the specified server.
| Command | metrics/getmemphys |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getmemphys&serverId=1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).valueUsed- used memory (in MB)valueFree- free memory (in MB)valueCached- cached memory (in MB)
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"599","valueFree":"424","valueCached":"
398"}}}
Metrics - get physical memory usage by range
Returns the physical memory metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getmemphysrange |
| Parameters | |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getmemphysrange&serverI d=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:02:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).valueUsed- used memory (in MB)valueFree- free memory (in MB)valueCached- cached memory (in MB)
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"1008","valueFree":"15","valueCached"
:"721"},{"timeAdded":"2010-08-17T10:22:13+0000","valueUsed":"1007","valueFree":"16","valueCached":"722"}]}}
Metrics - get swap memory usage
Returns the latest data for the swap memory metric for the specified server.
| Command | metrics/getmemswap |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getmemswap&serverId=1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).valueUsed- used memory (in MB)valueFree- free memory (in MB)
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"0","valueFree":"2047"}}}
Metrics - get swap memory usage by range
Returns the swap memory metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getmemswaprange |
| Parameters | |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.comc=metrics/getmemswaprange&serverId =1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:02:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).valueUsed- used memory (in MB)valueFree- free memory (in MB)
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","valueUsed":"9","valueFree":"2038"},{"timeAdded":
"2010-08-17T10:22:13+0000","valueUsed":"9","valueFree":"2038"}]}}
Metrics - get MySQL status
Returns the latest data for the MySQL status metric for the specified server.
| Command | metrics/getmysqlstatus |
| Parameters | (int)serverId |
| Added in | v1.0.11 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getmysqlstatus&serverId =1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).connectionsmaxConcurrentConnectionsthreadsConnectedcreatedTmpDiskTablesopenFilesslowQueriestableLocksWaitedmysqlSecondsBehindMaster
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:22:13+0000","connections":"14","maxConcurrentConnections":"11",
"threadsConnected":"2","createdTmpDiskTables":"0","openFiles":"97","slowQueries":"0","tableLocksWaited":"0"}
Metrics - get MySQL status by range
Returns the MySQL status metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getmysqlstatusrange |
| Parameters | |
| Added in | v1.0.11 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getmysqlstatusrange&ser verId=1&rangeStart=2009-11-02T10:00:00&rangeEnd=2009-11-02T10:05:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).connectionsmaxConcurrentConnectionsthreadsConnectedcreatedTmpDiskTablesopenFilesslowQueriestableLocksWaitedmysqlSecondsBehindMaster
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:22:13+0000","connections":"0","maxConcurrentConnections":"0",
"threadsConnected":"0","createdTmpDiskTables":"0","openFiles":"0","slowQueries":"0","tableLocksWaited":"0"}]}}
Metrics - get network traffic
Returns the latest data for the network traffic metric for the specified server.
| Command | metrics/getnetworktraffic |
| Parameters | (int)serverId |
| Added in | v1.0.1 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getnetworktraffic&serve rId=1
Returns
interfaces- an item will exist for each network interfacetimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).interface- the name of the interfacetransmitted- data transmitted since the last data point (in MB)received- data received since the last data point (in MB)
{"status":1,"data":{"interfaces":[{"timeAdded":"2010-08-17T10:22:13+0000","interface":"lo","transmitted":"0.22","receive
d":"0.22"},{"timeAdded":"2010-08-17T10:22:13+0000","interface":"eth1","transmitted":"0.00","received":"0.00"},{"timeAdde
d":"2010-08-17T10:22:13+0000","interface":"eth0","transmitted":"0.20","received":"1.23"}]}}
Metrics - get network traffic by range
Returns the network traffic metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getnetworktrafficrange |
| Parameters | |
| Added in | v1.0.1 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getnetworktrafficrange& serverId=1&rangeStart=2009-06-27T17:00:00&rangeEnd=2009-06-27T17:04:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).interface- the name of the interfacetransmitted- data transmitted since the last data point (in MB) (rounded to 2DP)received- data received since the last data point (in MB) (rounded to 2DP)
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","interface":"lo","transmitted":"0.22","received":
"0.22"},{"timeAdded":"2010-08-17T10:21:13+0000","interface":"eth1","transmitted":"0.00","received":"0.00"},{"timeAdded":
"2010-08-17T10:21:13+0000","interface":"eth0","transmitted":"0.17","received":"1.23"},{"timeAdded":"2010-08-17T10:22:13+
0000","interface":"lo","transmitted":"0.22","received":"0.22"},{"timeAdded":"2010-08-17T10:22:13+0000","interface":"eth1
","transmitted":"0.00","received":"0.00"},{"timeAdded":"2010-08-17T10:22:13+0000","interface":"eth0","transmitted":"0.17
","received":"1.24"},{"timeAdded":"2010-08-17T10:23:13+0000","interface":"lo","transmitted":"0.22","received":"0.22"},{"
timeAdded":"2010-08-17T10:23:13+0000","interface":"eth1","transmitted":"0.00","received":"0.00"},{"timeAdded":"2010-08-1
7T10:23:13+0000","interface":"eth0","transmitted":"0.17","received":"1.25"},{"timeAdded":"2010-08-17T10:24:13+0000","int
erface":"lo","transmitted":"0.22","received":"0.22"},{"timeAdded":"2010-08-17T10:24:13+0000","interface":"eth1","transmi
tted":"0.00","received":"0.00"},{"timeAdded":"2010-08-17T10:24:13+0000","interface":"eth0","transmitted":"0.19","receive
d":"1.28"}]}}
Metrics - get Nginx status
Returns the latest data for the Nginx status metric for the specified server.
| Command | metrics/getnginxstatus |
| Parameters | (int)serverId |
| Added in | v1.0.9 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getnginxstatus&serverId =1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).reqPerSec(rounded to 2DP)connections
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","reqPerSec":"1.32","connections":"1"}}}
Metrics - get Nginx status by range
Returns the Nginx status metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getnginxstatusrange |
| Parameters | |
| Added in | v1.0.9 (use 1.0 endpoint) |
| Account types | Paid only |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getnginxstatusrange&ser verId=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:05:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).reqPerSec(rounded to 2DP)connectionsbusyWorkers
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","reqPerSec":"1.40","connections":"1"},{"timeAdded
":"2010-08-17T10:22:13+0000","reqPerSec":"1.40","connections":"1"}]}}
Metrics - get process count
Returns the latest data for the process count metric for the specified server.
| Command | metrics/getprocesscount |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=metrics/getprocesscount&serverI d=1
Returns
metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).value
{"status":1,"data":{"metric":{"timeAdded":"2010-08-17T10:21:13+0000","value":"78"}}}
Metrics - get process count by range
Returns the swap memory metrics for the specified server during the specified time range. Will return a maximum of 30 days or 12 hours of data (720 data points) depending on the size of the specified time range.
| Command | metrics/getprocesscountrange |
| Parameters | |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.comc=metrics/getprocesscountrange&ser verId=1&rangeStart=2009-06-10T10:00:00&rangeEnd=2009-06-10T10:02:00
Returns
metrics- an item will exist for each metrictimeAdded- the time this data point was collected, ISO 8601 formatted (always GMT/UTC).value
{"status":1,"data":{"metrics":[{"timeAdded":"2010-08-17T10:21:13+0000","value":"81"},{"timeAdded":"2010-08-17T10:22:13+0
000","value":"79"}]}}
Servers - add
Adds a new server to your account and returns the new server ID and agent key. Will add a new noData alert for the authenticated user, or the user ID specified. If the optional specified group does not exist, it will be created. Only admin users can use this function.
| Command | servers/add |
| Parameters |
|
| Added in | v1.0.5 (use 1.0 endpoint) |
| Account types | All |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/add Host: api.serverdensity.com Content-Length: 72 Content-Type: application/x-www-form-urlencoded name=Test+2&ip=10.0.0.2&location=Hat&provider=Cheese¬es=nope&userId=2
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
dataserverIdagentKey
{"status":1,"data":{"serverId":36,"agentKey":"c2de1a4879b2fb2a576abf2b5c9ead55"}}
Servers - add group
Adds a new group. Only admin users can use this function.
| Command | servers/addgroup |
| Parameters |
|
| Added in | v1.0.8 (use 1.0 endpoint) |
| Account types | All |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/addgroup Host: api.serverdensity.com Content-Length: 14 Content-Type: application/x-www-form-urlencoded name=Rackspace
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
dataname
{"status":1,"data":{"name":"Rackspace"}}
Servers - delete
Marks the specified server for deletion and pauses all alerts. Servers are not deleted immediately and the deletion can be undone from the web UI for 24 hours before permanent removal. Only admin users can use this function.
| Command | servers/delete |
| Parameters | (int)serverId |
| Added in | v1.0.10 (use 1.0 endpoint) |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/delete&serverId=1
Returns
-
serverDeleted- 1 = success
{"status":1,"data":{"serverDeleted":1}}
Servers - get by group
Returns all servers in the specified group. Servers marked for deletion but not yet deleted will not be returned.
| Command | servers/getbygroup |
| Parameters | (string)group |
| Added in | v1.0.6 (use 1.0 endpoint) |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/getbygroup&group=Racksp ace
Returns
server- an item will exist for each serverserverIdnameipgrouplocationprovidernotesagentKey
{"status":1,"data":{"servers":[{"serverId":48,"ip":"207.97.206.146","name":"asriel.boxedice.net","group":"Rackspace","lo
cation":"IAD2, Virginia, USA","provider":"Rackspace","agentKey":"56467f41ef3144f941b774f4804ba653"}]}}
Servers - get by ID
Returns details about the specified server, by ID. Servers marked for deletion but not yet deleted will not be returned.
| Command | servers/getbyid |
| Parameters | (int)serverId |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/getbyid&serverId=1
Returns
serverserverIdnameipgrouplocationprovidernotesagentKey
{"status":1,"data":{"server":{"serverId":48,"ip":"207.97.206.146","name":"asriel.boxedice.net","group":"Rackspace","loca
tion":"IAD2, Virginia, USA","provider":"Rackspace","notes":"","agentKey":"56467f41ef3144f941b774f4804ba653"}}}
Servers - get by IP
Returns details about the specified server, by IP address. Servers marked for deletion but not yet deleted will not be returned.
| Command | servers/getbyip |
| Parameters | (string)ip |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?&account=example.serverdensity.com&c=servers/getbyip&ip=207.97.206. 146
Returns
serverserverIdnameipgrouplocationprovidernotesagentKey
{"status":1,"data":{"server":{"serverId":48,"ip":"207.97.206.146","name":"asriel.boxedice.net","group":"Rackspace","loca
tion":"IAD2, Virginia, USA","provider":"Rackspace","notes":"","agentKey":"56467f41ef3144f941b774f4804ba653"}}}
Servers - list
Returns list of all servers. Servers marked for deletion but not yet deleted will not be returned.
| Command | servers/list |
| Parameters | None |
| Added in | v1.0 |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/list
Returns
servers- an item will exist for each serverserverIdnameipgrouplocationprovidernotesagentKey
{"status":1,"data":{"servers":[{"serverId":"1","name":"lyra.boxedice.net","ip":"67.23.6.201","group":"Rackspace","locati
on":"DFW, USA","provider":"Slicehost","notes":"","agentKey":"key"},{"serverId":"34","name":"DF
Test","ip":"10.0.0.1","location":"","provider":"","notes":"","agentKey":"key"}]}}
Servers - list groups
Returns list of all server groups. Only the groups that the user is permitted to see will be returned.
| Command | servers/listgroups |
| Parameters | None |
| Added in | v1.0.6 (use 1.0 endpoint) |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=servers/listgroups
Returns
groups- an item will exist for each group
{"status":1,"data":{"groups":["Rackspace","Rackspace Cloud","Test 1","Test 2"]}}
Users - add
Adds a new user. Only admin users can use this function.
| Command | users/add |
| Parameters |
|
| Added in | v1.0.8 (use 1.0 endpoint) |
| Account types | All |
Example
POST https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=users/add Host: api.serverdensity.com Content-Length: 134 Content-Type: application/x-www-form-urlencoded username=david&firstName=David&lastName=Mytton&timezone=Europe%2FLondon&password=password&groupPermissions=2&groups=Rackspace%2CTest+1
(This is provided as an example request. No specific headers (or content-type) are required above the standard HTTP headers.)
Returns
datauserId
{"status":1,"data":{"userId":36}}
Users - delete
Deleted the specified user + all associated alerts and contact details. Only admin users can use this function.
| Command | users/delete |
| Parameters | (int)userId |
| Added in | v1.0.10 (use 1.0 endpoint) |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=users/delete&userId=1
Returns
-
userDeleted- 1 = success
{"status":1,"data":{"userDeleted":1}}
Users - getbyid
Gets user info by ID. Only admin users can use this function.
| Command | users/getbyid |
| Parameters |
|
| Added in | v1.0.13 (use 1.0 endpoint) |
| Account types | All |
Example
https://username:password@api.serverdensity.com/1.0/?account=example.serverdensity.com&c=users/getbyid&userId=1
Returns
datauserId
{"status":1,"data":{"user":{"userId":1,"username":"david","firstName":"David","lastName":"Mytton","admin":true}}}
Values - Alerts - notificationType
apacheReqPerSec- Apache requests per secapacheBusyWorkers- Apache workers (busy)apacheIdleWorkers- Apache workers (idle)diskUsagePercent- % disk usageloadAvrg- Load averagememPhysUsed- Physical memory - usedmemPhysFree- Physical memory - freememSwapUsed- Swap usage - usedmemSwapFree- Swap usage - freemysqlConnections- MySQL connections per secmysqlThreadsConnected- MySQL threads connectedmysqlSecondsBehindMaster- MySQL seconds behind masternginxReqPerSec- Nginx requests per secnginxConnections- Nginx connectionsprocessCount- Process countnoData- No data received
Values - Alerts - checkType
email- E-mailsms- SMSemailsms- E-mail &: SMSiphonepush- iPhone Push
Values - Users - timezones
- Africa/Abidjan
- Africa/Accra
- Africa/Addis Ababa
- Africa/Algiers
- Africa/Asmara
- Africa/Asmera
- Africa/Bamako
- Africa/Bangui
- Africa/Banjul
- Africa/Bissau
- Africa/Blantyre
- Africa/Brazzaville
- Africa/Bujumbura
- Africa/Cairo
- Africa/Casablanca
- Africa/Ceuta
- Africa/Conakry
- Africa/Dakar
- Africa/Dar es Salaam
- Africa/Djibouti
- Africa/Douala
- Africa/El Aaiun
- Africa/Freetown
- Africa/Gaborone
- Africa/Harare
- Africa/Johannesburg
- Africa/Kampala
- Africa/Khartoum
- Africa/Kigali
- Africa/Kinshasa
- Africa/Lagos
- Africa/Libreville
- Africa/Lome
- Africa/Luanda
- Africa/Lubumbashi
- Africa/Lusaka
- Africa/Malabo
- Africa/Maputo
- Africa/Maseru
- Africa/Mbabane
- Africa/Mogadishu
- Africa/Monrovia
- Africa/Nairobi
- Africa/Ndjamena
- Africa/Niamey
- Africa/Nouakchott
- Africa/Ouagadougou
- Africa/Porto-Novo
- Africa/Sao Tome
- Africa/Timbuktu
- Africa/Tripoli
- Africa/Tunis
- Africa/Windhoek
- America/Adak
- America/Anchorage
- America/Anguilla
- America/Antigua
- America/Araguaina
- America/Argentina (Buenos Aires)
- America/Argentina (Catamarca)
- America/Argentina (ComodRivadavia)
- America/Argentina (Cordoba)
- America/Argentina (Jujuy)
- America/Argentina (La Rioja)
- America/Argentina (Mendoza)
- America/Argentina (Rio Gallegos)
- America/Argentina (Salta)
- America/Argentina (San Juan)
- America/Argentina (San Luis)
- America/Argentina (Tucuman)
- America/Argentina (Ushuaia)
- America/Aruba
- America/Asuncion
- America/Atikokan
- America/Atka
- America/Bahia
- America/Barbados
- America/Belem
- America/Belize
- America/Blanc-Sablon
- America/Boa Vista
- America/Bogota
- America/Boise
- America/Buenos Aires
- America/Cambridge Bay
- America/Campo Grande
- America/Cancun
- America/Caracas
- America/Catamarca
- America/Cayenne
- America/Cayman
- America/Chicago
- America/Chihuahua
- America/Coral Harbour
- America/Cordoba
- America/Costa Rica
- America/Cuiaba
- America/Curacao
- America/Danmarkshavn
- America/Dawson
- America/Dawson Creek
- America/Denver
- America/Detroit
- America/Dominica
- America/Edmonton
- America/Eirunepe
- America/El Salvador
- America/Ensenada
- America/Fort Wayne
- America/Fortaleza
- America/Glace Bay
- America/Godthab
- America/Goose Bay
- America/Grand Turk
- America/Grenada
- America/Guadeloupe
- America/Guatemala
- America/Guayaquil
- America/Guyana
- America/Halifax
- America/Havana
- America/Hermosillo
- America/Indiana (Indianapolis)
- America/Indiana (Knox)
- America/Indiana (Marengo)
- America/Indiana (Petersburg)
- America/Indiana (Tell City)
- America/Indiana (Vevay)
- America/Indiana (Vincennes)
- America/Indiana (Winamac)
- America/Indianapolis
- America/Inuvik
- America/Iqaluit
- America/Jamaica
- America/Jujuy
- America/Juneau
- America/Kentucky (Louisville)
- America/Kentucky (Monticello)
- America/Knox IN
- America/La Paz
- America/Lima
- America/Los Angeles
- America/Louisville
- America/Maceio
- America/Managua
- America/Manaus
- America/Marigot
- America/Martinique
- America/Mazatlan
- America/Mendoza
- America/Menominee
- America/Merida
- America/Mexico City
- America/Miquelon
- America/Moncton
- America/Monterrey
- America/Montevideo
- America/Montreal
- America/Montserrat
- America/Nassau
- America/New York
- America/Nipigon
- America/Nome
- America/Noronha
- America/North Dakota (Center)
- America/North Dakota (New Salem)
- America/Panama
- America/Pangnirtung
- America/Paramaribo
- America/Phoenix
- America/Port-au-Prince
- America/Port of Spain
- America/Porto Acre
- America/Porto Velho
- America/Puerto Rico
- America/Rainy River
- America/Rankin Inlet
- America/Recife
- America/Regina
- America/Resolute
- America/Rio Branco
- America/Rosario
- America/Santarem
- America/Santiago
- America/Santo Domingo
- America/Sao Paulo
- America/Scoresbysund
- America/Shiprock
- America/St Barthelemy
- America/St Johns
- America/St Kitts
- America/St Lucia
- America/St Thomas
- America/St Vincent
- America/Swift Current
- America/Tegucigalpa
- America/Thule
- America/Thunder Bay
- America/Tijuana
- America/Toronto
- America/Tortola
- America/Vancouver
- America/Virgin
- America/Whitehorse
- America/Winnipeg
- America/Yakutat
- America/Yellowknife
- Antarctica/Casey
- Antarctica/Davis
- Antarctica/DumontDUrville
- Antarctica/Mawson
- Antarctica/McMurdo
- Antarctica/Palmer
- Antarctica/Rothera
- Antarctica/South Pole
- Antarctica/Syowa
- Antarctica/Vostok
- Arctic/Longyearbyen
- Asia/Aden
- Asia/Almaty
- Asia/Amman
- Asia/Anadyr
- Asia/Aqtau
- Asia/Aqtobe
- Asia/Ashgabat
- Asia/Ashkhabad
- Asia/Baghdad
- Asia/Bahrain
- Asia/Baku
- Asia/Bangkok
- Asia/Beirut
- Asia/Bishkek
- Asia/Brunei
- Asia/Calcutta
- Asia/Choibalsan
- Asia/Chongqing
- Asia/Chungking
- Asia/Colombo
- Asia/Dacca
- Asia/Damascus
- Asia/Dhaka
- Asia/Dili
- Asia/Dubai
- Asia/Dushanbe
- Asia/Gaza
- Asia/Harbin
- Asia/Ho Chi Minh
- Asia/Hong Kong
- Asia/Hovd
- Asia/Irkutsk
- Asia/Istanbul
- Asia/Jakarta
- Asia/Jayapura
- Asia/Jerusalem
- Asia/Kabul
- Asia/Kamchatka
- Asia/Karachi
- Asia/Kashgar
- Asia/Kathmandu
- Asia/Katmandu
- Asia/Kolkata
- Asia/Krasnoyarsk
- Asia/Kuala Lumpur
- Asia/Kuching
- Asia/Kuwait
- Asia/Macao
- Asia/Macau
- Asia/Magadan
- Asia/Makassar
- Asia/Manila
- Asia/Muscat
- Asia/Nicosia
- Asia/Novokuznetsk
- Asia/Novosibirsk
- Asia/Omsk
- Asia/Oral
- Asia/Phnom Penh
- Asia/Pontianak
- Asia/Pyongyang
- Asia/Qatar
- Asia/Qyzylorda
- Asia/Rangoon
- Asia/Riyadh
- Asia/Saigon
- Asia/Sakhalin
- Asia/Samarkand
- Asia/Seoul
- Asia/Shanghai
- Asia/Singapore
- Asia/Taipei
- Asia/Tashkent
- Asia/Tbilisi
- Asia/Tehran
- Asia/Tel Aviv
- Asia/Thimbu
- Asia/Thimphu
- Asia/Tokyo
- Asia/Ujung Pandang
- Asia/Ulaanbaatar
- Asia/Ulan Bator
- Asia/Urumqi
- Asia/Vientiane
- Asia/Vladivostok
- Asia/Yakutsk
- Asia/Yekaterinburg
- Asia/Yerevan
- Atlantic/Azores
- Atlantic/Bermuda
- Atlantic/Canary
- Atlantic/Cape Verde
- Atlantic/Faeroe
- Atlantic/Faroe
- Atlantic/Jan Mayen
- Atlantic/Madeira
- Atlantic/Reykjavik
- Atlantic/South Georgia
- Atlantic/St Helena
- Atlantic/Stanley
- Australia/ACT
- Australia/Adelaide
- Australia/Brisbane
- Australia/Broken Hill
- Australia/Canberra
- Australia/Currie
- Australia/Darwin
- Australia/Eucla
- Australia/Hobart
- Australia/LHI
- Australia/Lindeman
- Australia/Lord Howe
- Australia/Melbourne
- Australia/North
- Australia/NSW
- Australia/Perth
- Australia/Queensland
- Australia/South
- Australia/Sydney
- Australia/Tasmania
- Australia/Victoria
- Australia/West
- Australia/Yancowinna
- Europe/Amsterdam
- Europe/Andorra
- Europe/Athens
- Europe/Belfast
- Europe/Belgrade
- Europe/Berlin
- Europe/Bratislava
- Europe/Brussels
- Europe/Bucharest
- Europe/Budapest
- Europe/Chisinau
- Europe/Copenhagen
- Europe/Dublin
- Europe/Gibraltar
- Europe/Guernsey
- Europe/Helsinki
- Europe/Isle of Man
- Europe/Istanbul
- Europe/Jersey
- Europe/Kaliningrad
- Europe/Kiev
- Europe/Lisbon
- Europe/Ljubljana
- Europe/London
- Europe/Luxembourg
- Europe/Madrid
- Europe/Malta
- Europe/Mariehamn
- Europe/Minsk
- Europe/Monaco
- Europe/Moscow
- Europe/Nicosia
- Europe/Oslo
- Europe/Paris
- Europe/Podgorica
- Europe/Prague
- Europe/Riga
- Europe/Rome
- Europe/Samara
- Europe/San Marino
- Europe/Sarajevo
- Europe/Simferopol
- Europe/Skopje
- Europe/Sofia
- Europe/Stockholm
- Europe/Tallinn
- Europe/Tirane
- Europe/Tiraspol
- Europe/Uzhgorod
- Europe/Vaduz
- Europe/Vatican
- Europe/Vienna
- Europe/Vilnius
- Europe/Volgograd
- Europe/Warsaw
- Europe/Zagreb
- Europe/Zaporozhye
- Europe/Zurich
- Indian/Antananarivo
- Indian/Chagos
- Indian/Christmas
- Indian/Cocos
- Indian/Comoro
- Indian/Kerguelen
- Indian/Mahe
- Indian/Maldives
- Indian/Mauritius
- Indian/Mayotte
- Indian/Reunion
- Pacific/Apia
- Pacific/Auckland
- Pacific/Chatham
- Pacific/Easter
- Pacific/Efate
- Pacific/Enderbury
- Pacific/Fakaofo
- Pacific/Fiji
- Pacific/Funafuti
- Pacific/Galapagos
- Pacific/Gambier
- Pacific/Guadalcanal
- Pacific/Guam
- Pacific/Honolulu
- Pacific/Johnston
- Pacific/Kiritimati
- Pacific/Kosrae
- Pacific/Kwajalein
- Pacific/Majuro
- Pacific/Marquesas
- Pacific/Midway
- Pacific/Nauru
- Pacific/Niue
- Pacific/Norfolk
- Pacific/Noumea
- Pacific/Pago Pago
- Pacific/Palau
- Pacific/Pitcairn
- Pacific/Ponape
- Pacific/Port Moresby
- Pacific/Rarotonga
- Pacific/Saipan
- Pacific/Samoa
- Pacific/Tahiti
- Pacific/Tarawa
- Pacific/Tongatapu
- Pacific/Truk
- Pacific/Wake
- Pacific/Wallis
- Pacific/Yap