REST API Developer's Guide

About the Service (Website) API Resource

The service resource allows you to programmatically manage your LogicMonitor websites.

Resource URI:

/service/services

 

Resource Properties:

All websites have the following properties:

Property

Description

Type

Example

type ping | webservice
The type of the website
String "type" : "webservice"
id The Id of the website Integer "id" : 21
name The name of the website String "name" : "CName_check"
description The description of the website String "description" : "main page check (cname)"
serviceFolderId The id of the folder the website is in Integer "serviceFolderId" : 12
stopMonitoring true: monitoring is disabled for the website
false: monitoring is enabled for the website
If stopMonitoring=true, then alerting will also by default be disabled for the website
Boolean "stopMonitoring" : false
stopMonitoringbyFolder true: monitoring is disabled for all services in the website's folder
false: monitoring is not disabled for all services in website's folder
Boolean "stopMonitoringByFolder" : false
disableAlerting true: alerting is disabled for the website
false: alerting is enabled for the website
If stopMonitoring=true, then alerting will also by default be disabled for the website
Boolean "disableAlerting" : false
individualSmAlertEnable true: an alert will be triggered if a check fails from an individual test location
false: an alert will not be triggered if a check fails from an individual test location
Boolean "individualSmAlertEnable" : true
individualAlertLevel warn | error | critical
The level of alert to trigger if the website fails a check from an individual test location
String "individualAlertLevel" : "error"
overallAlertLevel warn | error | critical
The level of alert to trigger if the website fails the number of checks specified by transition from the test locations specified by globalSmAlertCond
String "overallAlertLevel" : "critical"
alertStatus A status that indicates if there is currently an alert for the website, and whether or not the alert has been acknowledged. This status property has two values in the following format:
{acknowledged} - {alertLevel}, where
acknowledged: confirmed | unconfirmed
alertLevel: warn | error | critical
String "alertStatus":"none"
alertStatusPriority A value used by the UI to determine how alerts should display in the tree
Integer "alertStatusPriority":100000
sdtStatus A status that indicates if there are any SDTs set for the website. This status property has three values in the following format:
"{serviceGroupSDT} - {serviceSDT} - none", where serviceGroupSDT and serviceSDT will be either "SDT" or "none"
String "sdtStatus" : "none-none-none"
alertDisableStatus A status that indicates whether alerting is disabled for the website. This status property has three values in the following format:
"{serviceGroupAlertingDisabled} - {serviceAlertingDisabled} - none", where serviceGroupAlertDisabled and serviceAlertDisabled will be either "disable" or "none"
String "alertDisableStatus" : "none-none-none"
pollingInterval 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
The polling interval for the website, in units of minutes. This value indicates how often the website is checked. The minimum is 1 minute, and the maximum is 10 minutes.
Integer "pollingInterval" : 1
transition 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 30 | 60
The number of checks that must fail before an alert is triggered
Integer "transition" : 1
testLocation The locations from which the website is monitored. If the website is internal, this field should include Collectors. If Non-Internal, possible test locations are:
1 : US - LA
2 : US - DC
3 : US - SF
4 : Europe - Dublin
5 : Asia - Singapore
6 : Australia - Sydney
testLocation:"{all:true}" indicates that the service will be monitored from all checkpoint locations
testLocation:"{smgIds:[1,2,3]}" indicates that the service will be monitored from checkpoint locations 1, 2 and 3
testLocation:"{collectorIds:[85,90]}" indicates that the service will be monitored by Collectors 85 and 90
JSON Object "testLocation" : "{"all":true}"
globalSmAlertCond The number of test locations that checks must fail at to trigger an alert, where the alert triggered will be consistent with the value of overallAlertLevel. Possible values and corresponding number of Site Monitor locations are
0 : all
1 : half
2 : more than one
3 : any
Integer "globalSmAlertCond" : 0
useDefaultLocationSetting true: The checkpoint locations configured in the website Default Settings will be used
false: The checkpoint locations specified in the testLocation will be used
Boolean "useDefaultLocationSetting" : false
useDefaultAlertSetting true: The alert settings configured in the website Default Settings will be used
false: Service Default Settings will not be used, and you will need to specify individualSMAlertEnable, individualAlertLevel, globalSmAlertConf, overallAlertLevel and pollingInterval
Boolean "useDefaultAlertSetting" : false
userPermission write | read | ack
The permission level of the user that made the API request
String "userPermission" : "write"
checkpoints The checkpoints from the which the website is monitored. This object should reference each location specified in testLocation in addition to an 'Overall' checkpoint. JSON Object "checkpoints" :[ {"id" : 98,"geoInfo" : "Overall","smgId" : 0}, {"id" : 102,"geoInfo" : "Asia - Singapore","smgId" : 5}, {"id" : 101,"geoInfo" : "Europe - Dublin","smgId" : 4}, {"id" : 99,"geoInfo" : "US - San Francisco","smgId" : 3}, {"id" : 97,"geoInfo" : "US - Washington DC","smgId" : 2} ]
serviceProperties The properties associated with the website JSON Object "serviceProperties" : [ {"name" : "billing","value" : "website"}, {"name" : "team","value" : "TechOps"}, {"name" : "production","value" : "true"} ]
isInternal Whether or not the website is internal Boolean "isInternal" : true
collectors The collectors that are monitoring the website, if the website is internal JSON Object "collectors":[{"id":85,"description":"ip-172-31-37-162.us-west-2.compute.internal","hostname":"ip-172-31-37-162.us-west-2.compute.internal","collectorGroupId":1,"collectorGroupName":"@default"}]

 

Additional Ping Service Properties

Website checks of type "ping" have the following properties in addition to the properties listed above for all services:

Property

Description

Type

Example

count The number of packets to send Integer "count" : 20
host The URL to check, without the scheme or protocol (e.g http or https)
E.g. if the URL is "https://www.google.com, then the host="www.google.com"
String "host" : "kittens.test.logicmonitor.com"
percentPktsNotReceiveInTime The percentage of packets that should be returned in the time period specified by timeoutInMSPktsNotReceive for each ping check. Integer "percentPktsNotReceiveInTime" : 70
timeoutInMSPktsNotReceive The time period that the percentage of packets specified by percentPktsNotReceiveInTime must be returned in for each ping check. Integer "timeoutInMSPktsNotReceive" : 300

 

Additional Web Service Properties

Website checks of type "webservice" have the following properties in addition to the properties listed above for all services:

Property

Description

Type

Example

steps An object comprising one or more steps, see the table below for the properties included in each step JSON Object "steps" : [ {"HTTPHeaders" : "","statusCode" : "","followRedirection" : true,"matchType" : "plain","keyword" : "","HTTPBody" : "","HTTPMethod" : "GET","postDataEditType" : "raw","label" : "","url" : "target.com","fullpageLoad" : false,"requireAuth" : false,"auth" : null,"invertMatch" : false,"timeout" : 30,"HTTPVersion" : "1.1","schema" : "http","description" : "","path" : "","enable" : true,"name" : "__step0","domain" : "target.com"} ]
ignoreSSL true | false
Whether or not SSL should be ignored
Boolean "ignoreSSL" : false
pageLoadAlertTimeInMS The time in milliseconds that the page must load within for each step to avoid triggering an alert. Integer "pageLoadAlertTimeInMS" : 30000
script Deprecated (will be re-introduced in the future) - -
method Deprecated (will be re-introduced in the future) - -

 

The JSON object "steps" comprises one or more steps, where each step has the following properties:

Property

Description

Type

Example

HTTPHeaders The headers included in the HTTP request String "HTTPHeaders" : "Content-Type:application/x-www-form-urlencoded"
statusCode The expected response status code for the HTTP request. Multiple status codes may be separated by a comma String "statusCode" : "200"
label Deprecated - -
followRedirection true: The HTTP request will follow any redirects in place
false: The HTTP request will not follow redirects
Boolean "followRedirection" : true
matchType plain | regular | wildcard
The type of interpretation method used to search for the keyword in the response, where
plain: plain text
regular: regular expression
wildcard: glob expression
String "matchType" : "plain"
keyword A string keyword that is searched for in the response to the HTTP request String "keyword" : "LogicMonitor"
HTTPBody The data in the body of the HTTP request String "HTTPBody" : "login_pwd=example&login_userid=sarah"
HTTPMethod GET | HEAD | POST
The HTTP request method 
String "HTTPMethod" : "POST"
postDataEditType raw | json | xml | x-www-form-urlencoded
The format of the POST data
String "postDataEditType" : "x-www-form-urlencoded"
url The URL to check for the step (including the domain) String "url" : "logicmonitor.docebosaas.com/lms/"
fullpageLoad true: The HTTP request will wait for all page elements to load
false: The HTTP request will not wait for all page elements to load
Boolean "fullpageLoad" : false
requireAuth true: Authorization is required for the HTTP request 
false: Authorization is not required for the HTTP request 
Boolean "requireAuth" : false
auth The authentication information required if requireAuth=true. This JSON Object includes:
type: common | basic | ntlm
userName
password
domain (only for type=ntlm)
JSON Object "auth":{"type":"common","userName":"test","password":"example"}
invertMatch true: keyword should not be present in the response
false: keyword should be present in the response
Boolean "invertMatch" : false
timeout 1 | 5 | 15 | 30 | 60 | 120 | 180
The number of seconds that the page must load within before the HTTP request times out
Integer "timeout" : 30
HTTPVersion 1.0 | 1.1
The HTTP version used to check the web service
String "HTTPVersion" : "1.1"
schema http | https
The scheme or protocol associated with the URL to check
String "schema" : "http"
description The description associated with the step String "description" : "Post log in credentials"
path The path associated with the step, where the path is the URL component after the domain String "path" : "/main.html"
enable true | false. Whether or not the step is enabled Boolean "enable" : true
name The numerical sequence of the step. E.g. _step2 String "name" : "__step0"
domain The domain of the service. This is the base URL of the service. String "domain" : "kittens.test.logicmonitor.com"