cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6994
Views
0
Helpful
18
Replies

Q: CAN you repeatedly SSH from within a TCL script to, for example, a radio . . .

tproeber
Level 1
Level 1

. .. to get the current Line Rate to then write that speed to the Bandwidth statement for an Interface to make routine protocols more accurate over radio links with varying modulations?

My Googling says tells me that you can log in but any commands you issue will hang.  Can you SSH and retrieve command results from remote hosts in Cisco TCL?

Thanks!

Tim

18 Replies 18

*Nov 21 10:23:59 UTC: %HA_EM-6-LOG: Int-Desc : DEBUG(cli_lib) : : OUT : 2901_Ship_4#

*Nov 21 10:23:59 UTC: %HA_EM-6-LOG: Int-Desc : DEBUG(cli_lib) : : IN  : 2901_Ship_4#ssh -l cobra 192.168.101.1

*Nov 21 10:24:00 UTC: %HA_EM-6-LOG: Int-Desc : DEBUG(cli_lib) : : OUT : Password:

*Nov 21 10:24:00 UTC: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: 9

*Nov 21 10:24:00 UTC: %HA_EM-3-FMPD_ERROR: Error executing applet Int-Desc statement 050

*Nov 21 10:24:00 UTC: %HA_EM-6-LOG: Int-Desc : DEBUG(cli_lib) : : CTL : cli_close called.

*Nov 21 10:24:00 UTC:

*Nov 21 10:24:00 UTC: tty is now going through its death sequence

2901_Ship_4#

Statement 50 is the password -- it's the correct password -- I can manually do the steps.

Thanks,

Tim

Found it -- I had to escape the $ sign in the password.

Progress!

Thanks,

Tim

I can SSH to the radio!

Now I need to extract the TX ands RX rates and range -- is this how I would do it?

event manager applet Radio-Reader

event timer watchdog time 10

action 010 cli command "enable"

action 020 cli command "ssh -l ubnt 192.168.2.11" pattern "assword:"

action 050 cli command "fly2the*" pattern "#"

action 060 cli command "mca-status" pattern "#"

action 070 regexp "wlanTxRate=[0-9]{1,3}" "$_cli_result"

action 080 set 900Mhz-TX "$_regexp_result"

action 090 regexp "wlanRxRate=[0-9]{1,3}" "$_cli_result"

action 100 set 900Mhz-RX "$_regexp_result"

action 110 regexp "distance=[0-9]{1,3}" "$_cli_result"

action 120 set 900Mhz-Distance "$_regexp_result"

***** This is the output of the "mca-status" command:

XM.v5.5.6# mca-status

deviceName=2.4_AP.11,deviceId=DC:9F:DB:6A:A2:17,firmwareVersion=XM.ar7240.v5.5.6.17762.130528.1755,platform=Rocket M2,deviceIp=192.168.2.11

apMac=DC:9F:DB:6A:A2:17

wlanOpmode=ap

wlanConnections=3

wlanUptime=1142923

essid=2400

freq=2429

signal=-41

noise=-89

ccq=991

uptime=1142923

loadavg=0

memTotal=62012

memFree=43204

memBuffers=2340

ackTimeout=24

distance=0

lanIpAddress=0.0.0.0

wlanIpAddress=0.0.0.0

wlanTxRate=260.0

wlanRxRate=174.0

wlanTxLatency=1

wlanPolling=1

wlanPollingQuality=79

wlanPollingCapacity=62

lanRxBytes=414272179

lanRxPackets=477266935

lanRxErrors=0

lanTxBytes=1544971571

lanTxPackets=53035448

lanTxErrors=0

lanPlugged=1

lanSpeed=100Mbps-Full

wlanRxBytes=2040744381

wlanRxPackets=59880613

wlanRxErrors=1

wlanTxBytes=4012972456

wlanTxPackets=479018827

wlanTxErrors=0

wlanRxErrNwid=1147816

wlanRxErrCrypt=0

wlanRxErrFrag=0

wlanRxErrRetries=0

wlanRxErrBmiss=0

wlanRxErrOther=0

latitude=0.000000

longitude=0.000000

cfgCrc=1dee1a80

XM.v5.5.6#

Don't over-think it.  Use as simple expression as you can:

regexp "wlanTxRate=([0-9\.]+)" $_cli_result match txrate

puts "TxRate is $txrate"

==> TxRate is 260.0