Advantages of using Groovy in LogicMonitor

Last updated on 18 September, 2024

We recommend that you use the Groovy programming language to develop scripts for customized data collecting and active discovery. The advantages of using Groovy in Logicmonitor are:

  • Platform compatibility – the same script can be used by both Linux collector and Windows collectors.
  • Access collector’s capability – the collector exports its capabilities (such as snmp, http, ssh, telnet, etc) via an easy-to-use groovy API so your script can directly use these functions without any 3rd party software.
  • Accessing all host properties  – all properties of a host are accessible from groovy scripts via accessing the map hostProps.get(“property“). With other scripting languages, this requires passing in the properties as parameters. But in groovy, it’s as simple as accessing the hostname via: hostname = hostProps.get(“system.hostname”);

To learn more about how to use external scripts to collect data, please see Script-based Data Collection and BatchScript Data Collection.