RPC API Developer's Guide

RPC API: Get SDTs

Note that LogicMonitor does have an available REST API equivalent for this API call.

Scheduled Down Time (SDT) allows you to suppress alert notifications for a specific time period: daily, weekly, or monthly. LogicMonitor's RPC API allows you to programmatically manage SDTs for:

  • Devices
  • Device Groups
  • Device Datasources
  • Device Datasource Instances
  • Device Datasource Instance Groups
  • Collectors

You can use getSDT to view the details for an SDT.

Note: As with all of our API calls, authentication is required.

 

getSDTs

URL:
https://accountName.logicmonitor.com/santaba/rpc/getSDTs?c=accountName&u=user&p=password&hostGroupId=123|hostId=123|dataSourceInstanceId=123|dataSourceInstanceGroupId=123|agentId=123

 

Request Parameters: You can include the following as query parameters in a getSDTs request:

Parameter

Type

Description

hostGroupId Integer Optional.
Returns all SDTS for a specific host group. To get a hostGroupId in the UI: navigate to the group & the id is in the URL. In the new UI it is displayed in the URL as dg/##.

hostId Integer Optional. Returns all SDTS for a specific host. To get a hostId in the UI: navigate to the group & the id is in the URL. In the new UI it is displayed in the URL as d/##.
dataSourceInstanceId Integer
Optional. Returns all SDTS for an instance of a datasource. The dataSourceInstance Id can be retrieved with getDataSourceInstances() (see information below this table).
dataSourceInstanceGroupID Integer
Optional. Returns all SDTS for an instance group. This value can be retrieved with getDataSourceInstanceGroup() (see information below this table.)
agentId Integer Optional. Returns all SDTS for a collector. Collector Ids can be found in your account UI (Settings | Collectors).

 

getDataSourceInstances:

https://accountName.logicmonitor.com/santaba/rpc/getDataSourceInstances?hostId=hostIdNum&dataSource=dataSourceName

getDataSourceInstanceGroup:

https://accountName.logicmonitor.com/santaba/rpc/getDataSourceInstanceGroup?hostName=hostName&dataSourceName=dataSourceName&dataSourceInstanceGroupName=dataSourceInstanceGroupName

 

All outputs will be in the format: { [status], [data], [errmsg] }, where status is the status of the response, errmsg is the error message associated with the response and the data object includes the following:

 

Value

Description

startDateTime Includes start time information
- minute Includes start time information
- weekDay Day of the week (1 = Sunday, 2 = Monday, etc)
- month Month of the year (0 = January)
- year Year for the SDT
- hour Hour for the SDT, on a 00 - 24 hour schedule
- day Date (01-31)
weekDay Day of the week to start SDT
monthDay Date (01-31) to start SDT
endMinute Based duration, the minute the SDT will end
hour Hour of the day to start SDT
type 1= One Time, 2 = Weekly, 3 = Monthly, 4=Daily
endDateTime Same fields as startDateTime
endHour Based on duration, the hour the SDT will end
id ID of the SDT
minute Minute of the hour to start SDT
category Includes information about the type of SDT requested
duration Length in minutes of SDT
admin User who created SDT
isEffective True if current time is within SDT
comment SDT Comment added, empty if unspecified
sdtType 1 = One Time, 2 = Weekly, 3 = Monthly

Example

Get all SDTs for a specific device:

Request:
curl "https://company.logicmonitor.com/santaba/rpc/getSDTs?hostId=237" 
Response:
{
  "status": 200,
  "data": {
    "startDateTime": {
      "minute": 2,
      "weekDay": 4,
      "month": 10,
      "year": 2014,
      "hour": 22,
      "day": 22
    },
    "weekDay": 1,
    "monthDay": 0,
    "endMinute": 2,
    "hostId": 237,
    "hour": 1,
    "type": "weekly",
    "endDateTime": {
      "minute": 2,
      "weekDay": 4,
      "month": 10,
      "year": 2014,
      "hour": 22,
      "day": 22
    },
    "endHour": 2,
    "id": 23,
    "minute": 1,
    "category": {"name": "HostSDT"},
    "duration": 0,
    "sdtType": 2,
    "admin": "steve",
    "isEffective": false,
    "comment": ""
  },.......
  .........
  .........
  ],
  "errmsg": "OK"
}