9 Replies Latest reply on Aug 9, 2012 7:39 PM by Steve Welsh

    cattools: how to remove garbage text related to paging prompt

    will@bootit.com

      I am trying to grab a config from an non-standard device and it doesnt have the ability to turn off paging. as a resuly, i am getting the following text while showing the config:

       

      logging threshold GUI critical network

      more (q/m/SP) ?

       

      The line with more is the problem, as in the saved config file, this gets translated to a bunch of wierd ASCII characters:

       

           logging threshold GUI critical network
      <wierd characters here>      logging threshold syslog informational network

           logging threshold global informational system

       

      I can open the file and do a search and replace for them, but this is time-consuming. Is there any way to get cattools to remove these using "variations," or some other method?

       

      I have enabled the following in variations:

       

      RESPONSE_STRIP_VT100ESC = "1"

      RESPONSE_STRIP_ANSICHARS = "1"

      RESPONSE_STRIP_NULLS = "1"

       

      But this still doesnt remove the odd characters. It seems like the device is erasing the the "more" line and then printing the next config line in its place, and cattools is recording this in the config output dump.

       

      thx in advance,

       

      W

        • Re: cattools: how to remove garbage text related to paging prompt
          Steve Welsh

          Hi Will,

           

          The ASCII characters you see are like you say, the device deleting the more prompt by either 'stripping' the more prompt (normally either by backspace [08]) or by cursor repositioning to then over-write the more prompt (normally an series of escape sequences such as 27[?...).

           

          In the Prompts tab of the device Variations feature, you can specify the 'Paging prompt' (More/Paging Prompt section).

          It also allows you to specify the keystroke which you'd use in order to display the next page of data.

           

          Try entering the relevant data in these fields for your device and see what happens.

           

          Please post back the results of using the suggested variations.

           

          Regards,

           

          Steve

            • Re: cattools: how to remove garbage text related to paging prompt
              will@bootit.com

              hey steve, thx for reply. glad to get some help. i had already tried the paging prompt feature in variations file. in my case, this is the text:

               

              more (q/m/SP) ?

               

              I entered this in the field under variations | Paging-Prompt. It appears like kiwi removes this from the output of the saved file, as there is a a bunch of same characters, white space and then some more of the same characters. something like this:

               

              [[[[[[[[[[[[[[[               [[[[[[[[[[[[[[[      <- not the character is actual a reversed box with a little circle in it, which doesn't copy into this message.:) I have copied an image of this into this message for your review.

               

               

              which gets embedded into the config file. It looks like the characters are too weird for kiwi to process??

               

              BTW, i left the variations | paging key-stroke set to the default (space).

               

              Looks like i may just be stuck? any more ideas? thx! Will

               

               

              kiwi_error.jpg

                • Re: cattools: how to remove garbage text related to paging prompt
                  Steve Welsh

                  Hi Will,

                   

                  I think there are most likely backspace characters.

                  To verify, select the 'Enable Capture Mode' option under the File menu and then rerun the activity against this device.

                   

                  Then open the CatTools install folder (normally  \CatTools3) and then the \Debug folder.  You should now see in there a Debuglog .txt file for your device.

                   

                  Search for the More prompt, then see what control characters appear after.  Backspaces are shown as [08], so you will probably find a series of 15 or 16 of them together.

                   

                  Steve

                    • Re: cattools: how to remove garbage text related to paging prompt
                      will@bootit.com

                      Hey steve,i just left site and cannot test tonight. will test tomorrow morning. thx again for this answer and the other one about SSH. If these are backspace chracters, which i suspect too, is there a way to get rid of this string? Are you suggesting that i need to include this somehow in the variations | Paging-Prompt text?

                       

                      Will

                      • Re: cattools: how to remove garbage text related to paging prompt
                        will@bootit.com

                        Steve, here is the debug output, centered around the stuff of interest. The words in bold-italics is stuff i would expect to see in config. the bold-only words are the "More" prompt. So is there a way to actually get rid of this in kiwi, during the config backup operaton?

                         

                        logging[13][13][10]more (q/m/SP) ? <W-3:29:35 PM> <R-3:29:35 PM>[08][08][08][08][08][08][08][08][08][08][08][08][08][08][08][08]                [08][08][08][08][08][08][08][08][08][08][08][08][08][08][08][08]        real

                        1 of 1 people found this helpful
                          • Re: cattools: how to remove garbage text related to paging prompt
                            Steve Welsh

                            As I suspected, the device response <R-...> contains 16 backspace [08] characters to delete the paging prompt (which including the end whitespace is 16 chars long). It then over-writes with 16 whitespaces, then deletes them again.

                             

                            Unfortunately the variations feature doesn't handle the removal of these additional characters, so you've sort of hit the wall with this one with the Generic Device script and variations.

                             

                            The alternative therefore would be to try create your own custom device script where you will be able to add code to strip these characters out.

                            Failing that, you may like to raise a feature request in the thwack feature and ideas section to have handling of 'post more prompt' characters added to the Variations feature?

                             

                            Regards,

                             

                            Steve

                            1 of 1 people found this helpful
                              • Re: cattools: how to remove garbage text related to paging prompt
                                will@bootit.com

                                So i think i am getting somewhere on this. Found this code in the devices scripts.TXT file. Looks like i can modify the VB somehow to yank the nasty CR's [08]'s and white spaces. Why is this code commented out though. Seems like this is already running to remove the standard "More Prompt" stuff:

                                 

                                    ' Final massage of response data before returning to CatTools

                                    If Len(DEVICE_MORETEXT) > 0 Then  ' Remove any --more-- paging prompts

                                        ' Use this next line to remove the whole line of output

                                        'sStoredBuffer = cl.TextRemoveLinesContainingText(sStoredBuffer, DEVICE_MORETEXT)

                                        ' ...or use this to replace the just the matching text within the line

                                        'sStoredBuffer = cl.ReplaceText(sStoredBuffer, DEVICE_MORETEXT, "")

                                    End If

                                • Re: cattools: how to remove garbage text related to paging prompt
                                  will@bootit.com

                                  I conquered this crazy problem! Special thx to the cattools devs who already added the code into the scripts file, as shown above.

                                  I modified that and uncommented it, per below:

                                   

                                  ' WRICHMOND CUSTOM VARIABLES - ADD this line at the beginning of the script defining a VAR with garbage

                                  Private Const DEVICE_MORETEXT2 = "<insert garbage here>"

                                   

                                  Alter this code that is in the Script's SendCommandSingle Function:

                                   

                                  ' Final massage of response data before returning to CatTools

                                  If Len(DEVICE_MORETEXT) > 0 Then  ' Remove any --more-- paging prompts

                                            ' Use this next line to remove the whole line of output

                                            'sStoredBuffer= cl.TextRemoveLinesContainingText(sStoredBuffer, DEVICE_MORETEXT)

                                            ' ...or use this to replace the just the matching text within the line

                                            ' WRICHMOND- UNCOMMMENT this line to get rid of the MORE PROMPT TEXT itself

                                             sStoredBuffer = cl.ReplaceText(sStoredBuffer, DEVICE_MORETEXT, "")

                                             'WRICHMOND - ADD THIS line to process sStoredBuffer a second time, removing the garbage as defined in DEVICE_MORETEXT2

                                             sStoredBuffer = cl.ReplaceText(sStoredBuffer, DEVICE_MORETEXT2, "")

                                  End If