Join fellow LogicMonitor users at the Elevate Community Conference and get hands-on with our latest product innovations.

Register Now

Resources

Explore our blogs, guides, case studies, eBooks, and more actionable insights to enhance your IT monitoring and observability.

View Resources

About us

Get to know LogicMonitor and our team.

About us

Documentation

Read through our documentation, check out our latest release notes, or submit a ticket to our world-class customer service team.

View Resources

DNS Scripting Methods

Last updated on 18 September, 2024

The Collector includes dnsjava (dnsjava.org) to allow scripting of DNS based objects.

To determine which version of dnsjava is installed in your environment, navigate to the Collector installation folder and verify the version installed:

  • Default library path on Windows – C:\Program Files\LogicMonitor\agent\lib
  • Default path on Linux – /usr/local/logicmonitor/agent/lib

See https://github.com/dnsjava/dnsjava for documentation on the version of dnsjava installed in your environment.

As a simple example, a datasource could use a script such as the below to ensure that the local DNS resolvers are working:

import org.xbill.DNS.*;

records = new Lookup("gmail.com", Type.MX).run()

records.each() {
println it
}

return (0);

Get Started with LogicMonitor