I want to be able to use the "Execute Script" action to run a command on a remote Linux server, something equivalent to:

ssh xxxx@xxx.com "systemctl status tomcat8-instance1"

I have tested this from a terminal and it works, but I cannot make the "Execute Script" work. I have tried a couple of commands but when I try to test it the program hangs for a couple of minutes "Configure Monitor Script (Not Responding)" and then returns with: "Failed to send the request to the service. Error Details: [async timeout][response=Timed out waiting for response]"

I did configure the security credentials

asked 22 Nov '18, 06:36

run66's gravatar image

run66
1003712
accept rate: 14%


Same problem using version 7.1.1.54

Target was to a cisco router (catalyst 2960)

SSH credentials configured in the device

I placed in the script the following commands:

conf t

int gi2/0/4

shut

as seen above, just a linebreak between commands and no quotation marks :(

link

answered 27 Nov '18, 14:33

alejnadro's gravatar image

alejnadro
4279
accept rate: 0%

Hi runn66,

The first thing to check is to make sure that you have the correct credentials added for the Linux server. Right click on the server and select Type & Credentials > Set Compute/Device Type. In this menu make sure that you have SSH selected and then click on the button to the right to add creds for the server.

When you have the creds added then turn on Debug Logging and Data Logging. To do this go to Settings > System Settings. Then check the two boxes called Enable Debug Logging and Enable Data Logging. Once you have this done, run your script monitor and the information that is sent and received by the service will be recorded in the service log file. Open you service log file and Look for "SSH", you will be able to see what was sent by your monitor and what was received including any errors.

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 27 Nov '18, 16:42

Quinn's gravatar image

Quinn ♦♦
14.5k3925
accept rate: 35%

Hi Quinn

Ok - So here's the result of from the log:

01-11-2019, 09:25:10.116, TID:20088, PID:48812, DATA: Doing SSH session handshake with WWW.KLE-ONLINE.DK 01-11-2019, 09:25:10.122, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:10.220, TID:20088, PID:48812, DATA: SSH authorizing with Password. Username=[root] PasswordLen=8 01-11-2019, 09:25:10.227, TID:20088, PID:48812, SSH authenticated via username 01-11-2019, 09:25:10.435, TID:20088, PID:48812, DATA: SSH channel successfully opened 01-11-2019, 09:25:10.435, TID:20088, PID:48812, DATA: SSH pty 'vanilla' successfully requested 01-11-2019, 09:25:10.435, TID:20088, PID:48812, DATA: SSH shell successfully opened 01-11-2019, 09:25:10.628, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:10.924, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=299, text=Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-042stab133.2 x86_64) 01-11-2019, 09:25:10.924, TID:20088, PID:48812, DATA: SSH writing script to channel 01-11-2019, 09:25:10.924, TID:20088, PID:48812, DATA: SSH finished writing script to channel - code/written = 46 01-11-2019, 09:25:11.122, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:11.438, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=1931, text=systemctl status tomcat8-instance1 01-11-2019, 09:25:11.622, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:11.936, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:12.129, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:12.430, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:12.630, TID:50060, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:12.937, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=-37, text=

Then after a couple of minutes I get a time out that looks like this: 01-11-2019, 09:25:44.719, TID:50104, PID:48812, ERROR: Timing out and disconnecting SSH session 01-11-2019, 09:25:44.940, TID:20088, PID:48812, DATA: Received from SSH channel: code/len=-37, text= 01-11-2019, 09:25:45.129, TID:50060, PID:48812, ERROR: Error while receiving SSH output from script on WWW.KLE-ONLINE.DK. Err=-43 01-11-2019, 09:25:45.129, TID:50060, PID:48812, DBG: SSH final/complete received data: 01-11-2019, 09:25:45.129, TID:50060, PID:48812, DATA: Freeing SSH channel 01-11-2019, 09:25:45.129, TID:50060, PID:48812, DBG: Script error: Error while receiving SSH output from script on WWW.KLE-ONLINE.DK. Err=-43 01-11-2019, 09:25:45.129, TID:50060, PID:48812, ERROR: SCRIPT_MON: SSH: scriptErr = Error while receiving SSH output from script on WWW.KLE-ONLINE.DK. Err=-43 01-11-2019, 09:25:45.129, TID:50060, PID:48812, DBG: SCRIPT_MON: status=4, desc=Error while receiving SSH output from script on WWW.KLE-ONLINE.DK. Err=-43

What to make of this?

Rune

link

answered 11 Jan '19, 03:32

run66's gravatar image

run66
1003712
accept rate: 14%

Hi Rune,

Have you tried adding a command after the systemctl command to see if it gets executed? Something like an echo would work.

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 11 Jan '19, 14:27

Quinn's gravatar image

Quinn ♦♦
14.5k3925
accept rate: 35%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×16
×6
×6

Asked: 22 Nov '18, 06:36

Seen: (+: (DEFAULT: ), 1) times

Last updated: 11 Jan '19, 14:27