plink syntax question?

Hello,

I am new to the F5/BIG-IP world and have been struggling with a problem for sometime. I am writing a script which needs to SSH from a WINDOWS machine and remotely send commands to the F5 server.

Below is my PLINK (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) script (it’s just a 1 liner command in italics) and corresponding response:

D:\apps\extpip>plink -ssh endecaF5@140.147.132.22 -pw blah “b node 192.168.192.131 session disable”

BIGpipe parsing error:

012e0008:3: The requested command (b node 192.168.192.131 session disable) is invalid

When I manually SSH into the server and run the same command at the prompt “b node 192.168.192.131 session disable”, it executes without any errors.

Can anyone please shed some light on what’s going on here?

Thank you very much in advance,

Hi,

I just tried using plink to disable sessions on a 10.0.1 and 9.4.6 LTM node and it worked fine. The GUI reflects the session being disabled/enabled. Which LTM version are you running? Can you run 'plink -ssh endecaF5@140.147.132.22 -pw blah “b node list” successfully?

user@host /cygdrive/c/tools/putty

$ ./plink.exe -ssh user@ltm -pw password “b node list”

node 10.41.0.21 {}

node 10.41.1.100 {}

node 10.41.135.3 {}

node 1.2.145.79 {}

node 1.2.45.100 {}

user@host /cygdrive/c/tools/putty

$ ./plink.exe -ssh user@ltm -pw password “b node 10.41.1.100 list”

node 10.41.1.100 {}

user@host /cygdrive/c/tools/putty

$ ./plink.exe -ssh user@ltm -pw password “b node 10.41.1.100 list all”

node 10.41.1.100 {

limit 0

ratio 1

dynamic ratio 1

unchecked

session enable

monitor default

screen none

partition Common

}

user@host /cygdrive/c/tools/putty

$ ./plink.exe -ssh user@ltm -pw password “b node 10.41.1.100 session disable”

Aaron

Aaron,

Thanks for the reply.

When I run the command you suggested I get the following error:

C:\>plink -ssh endecaF5@140.147.132.22 -pw blah “b node list”

BIGpipe parsing error:

012e0008:3: The requested command (b node list) is invalid

C:\>

Again, when I manually SSH into the F5 and run the “b node list” from the command line, it returns a list of nodes:

bp>b node list

node 140.147.249.7 {

}

node 192.168.192.101 {

screen CRSAPPS20

}

node 192.168.192.102 {

screen CRSAPPS21

}

node 192.168.192.111 {

screen CRSAPPS24

}

node 192.168.192.112 {

screen CRSAPPS25

}

node 192.168.192.121 {

screen CRSAPPS26

}

node 192.168.192.122 {

screen CRSAPPS27

}

node 192.168.192.131 {

screen CRSAPPS18

}

Running version from the command line, it appears that our BIG-IP is version 9.4.7:

bp>version

Kernel:

Linux 2.4.21-9.4.7.320.0smp

Package:

BIG-IP Version 9.4.7 320.1

Final Edition

Enabled Features:

… (too much to paste)

I also tried problematically SSH’ing and sending the same remote command through a Java API (JSch - Java Secure Channel), and am getting the same errors.

Any idea on how to proceed?

Thanks again in advance Aaron,

Ah, it’s because your user’s shell is set to bigpipe not a full shell. If you change the user’s “terminal access” to Advanced Shell, it should work fine.

Aaron

Aaron,

Yep, that was the problem!

Thanks tremendously for your help!

Take care,

No problem. Glad it worked for you.

Aaron

First of all thanks for this post. i also was able to output the shell output to a .txt file. my question is is there a way to add some comments into the output txt file for example between the output add texts like "---------B interface ------- "

Hi Anish,

You could try something like this:

plink -ssh endecaF5@140.147.132.22 -pw blah “echo ‘---- b node list ----’; b node list; echo ‘---- b pool list ----’; b pool list;”

Aaron

thanks Much you re goodddddddddd, greatly appreciate the fast response