Forum Discussion

Kelemvor's avatar
Kelemvor
Icon for Expert rankExpert
12 months ago
Solved

Running a Perl script on an AIX box over SSH?

Hi,

We have an old monitoring system that we’re trying to decommission and move everything into LM.  The current system connects to an AIX server using an SSH Key, and then runs a perl script that’s located in a particular folder.  It then takes the output from that script and determines if there’s an alert condition to tell someone about.  I need to move this same functionality into LM.

  • I’m assuming the SSH access part shouldn’t be a big deal.  I can either manually setup a username/password or I found into on putting a key in LM somewhere and using that.
  • Once LM can connect to the server, can it launch a script file that’s located on the server?  I’m not sure if I need to recreate the script inside of LM, or if it can just tell the server to execute the script it already has.
  • If the script runs remotely, can LM then parse the returned data to determine if something is an error or not?

If anyone has any tutorials or anything on how I can start working on this, let me know.  I don’t know anything about scripting and LM and so far, don’t really know where to start.

Thanks!

  • Yep, this is totally doable. You can use Expect or Jsch. Once you ssh into the device, you’ll execute the command and fetch the output that’s printed to screen (hopefully your existing script prints its output to screen and doesn’t take super long to run). 

    Once you have the output, you’ll need to work with it to get it into a format that LM needs in order to parse it properly. What kind of data? Single instance or multi-instance? Numeric data? Blobs of text? List of events?

1 Reply

  • Yep, this is totally doable. You can use Expect or Jsch. Once you ssh into the device, you’ll execute the command and fetch the output that’s printed to screen (hopefully your existing script prints its output to screen and doesn’t take super long to run). 

    Once you have the output, you’ll need to work with it to get it into a format that LM needs in order to parse it properly. What kind of data? Single instance or multi-instance? Numeric data? Blobs of text? List of events?