API functions

Functions are passed to the API with each request in the c parameter. See the usage guide for more details.

Functions

Values

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

{"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

{"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

{"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

{"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

{"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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
  • (string)mountedOn - limit returned data to specified mount point (optional).
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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
  • (int)serverId
  • (string)rangeStart - GMT/UTC start time for the range, ISO 8601 formatted without a timezone.
  • (string)rangeEnd - GMT/UTC end time for the range, ISO 8601 formatted without a timezone.
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

{"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

{"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

{"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

{"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

{"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

{"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

{"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

{"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

{"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
  • (string)username - URL encoded
  • (string)firstName - URL encoded
  • (string)lastName - URL encoded
  • (string)timezone - URL encoded (optional, defaults to Europe/London). See list of timezones.
  • (int)apiEnabled - ignore to disable, specify 1 to enable (optional)
  • (int)admin - ignore to disable, specify 1 to enable (optional)
  • (string)password - URL encoded
  • (int)groupPermissions - ignore = access all groups, 2 = access only specified groups, 3 = access all but specified groups (optional)
  • (string)groups - comma separated list of group names (e.g. Rackspace,Test 1 or just a single group e.g. Rackspace), URL encoded. If the group name does not already exist it will be added. (optional)
  • (string)email - contact e-mail address for this user (optional)
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

{"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

{"status":1,"data":{"userDeleted":1}}

Users - getbyid

Gets user info by ID. Only admin users can use this function.

Command users/getbyid
Parameters
  • (int)userId - ID of the user to return
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

{"status":1,"data":{"user":{"userId":1,"username":"david","firstName":"David","lastName":"Mytton","admin":true}}}

Values - Alerts - notificationType

Values - Alerts - checkType

Values - Users - timezones