Jared Thompson

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jared Thompson

  • Rank
    Community Member
  1. I am collecting data via Embedded Groovy Code, the script returns a status (GOOD/WARNING/BAD) and also returns a text string explaining what the error message is. I have a datapoint, and it triggers on the GOOD/BAD keywords. I would also like to add the entire raw message to the Alert Message Template so that I can display WHY the message is being displayed. There are several tokens available, but there does not seem to be anything available to display the raw output of the script, before the Datapoint touched it. For example, this would be in my Alert Message Template for my Datapoint: The script instance ##INSTANCE## on ##HOST## has failed with error ##VALUE## ##RAWMESSAGE## (##RAWMESSAGE## does not exist...)
  2. I am attempting to SSH into several servers using Groovy Script, in the following manner: import com.santaba.agent.groovyapi.expect.Expect hostname = hostProps.get("system.hostname"); sshuser=hostProps.get("ssh.user"); sshpass=hostProps.get("ssh.pass"); cli = Expect.open(hostname,sshuser,sshpass) Instead of logging in with a username and password, I wish to login with a client certificate instead. I reached out to LM support, and they confirmed that certificate based ssh authentication is not supported in Groovy Script. To workaround this, I am doing this instead, where the certificate is installed on my "Jump Host": import com.santaba.agent.groovyapi.expect.Expect hostname = hostProps.get("system.hostname"); sshuser=hostProps.get("ssh.user"); sshpass=hostProps.get("ssh.pass"); sshjumphost=hostProps.get("ssh.jumphost"); //First, open SSH to our JumpHost cli = Expect.open(sshjumphost,sshuser,sshpass) //Next, execute remote ssh command on the host, from the jumphost's ssh session cli.send("/usr/bin/ssh " + sshuser + "@" + hostname + " /home/someuser/somecommand \n") cli.send("exit \n") cli.expectClose() cli.stdout().eachLine { line -> if ( line =~ /(GOOD|ERROR) - (.*)/ ) { println line } } This works well as a workaround, but I would prefer to not have to SSH twice to get the value.