Skip to content

Script Lint

LMDA Composer runs static lint while you edit Groovy and PowerShell scripts. Issues appear in the Problems panel under the lmda-lint source — separate from run-time validation when you execute a script.

Script lint diagnostics in the Problems panel

Lint is on by default. Toggle it with lmda.enableModuleLint in Settings, or search @lmda lint.

Lint respects your lmda.executionMode setting (freeform, ad, collection, batchcollection) and, when a script is loaded from the LogicModules browser, the bound module type (for example PropertySource).

Rules are inspired by LogicMonitor monitoring-recipes patterns and LogicMonitor module scripting conventions.

PatternSeverityWhat it means
hostProps.get("name")InfoProperty will be substituted on the collector when a device is selected
##TOKEN## in PowerShellInfoToken will be substituted when a device is selected
Unknown property on selected deviceWarningProperty name was not found on the device you picked in the status bar

When a device is selected and the portal API is reachable, LMDA validates host property names against live device properties.

PropertySource scripts may only assign auto.* properties or system.categories. Other system.* names are errors.

// Good
println "auto.cisco.serial_number=" + serial
emit.property("auto.vendor", vendor)
// Error — system.hostname cannot be set by a PropertySource
println "system.hostname=" + hostname

This matches LogicMonitor guidance: PropertySources discover inventory-style properties with the auto. prefix. See Creating PropertySources and examples in monitoring-recipes.

When execution mode is batchcollection, lint flags patterns that break batch scripts:

IssueSeverity
instanceProps.get() inside BatchScript sourceError — use datasourceinstanceProps and iterate instances
##WILDVALUE## in BatchScript sourceWarning — wildvalues belong in datapoint keys, not script source
##WILDALIAS## in BatchScript sourceWarning — not available inside BatchScript source
IssueSeverity
Write-Host for collection dataWarning — use Write-Output so stdout reaches the collector; Write-Host can cause BatchScript timeouts

Debug-style Write-Host lines (for example with $debug) are ignored.

ModeHint
adprintln without => or ## may not match AD instance line format
collectionReturning a map/list with return [...] — collection output is usually printed or emitted
SettingRole
lmda.enableModuleLintTurn static lint on or off
lmda.executionModeBatchScript, AD, and collection hint rules
lmda.defaultDeviceHostnameDevice used when validating property tokens

See Settings for the full list.