8 Replies Latest reply on Dec 10, 2012 11:28 AM by Sartuche24

    Did not receive expected response to conf t command!

    betrachter

           Hi again! As you requested, I've made a new theme with my question. What kind of diagnostics you need from me?

      I have the same question as flexible, I have 2 Cisco IOS switches 2960 (first firmware version is 12.2(50)SE5 and another 12.2(58)SE2) when I am trying to use "Device.CLI.Send commands" in Cat tools the switch, which have 12.2(50)SE5 version make all commands correctly, but when running activity  on another(12.2(58)SE2):  "Did not receive expected response to command: conf t" and after that Cat tools stops activity. I used putty(ssh2) as a terminal in cattools.

           P.S. I apologize for my English, if something not right written^^

      Thanks!

        • Re: Did not receive expected response to conf t command!
          Steve Welsh

          Very surprising that one of your devices is failing to execute 'conf t' command.

           

          Have you tried a manual PuTTY session to the device using the same credentials for the device as you have specified in CatTools?  What happens?  Can you run the command or do you get the same error?

           

          The only thing I can think is maybe you are not in 'enable' (privileged exec) mode for this device when trying to execute the 'conf t' command.

           

          In the Options tab of the Device.CLI.Send Commands activity, have you selected the 'Enter command in enable mode' option?

           

          If not then try that and see what happens, as if this works I will be able to tell you what the problem is.

           

          Regards,

           

          Steve

            • Re: Did not receive expected response to conf t command!
              betrachter

              Steve, "conf t" command is just an example... on 12.2(58)SE2 cattools couldn't do any command!!!!!!!!!! manualy i can do any command and it will work! in my opinion it because cattolls couldn't work with 12.2(58)SE2 firmware! Because all commands work on switches with 12.2(50)SE5 firmware.I have cattools 3.3.4 enterprise.

                • Re: Did not receive expected response to conf t command!
                  Steve Welsh

                  Still sounds very odd.  I don't remember any issues with specific IOS versions not sending commands, although v3.3.4 is quite an old version now (2008).   My thought therefore is its possible CatTools is either having issue trying to log in to the device, or when trying to determine the device hostname which is then used as the anchor-point when running commands to tell CatTools the command output has completed.   Are there any errors in the 'Info Log' pane which provide any indication of the problem?

                   

                  If you have a spare machine somewhere that can get Telnet/SSH connectivity to the problem device, you may want to try downloading the latest CatTools release Eval version to install on that test machine to see if the latest release encounters the same issue.

                   

                  Failing that we'd really need to get some diagnostics from you (device DebugLog for one of the effected devices, the Infolog.txt file to cross-reference any log messages and probably also a PuTTY session log file too).

                  As the debuglog file may contain sensitive (login credentials) data, I'd recommend raising a support ticket for this one.

                   

                  Please post back on the thread with the case number and any solution that support provide as this could be valuable for other CatTools users if they encounter a similar issue.

                   

                  When you raise your support ticket, mention that you have spoken with me on thwack.

                   

                  Regards.

                   

                  Steve

              • Re: Did not receive expected response to conf t command!
                Sartuche24

                I had a problem with not getting responses or failures with CatTools waiting for an echo of a command. I had to write custom section in my scripts to send commands and only look for the command itself. The reason is because some older switches or routers for that matter will change how the prompt looks. See CatTools expects to see this hostname# for enable and hostname( for the config prompt. Well I've had some devices that shorten the hostname take "thisisareallylonghostname" the switch will shorten to say thisisareallylong# or thisisareallylon( now as you can see CatTools will never get the expected response. So below is a function I wrote for sending a command.

                '######################################################################################################

                ' Function: Send_Command

                ' Purpose: This is used throughout the script to send a specific cli command.

                ' Variables: Command in string format, Boolean on prompts, true for Yes AND false for No

                '######################################################################################################

                Function Send_Command(sCommand,bYesToPrompts)

                    ' Integers

                    Dim i,j

                    Dim iTimeOut

                    Dim iChoices

                    Dim iRetVal

                    ' Booleans

                    Dim bRetVal

                    Dim sResponse,sBufferBefore,sBufferMore

                    'Arrays

                    Dim aMult(7)

                  

                    aMult(1) = "]?"

                    aMult(2) = "[confirm]"

                    aMult(3) = "[yes/no]"

                    aMult(4) = "% Unknown command"

                    aMult(5) = "% Invalid input"

                    aMult(6) = "#"

                    aMult(7) = "<--- More --->"

                    iTimeout = 30

                    iChoices = 7

                    j = 0

                  

                    ' This will send the commands. This is to help on making the code smaller. Just basic commands, no responses

                    Send_Command = True

                    bRetVal = ""

                    sResponse = sCommand

                    If Len(sCommand) > 20 Then sResponse = Left(sCommand,20)

                    ' Save buffer before. This helps in controlling possible issues.

                    sBufferBefore = cl.RXBuffer

                    ' Flush Receive Buffer

                    cl.FlushRXBuffer

                    cl.Log 4, "Sending Command: " & sCommand

                    cl.SendData(sCommand & vbCr)

                    Do

                        iRetVal = cl.WaitForMultData(aMult, iChoices, iTimeOut)

                        Select Case iRetVal

                            Case 0

                                cl.Log 4, "Case 0 - " & cl.RxBuffer

                                If sBufferMore = "" Then

                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                Else

                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                End If

                                Send_Command = "No response to " & sCommand

                                Exit Function

                            Case 1

                                iRetVal = ""

                                Exit Do

                            Case 2

                                iRetVal = ""

                                If bYesToPrompts = True Then

                                    cl.SendData vbCr

                                        Do

                                            iRetVal = cl.WaitForMultData(aMult, iChoices, iTimeOut)  

                                            While cl.RXBuffer = ""

                                                ' Do Nothing, just wait

                                                cl.Delay(1)

                                                j = j + 1

                                                If j = iTimeout Then

                                                    Send_Command = "Timeout reached on command: " & sCommand

                                                    If sBufferMore = "" Then

                                                        cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                                    Else

                                                        cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                                    End If

                                                    Exit Function

                                                End If

                                            Wend

                                            If sBufferMore = "" Then

                                                cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                            Else

                                                cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                            End If

                                            Exit Do

                                        Loop

                                    Exit Do

                                Else

                                    cl.SendData "n" & vbCr

                                    Do

                                        iRetVal = cl.WaitForMultData(aMult, iChoices, iTimeOut)  

                                        While cl.RXBuffer = ""

                                            ' Do Nothing, just wait

                                            cl.Delay(1)

                                            j = j + 1

                                            If j = iTimeout Then

                                                Send_Command = "Timeout reached on command: " & sCommand

                                                If sBufferMore = "" Then

                                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                                Else

                                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                                End If

                                                Exit Function

                                            End If

                                        Wend

                                        If sBufferMore = "" Then

                                            cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                        Else

                                            cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                        End If

                                        Exit Do

                                    Loop

                                    Exit Do

                                End If

                            Case 3

                                iRetVal = ""

                                If bYesToPrompts = True Then

                                    cl.SendData "y" & vbCr

                                    Do

                                        iRetVal = cl.WaitForMultData(aMult, iChoices, iTimeOut)  

                                        While cl.RXBuffer = ""

                                            ' Do Nothing, just wait

                                            cl.Delay(1)

                                            j = j + 1

                                            If j = iTimeout Then

                                                Send_Command = "Timeout reached on command: " & sCommand

                                                If sBufferMore = "" Then

                                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                                Else

                                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                                End If

                                                Exit Function

                                            End If

                                        Wend

                                        If sBufferMore = "" Then

                                            cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                        Else

                                            cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                        End If

                                        Exit Do

                                    Loop

                                    Exit Do

                                Else

                                    cl.SendData "n" & vbCr

                                    Do

                                        iRetVal = cl.WaitForMultData(aMult, iChoices, iTimeOut)  

                                        While cl.RXBuffer = ""

                                            ' Do Nothing, just wait

                                            cl.Delay(1)

                                            j = j + 1

                                            If j = iTimeout Then

                                                Send_Command = "Timeout reached on command: " & sCommand

                                                If sBufferMore = "" Then

                                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                                Else

                                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                                End If

                                                Exit Function

                                            End If

                                        Wend

                                        If sBufferMore = "" Then

                                            cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                        Else

                                            cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                        End If

                                        Exit Do

                                    Loop

                                    Exit Do  

                                End If

                            Case 4

                                If sBufferMore = "" Then

                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                Else

                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                End If

                                Send_Command = "Unknown Command: " & sCommand

                                Exit Function

                            Case 5

                                cl.Log 4, cl.RxBuffer

                                If sBufferMore = "" Then

                                            cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                        Else

                                            cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                        End If

                                Send_Command = "Invalid Input: " & sCommand

                                Exit Function

                            Case 6

                                While cl.RXBuffer = ""

                                    ' Do Nothing, just wait

                                    cl.Delay(1)

                                    j = j + 1

                                    If j = iTimeout Then

                                        Send_Command = "Timeout reached on command: " & sCommand

                                        If sBufferMore = "" Then

                                            cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                        Else

                                            cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                        End If

                                        Exit Function

                                    End If

                                WEND

                                If sBufferMore = "" Then

                                    cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                Else

                                    cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                End If

                                Exit Do

                            Case 7

                                iRetVal = ""

                                If sBufferMore = "" Then

                                    sBufferMore = sBufferBefore & cl.RxBuffer

                                Else

                                    sBufferMore = sBufferBefore & sBufferMore & cl.RxBuffer

                                End If

                                cl.FlushRxBuffer

                                cl.SendData Chr(32)

                                j = j + 1

                                If j = iTimeout Then

                                    Send_Command = "Timeout reached on command: " & sCommand

                                    If sBufferMore = "" Then

                                        cl.RxBuffer = sBufferBefore & cl.RxBuffer

                                    Else

                                        cl.RxBuffer = sBufferBefore & sBufferMore & cl.RxBuffer

                                    End If

                                    Exit Function

                                End If

                        End Select

                    Loop

                End Function

                 

                 

                My function looks for the first 20 characters of a command to see if it exists in the Buffer. If it does then it will send a return character. Login to you device and whats the device hostname and how does it compare to the enable and config prompts.