Skip to content

Script Editor

LMDA Composer uses the Monaco editor—the same editor that powers VS Code—providing a professional coding experience for Groovy and PowerShell scripts.

Groovy is the primary scripting language for LogicMonitor modules:

  • Full syntax highlighting for keywords, strings, and comments
  • Bracket matching and auto-closing
  • Code folding for classes and methods
  • String interpolation highlighting (${variable})
  • GString and regular expression support
// Example Groovy script
def host = hostProps.get("system.hostname")
def result = Snmp.get(host, "1.3.6.1.2.1.1.5.0")
println "SysName=${result}"
return 0

Use the language toggle in the toolbar to switch between Groovy and PowerShell:

  1. Click the language badge (Groovy or PowerShell) in the toolbar
  2. If you have unsaved changes, a confirmation dialog appears
  3. Confirm to switch and reset to the default template, or cancel to keep your current script

FeatureDescription
Find & ReplaceCtrl+F to search. Supports regex, case-sensitive, and whole word matching. Ctrl+H for replace.
Multiple CursorsAlt+Click to add cursors. Ctrl+D selects next occurrence. Edit multiple locations at once.
Code FoldingClick fold icons in the gutter to collapse methods, classes, and comment blocks.
Go to LineCtrl+G to jump to any line number. Essential for navigating large scripts.
Bracket MatchingMatching brackets are highlighted automatically when cursor is adjacent.
Auto-indentationSmart indentation based on code structure.
ShortcutAction
Ctrl+FFind
Ctrl+HFind & Replace
Ctrl+GGo to Line
Ctrl+DSelect Next Occurrence
Ctrl+/Toggle Comment
Ctrl+]Indent Line
Ctrl+[Outdent Line
Alt+↑/↓Move Line Up/Down

When writing PowerShell scripts, you can use LogicMonitor’s token syntax to access device properties:

Terminal window
$hostname = "##SYSTEM.HOSTNAME##"
$displayName = "##SYSTEM.DISPLAYNAME##"
$customProp = "##auto.custom.property##"

When you run the script, LMDA Composer:

  1. Detects ##PROPERTY.NAME## patterns in your code
  2. Fetches device properties from the selected device
  3. Substitutes tokens with actual property values
  4. Executes the script with substituted values

Customize the editor experience in Settings (Ctrl+, / Cmd+,):

Settings dialog with editor configuration options
SettingDescription
Font SizeAdjust from 10px to 24px for comfortable reading on any display
Tab SizeSet indentation width from 2 to 8 spaces (default: 2)
Word WrapWrap long lines within the viewport instead of horizontal scrolling
MinimapToggle the code overview minimap on the right side of the editor

Each open file gets its own tab in the tab bar.

  • Click New Script on the welcome screen
  • Press Ctrl+K, N / Cmd+K, N
  • Click Open File to load from your local disk
  • Use Import from LMX to load scripts from portal modules
  • Open a saved module folder with Open Module Folder
  • Click the × on any tab to close it
  • Right-click a tab for options: Rename, Close, Close Others, Close All
  • Tabs with unsaved changes show a dot indicator
  • Press Ctrl+W / Cmd+W to close the active tab

LogicMonitor scripts have a 64,000 character limit. The status bar displays your current count with visual warnings:

Character CountStatus
< 50,000Normal
50,000+Warning
60,000+Alert
> 64,000Error — Cannot save