REST API Developer's Guide

About the Widget Resource

You can use LogicMonitor's REST API to programmatically manage your dashboard widgets.

 

Using LogicMonitor's REST API you can:

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

Resource URI:

/dashboard/widgets

 

Resource Properties:

All widgets have the following properties:

Property

Description

Type

Example

id The Id of the widget Integer "id":23
name The name of the widget String "name":"Apache Requests"
description The description of the widget String "description":"My Widget Description"
type alert | deviceNOC | html | serviceOverallStatus | sgraph | ngraph | serviceNOC | serviceSLA | bigNumber | gmap | serviceIndividualStatus | gauge | pieChart | ngraph | batchjob" String "type":"alert"
lastUpdatedOn The time that corresponds to when the widget was last updated, in epoch format Integer "lastUpdatedOn":1453916464
lastUpdatedBy The user that last updated the widget String "lastUpdatedBy":"Sarah"
dashboardId The id of the dashboard the widget belongs to Integer "dashboardId":50
columnIdx The column of widget's position on the dashboard. The far left column is column=0 Integer "columnIdx":1
order The order in which the widget is displayed in the column. The top position is order=0 Integer "order":0
theme The color scheme of the widget. Options are: borderPurple | borderGray | borderBlue | solidPurple | solidGray | solidBlue | simplePurple | simpleBlue | simpleGray | newBorderGray | newBorderBlue | newBorderDarkBlue | newSolidGray | newSolidBlue | newSolidDarkBlue | newSimpleGray | newSimpleBlue |newSimpleDarkBlue String "theme":"simplePurple"
colSpan The number of columns the widget's width should consume Integer "colSpan":1
rowSpan The number of rows the widget's height should consume Integer "rowSpan":1
userPermission The permission level of the user who last modified the widget String "userPermission":"write"
interval The refresh interval of the widget, in minutes Integer "interval":1
timescale The default timescale of the widget String "timescale":"day"
extra Only applies to alert widgets JSON Object -

 

Alert Widget Properties

All widgets of type alert (alert widgets) include an object extra that contains any UI display settings configured for the widget, and a filters object with the following fields:

Property

Description

Type

Example

group Displayed alerts must be associated with groups that meet this filter criteria. Glob is accepted, and * and an empty string both indicate all groups. String "group":"Relay*"
host Displayed alerts must be associated with devices that meet this filter criteria. Glob is accepted, and * and an empty string both indicate all devices. String "host":"*"
dataSource Displayed alerts must be associated with datasources that meet this filter criteria. Glob is accepted, and * and an empty string both indicate all datasources. String "dataSource":"*"
instance Displayed alerts must be associated with instances that meet this filter criteria. Glob is accepted, and * and an empty string both match all instances. String "instance":"HTTP_Page-instance0"
dataPoint Displayed alerts must be associated with datapoints that meet this filter criteria. Glob is accepted, and * and an empty string both match all datapoints. String "dataPoint":"*"
severity Displayed alerts must have a severity that satisfies this criteria. Multiple severities are separated by commas. String "severity":"warn"
acked Displayed alerts must have an acknowledgement status that satisfies this criteria. String "acked":"all"
sdted Displayed alerts must have an SDT status that meets this criteria. String "sdted":"all"
rule Displayed alerts must match a rule that satisfies this filter. Glob is accepted, and * and an empty string both match all rules. String "rule":"*"
chain Displayed alerts must be routed to an escalation chain that satisfies this filter. Glob is accepted, and * and an empty string both match all escalation chains. String "chain":"*"
cleared Displayed alerts must be active if cleared=no, and must have cleared in the past 7 days if cleared=all. String "cleared":"no"

 

Batchjob Widget Properties

All widgets of type batchjob (batchjob widgets) include the following fields:

Property

Description

Type

Example

deviceDisplayName The display name of the device in LogicMonitor that the batchjob is running on String "deviceDisplayName":"10.36.11.240"
batchJobName The name of the batchjob definition in LogicMonitor String "batchJobName":"myBatchJob"
batchJobId The id of the batchjob definition in LogicMonitor Integer "batchJobId":16

 

Big Number Widget

All widgets of type bigNumber (big number widgets) must include an object bigNumberInfo with the following fields:

Property

Description

Type

Example

dataPoints The datapoints included in the widget. Note that a datapoint must be referenced in the bigNumberItems object in order to be displayed. JSON Object "dataPoints":[{"deviceGroupFullPath":"Website","deviceDisplayName":"ip-172-31-37-162.us-west-2.compute.interal","dataSourceFullName":"CPU (NetSNMPCPUwithCores)","dataSourceId":559,"instanceName":"NetSNMPCPUwithCores-Core Count: 1","dataPointName":"CPUBusyPercent","dataPointId":2899,"name":"CPUBusyPercent","aggregateFunction":"max"}]
virtualDataPoints The virtual datapoints included in the widget. Note that a virtual datapoint must be referenced in the bigNumberItems object in order to be displayed. JSON Object "virtualDataPoints":[{"name":"CPU Idle Percent","rpn":"100 - CPUBusyPercent"}]
bigNumberItems The datapoints and virtual datapoints whose values should be displayed in the big number widget JSON Object "bigNumberItems":[{"position":1,"rightLabel":"%","bottomLabel":"","dataPointName":"CPUBusyPercent","rounding":"0"},{"position":3,"rightLabel":"","bottomLabel":"%","dataPointName":"CPU Idle Percent","rounding":"1"}]

 

 

Custom Graph Widget Properties

All widgets of type cgraph (custom graph widgets) must include an object graphInfo with the following fields:

Property

Description

Type

Example

id The unique id of the custom graph displayed by this widget (not to be confused with the widget id) Integer "id":175
title The custom graph title String "title":"CPU Busy Percent"
aggregate true: You can set this field to true to aggregate results into one line.
false: Results will not be aggregated.
Boolean "aggregate":true
top10Only true: You can set this field to true to limit results to 10 lines. Note that only one of aggregate and top10Only can be set to true, as results cannot be both aggregated and limited.
false: Results will not be limited
Boolean "top10Only":true
base1024 Change base scale from 1000 to 1024 Boolean "base1024":false
maxValue The maximum value that should be displayed on the y-axis Integer "maxValue":100
minValue The minimum value that should be displayed on the y-axis Integer "minValue":0
verticalLabel The label that will be display along the y axis String "verticalLabel":"percent"
height The number of pixels tall the graph is. If the widget rowSpan is set to 1, this value will be 120. Integer "height":120
width The number of pixels wide the graph is. If the widget rowSpan is set to 1, this value will be 360. Integer "width":360
dataPoints The datapoints added to the widget (note that a datapoint must be referenced in a graph line to be displayed) JSON Object "dataPoints":[{"id":13,"name":"CPU","consolidateFunction":2,"customGraphId":202,"dataPointId":2164,"dataPointName":"CPU","deviceDisplayName":"172.31.36.125","dataSourceFullName":"CPU Cores-","instanceName":"CPU Cores-196608","deviceId":206},{"id":14,"name":"ExtendedStatusNotEnabled","consolidateFunction":2,"customGraphId":202,"dataPointId":622,"dataPointName":"ExtendedStatusNotEnabled","deviceDisplayName":"ip-172-31-37-162.us-west-2.compute.interal","dataSourceFullName":"Apache-","instanceName":"Apache-80","deviceId":39}]
virtualDataPoints The virtual datapoints added to the widget (note that a virtual datapoint must be referenced in a graph line to be displayed) JSON Object "virtualDataPoints":[{"id":43,"customGraphId":202,"name":"VirtualDatapoint","rpn":"(ExtendedStatusNotEnabled+1000)/50"}]
graphLines The graph lines to be displayed in the widget, where graph lines should reference the dataPoints and virtualDataPoints. JSON Object "graphLines":[{"color":"teal","customGraphId":202,"dataPointName":"ExtendedStatusNotEnabled","id":304,"legend":"##HOSTNAME##_##DATASOURCENAME##_##INSTANCE##","type":3},{"color":"aqua","customGraphId":202,"dataPointName":"VirtualDatapoint","id":305,"legend":"","type":2},{"color":"Auto","customGraphId":202,"dataPointName":"CPU","id":306,"legend":"##HOSTNAME##_##DATASOURCENAME##_##INSTANCE##","type":1}]

 

Device NOC Widget Properties

All widgets of type deviceNOC (device NOC widgets) include the following fields:

Property

Description

Type

Example

sortBy How NOC items are sorted String "sortBy":"name"
displayColumn The maximum number columns displayed in the NOC widget Integer "displayColumn":3
displayWarnAlert Whether or not warning alerts are displayed in the NOC widget Boolean "displayWarnAlert":true
displayErrorAlert Whether or not error alerts are displayed in the NOC widget Boolean "displayErrorAlert":true
displayCriticalAlert Whether or not critical alerts are displayed in the NOC widget Boolean "displayCriticalAlert":true
ackChecked Whether or not acknowledgements are displayed in the NOC widget Boolean "ackChecked":true
sdtChecked Whether or not SDTs are displayed in the NOC widget Boolean "sdtChecked":true
items The NOC items JSON Object "items":[{"deviceGroupFullPath":"*","deviceDisplayName":"ip-172-31-33-214.us-west-2.compute.internal","dataSourceDisplayName":"HTTP-","instanceName":"*","dataPointName":"*","groupBy":"device","name":"##HOSTNAME## - HTTP content/function"},{"deviceGroupFullPath":"*","deviceDisplayName":"ip-172-31-33-214.us-west-2.compute.internal","dataSourceDisplayName":"Apache-","instanceName":"*","dataPointName":"*","groupBy":"device","name":"##HOSTNAME## - Apache"},{"deviceGroupFullPath":"*","deviceDisplayName":"ip-172-31-33-214.us-west-2.compute.internal","dataSourceDisplayName":"Host Status","instanceName":"*","dataPointName":"*","groupBy":"device","name":"##HOSTNAME## - Host Status"}]

 

HTML Widget Properties

All widgets of type html (html widgets) include an object 'resources' with the following fields:

Property

Description

Type

Example

type html | iframe String "type":"html"
URL If type = html this should be a url, if type = iframe this should be an iframe. String "URL":"https://api.logicmonitor.com"

 

Gauge Widget Properties

All widgets of type gauge (gauge widgets) include the following fields:

Property

Description

Type

Example

showPeak Whether or not the peak value is displayed on the gauge widget Boolean "showPeak":false
peakTimeRange The time range over which the peak value is determined String "peakTimeRange":"30days"
legend The legend for the widget, displayed underneath the gauge String "legend":"Apache Accesses"
maxValue The maximum value of the gauge widget, displayed on the right side of the gauge Integer "maxValue":5.0
minValue The minimum value of the gauge widget, displayed on the left side of the gauge Integer "minValue":0.0
dataPoint The datapoint whose value is displayed in the gauge widget JSON Object "dataPoint":{"deviceGroupFullPath":"*","deviceDisplayName":"ip-172-31-33-214.us-west-2.compute.internal","dataSourceFullName":"Apache-","dataSourceId":124,"instanceName":"*","dataPointName":"BusyWorkers","dataPointId":626,"aggregateFunction":"max","dataSeries":"average","rpn":""}

 

Google Map Widget Properties

All widgets of type gmap (google map widgets) include an object mapPoints, where each mapPoint has the following fields:

Property

Description

Type

Example

type Whether or not the mapPoint represents a device or a group String "type":"group"
deviceGroupFullPath The full path of the device group associated with the map point. This may be the group the map point represents, or the group of the device that the map point represents. String "deviceGroupFullPath":"Production/AWS"
deviceDisplayName The display name of the device the map point represents (if type=device). This field supports Glob (*). String "deviceDisplayName":"ProductionServer23"
hasLocation Whether or not the specified group or device has a location property defined. Boolean "hasLocation":true

 

Normal Graph Widget (Device Graphs) Properties

All widgets of type ngraph (pinned device level graphs) include the following fields:

Property

Description

Type

Example

hId The id of the device the graph was pinned from Integer "hId":199
dsiId The id of the datasource instance the graph was pinned from Integer "dsiId":2133
graphId The id of the datasource graph this widget was pinned from Integer "graphId":1042
graphName The id of the datasource graph this widget was pinned from String "graphName":Connections
hostName The display name of the device the graph was pinned from String "hostName":"server29.us-east-1.compute.internal"
dsName The name (not display name) of the datasource the graph is associated with String "dsName":"Mysql-"
dsiName The name of the instance the graph was pinned from String "dsiName":"3306"

 

Pie Chart Widget Properties

All widgets of type pieChart (pie chart widgets) include an object pieChartInfo with the following fields:

Property

Description

Type

Example

title The title that will be displayed above the pie chart String "title":"CostPerRegion"
showLabelsAndLinesOnPC Whether or not labels and lines should be displayed on the pie chart Boolean "showLabelsAndLinesOnPC":false
maxSlicesCanBeShown The maximum number of slices you'd like displayed in the pie chart Integer "maxSlicesCanBeShown":10
groupRemainingAsOthers If the number of slices exceeds the maxSlicesCanBeShown, this value indicates whether the remaining slices should be grouped together Boolean "groupRemainingAsOthers":false
dataPoints The datapoints added to the widget. Note that datapoints must be included in the pieChartItems object to be displayed in the widget. JSON Object "dataPoints":[{"deviceGroupFullPath":"*","deviceDisplayName":"eculler01.us-east-1.logicmonitor.net","dataSourceFullName":"Ping","dataSourceId":21,"instanceName":"Ping","dataPointName":"maxrtt","dataPointId":123,"name":"maxrtt","globMode":true,"top10":true,"aggregate":false,"aggregateFunction":"SUM"}]
virtualDataPoints The virtual datapoints added to the widget. Note that virtual datapoints must be included in the pieChartItems object to be displayed in the widget. JSON Object "virtualDataPoints":[{"name":"1","rpn":"maxrtt + 1000"},{"name":"2","rpn":"maxrtt + 2000"},{"name":"3","rpn":"maxrtt +500"},{"name":"4","rpn":"maxrtt + 4000"},{"name":"5","rpn":"maxrtt + 100"}]
pieChartItems The datapoints and virtual datapoints that will be displayed in the pie chart JSON Object "pieChartItems":[{"dataPointName":"5","legend":"SA-EAST1","color":"Auto"},{"dataPointName":"4","legend":"EU-CENTRAL1","color":"Auto"},{"dataPointName":"3","legend":"US-WEST2","color":"Auto"},{"dataPointName":"2","legend":"EU-WEST1","color":"Auto"},{"dataPointName":"1","legend":"US-WEST1","color":"Auto"}]

 

Service Individual Status Widget Properties

All widgets of type serviceIndividualStatus (service individual status widgets) include the following fields:

Property

Description

Type

Example

serviceFolderId The id of the group associated with the service that status is dispayed for Integer "serviceFolderId":12
serviceId The id of the service that status is displayed for Integer "serviceId":false
graph The service graph name - this should always be checkpointStatus String "graph":"checkpointStatus"
serviceName The name of the service that status is displayed for String "serviceName":"CName_check"
serviceFolderName The group associated with the service that status is displayed for String "serviceFolderName":"Production"
locations The checkpoint locations for which data is displayed JSON Object "locations":[{"smgId":2,"geoInfo":"US - Washington DC","selected":true},{"smgId":3,"geoInfo":"US - San Francisco","selected":true},{"smgId":4,"geoInfo":"Europe - Dublin","selected":true},{"smgId":5,"geoInfo":"Asia - Singapore","selected":true},{"smgId":6,"geoInfo":"Sydney - Australia","selected":false}]

 

Service NOC Widget Properties  

All widgets of type serviceNOC (service NOC widgets) include the following fields:

Property

Description

Type

Example

sortBy How NOC items are sorted String "sortBy":"name"
displayColumn The maximum number columns displayed in the NOC widget Integer "displayColumn":3
displayWarnAlert Whether or not warning alerts are displayed in the NOC widget Boolean "displayWarnAlert":true
displayErrorAlert Whether or not error alerts are displayed in the NOC widget Boolean "displayErrorAlert":true
displayCriticalAlert Whether or not critical alerts are displayed in the NOC widget Boolean "displayCriticalAlert":true
ackChecked Whether or not acknowledgements are displayed in the NOC widget Boolean "ackChecked":true
sdtChecked Whether or not SDTs are displayed in the NOC widget Boolean "sdtChecked":true
items The NOC items JSON Object "items":[{"serviceGroupName":"Production","serviceName":"*","groupBy":"service","name":"##SERVICE##"},{"serviceGroupName":"Internal Services","serviceName":"*","groupBy":"service","name":"##SERVICE##"}

 

Service Overall Status Widget Properties

All widgets of type serviceOverallStatus (service overall status widgets) include a string serviceSelectMode set to either normal or group, and an object selectedServices with the following fields:

Property

Description

Type

Example

serviceGroupId The id of the group for which member service status should be displayed Integer "serviceGroupId":1
serviceGroupName The name of the group for which member service status should be displayed String "serviceGroupName":"sarah"
chooseAll Whether or not all services in the group are included in the widget (this is equivalent to wildcarding the services field) Boolean "chooseAll":false
services The service that status is displayed for JSON Object "services":[{"id":21,"name":"main page"}]

 

Service SLA Widget Properties  

The following properties are specific to the Service SLA Widget:

All widgets of type serviceSLA (service SLA widgets) include the following fields:

Property

Description

Type

Example

items The services that should be used to compute the SLA JSON Object "items":[{"serviceGroup":"Production","service":"*"},{"serviceGroup":"Internal Services","service":"*"}]

 

Device SLA Widget Properties  

The following properties are specific to the deviceSLA widgets:

Property

Description

Type

Example

metrics The metrics (datapoints) that should be used to compute the SLA, where each service should include groupName (can be *), deviceName (can be *), dataSourceId or dataSourceFullName, instances (can be *), metric (datapoint), threshold, and exclusionSDTType (empty string means SDT periods will not be excluded, "group" means SDT periods at the device group level will be excluded, and "device" means SDT periods at the device level will be excluded) JSON Object "metrics":[{"groupName":"*","deviceName":"*","dataSourceFullName":"EC2 (AWS_EC2)","instances":"*","metric":"CPUUtilization","threshold":"< 1"}]
daysInWeek The days that SLA should be computed for, separated by commas. 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thursday, 6=Friday, 7=Saturday. String "daysInWeek":"1,2,3,4,5,6,7"
periodInOneDay The period during the selected days that the SLA should be computed for. * = all day, or a time range can be specified in the format of "hh:mm TO hh:mm", e.g. "01:15 TO 17:15". String "periodInOneDay":"08:00 TO 12:00"
unmonitoredTimeType How no data should be treated: 0 = unmonitored time will be ignored & subtracted from the total possible time, 1 = unmonitored time will be subtracted from uptime and counted as a violation, 2 = unmonitored time will be added to uptime and counted as available. Integer "unmonitoredTimeType":0
displayType Whether or not selected metrics should be combined into one number (displayType:0) or should be displayed individually, up to four metrics (displayType:1). Integer "displayType":0
bottomLabel The services that should be used to compute the SLA, where each service should include serviceGroup and service String "bottomLabel":"Time Available"

 

Service Graph Widget (graphs pinned from the services tab) Properties

All widgets of type sgraph (graph pinned from the services page) include the following fields:

Property

Description

Type

Example

serviceCheckpointId The id of the checkpoint this graph is associated with Integer "serviceCheckpointId":99
graph The name of the graph that was added as a widget String "graph":"responseTime"
serviceName The name of the service this graph is associated with String "serviceName":"CName_check"
geoInfo The checkpoint location this graph is associated with String "geoInfo":"US - San Francisco"

 

Table Widget Properties

All widgets of type table (table widgets) include three additional objects. A 'columns' object is included, where each column has the following fields:

Property

Description

Type

Example

columnName The name for the column String "columnName":"CPU"
dataPoint The DataSource and DataPoint that are selected for the column JSON Object "dataPoint":{"dataSourceId":7960532,"isMultiple":true,"dataPointId":5349,"dataSourceFullName":"NetSNMPCPUwithCores","dataPointName":"CPUBusyPercent"}
alternateDataPoints Any alternate DataSource and DataPoint combinations that should be selected for the column JSON Object "alternateDataPoints":[{"dataSourceId":158,"isMultiple":true,"dataPointId":822,"dataSourceFullName":"WinCPU","dataPointName":"CPUBusyPercent"}]
enableForecast Whether or not forecasting is enabled Boolean "enableForecast":true
roundingDecimal The number of decimal points to round the value to. Options are 0, 1 and 2. Integer "roundingDecimal":0
rpn The expression in this field will be performed on the datapoint. The Column name should be referenced as the datapoint. String "rpn":"100-CPU"

 

And a 'rows' object is included, where each row has the following fields:

Property

Description

Type

Example

label The label for the row String "label":"ProdServer1"
groupId The ID of the group selected for the row Integer "groupId":7
groupFullPath The full path of the group selected for the row String "groupFullPath":"US - LA/Website"
deviceId The id of the device selected for the row Integer "deviceId":12
deviceDisplayName The display name of the device selected for the row String "deviceDisplayName":"prodServer1"
instances The instances for each column of the row JSON Object "instances":[{"instanceId":96678897,"instanceName":"core1","dataPointName":"CPUBusyPercent","dataPointId":5349,"validationStatusCode":0}]

 

And a 'forecast' object is included, with following fields:

Property

Description

Type

Example

timeRange The training data time range (the data on which forecasting is calculated). Options are Last 7 days, Last 14 days, Last 30 days, Last calendar month, Last 365 days or a custom time range String "timeRange":"Last 7 days"
severity The minimum alert severity the forecasting should include, one of warn | error | critical String "severity":"warn"
confidence The percent confidence that should be required for a forecasted alert. Integer "confidence":90

 

Text Widget Properties

All widgets of type text (text widgets) must include a content field:

Property

Description

Type

Example

content The html content that the text widget should display String "content":"<p>Text Widget Content</p>"