LogicMonitor + Catchpoint: 自律型ITの新時代へ

さらに詳しく

外部プロセスを呼び出す最も堅牢な方法は、Groovyメソッドを使用することです waitForProcessOutput。

具体的な例を挙げますと、以下の通りです。

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"){//ステータスを報告しているもののみを検出するprintln elements [0] + "##" + elements [4] + ":" + elements [3 ]}}} else {//エラー処理...}

14日間フルアクセス LogicMonitor プラットフォーム