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

Run/control External Processes

Last updated on 18 September, 2024

The most robust way to call external processes is to use the Groovy method waitForProcessOutput.

For example:

command="../bin/ipmiutil sensor -c -N " + hostname + " -U "+User+" -P " +Pass
 
 def sout = new StringBuffer()
 def serr = new StringBuffer()
 
 def proc = command.execute()
 proc.waitForProcessOutput(sout, serr)
 
 if(proc.exitValue() == 0) {
     output=sout.toString()
     output.eachLine {
        if (it =~ / Full /) {
            elements=it.split(/ *\| */)
            if ( elements[5]=="OK" ) { //only discover those reporting a status
                 println elements[0]+"##"+elements[4]+":"+elements[3]
                 }
            }
       }
 else {
 // error handling ...}

Get Started with LogicMonitor