5 Replies Latest reply: Dec 20, 2011 6:55 PM by Steve Welsh RSS

Custom Device prompts definition

I am currently evaluating Cat Tools but am running into problems with a custom device definition. we are using Alcatel-Lucent GPON equipment that uses TL1, the returned system prompts often span multiple lines causing problems in defining the proper prompts.

When I define a Device SendCLI Commands the defined instruction itself is executed properly but the scripts is waiting for the wrong prompt resulting in no data being captured although it is available.

<NEWSESSION CatTools 3.6.0 10-3-2011 12:28:58>
<PROTOCOL=SSH2>
<DEVICE TYPE=Alcatel.Lucent.OLT.TL1>
<ACTIVITY TYPE=Device.CLI.Send commands>
<ACTIVITY SCRIPT=C:\Program Files\CatTools3\Scripts\Client.Device.CLI.Send commands.txt>
<USERS NAME FOR DEVICE=Albrandswaard OLT>
<C OK 12:29:00><R-12:29:04>[27][;r[00][00][27][?6l[00][27][?7l[00][27][20l[00][27][4h[00][00][00][00][27][?3l[00][00][00][00][00][00][00][00][00][00][00][17][13][10]< <W-12:29:04>[13]<R-12:29:04>[13][10]<R-12:29:05>[13][10]IP 0[13][10][13][10]Welcome to FTTU[13][10][13][10][13][10]   /*               A L C A T E L - L U C E N T             <R-12:29:05>    */[13][10][13][10][13][10]   OONO-ALBW-0001 11-03-10 12:29:13[13][10]M  0 COMPLD[13][10]   /* act-user */[13][10]   /*    Alcatel-Lucent FTTU : This is a private computer system.    */[13][10]   /*    Unauthorized access or use may lead to<R-12:29:05> prosecution.         */[13][10]   /* last successful login: 10/03/11 12:25:29 */[13][10]   /* 2 User(s) Logged On */[13][10];[13][10]<R-12:29:05>[13][10][13][10]/*                    HELP MENU[13][10][13][10]    HELP          or  ?      Type HELP or ? for this menu.[13][10]    MENU                     Type MENU for menu mode.[13][10]    <UP ARROW>    or '^B'    Recall previous commands.[13][10]    <DOWN ARROW>  or '^N'    Recall successive <W-12:29:05>RTRV-ONT::ONT-1-1-1-2-63::<R-12:29:05>commands.[13][10]    <LEFT ARROW>  or '^D'    Move cursor left one space.[13][10]    <RIGHT ARROW> or '^F'    Move cursor right one space.[13][10]<R-12:29:06>                     '^E'    Move cursor to end of line.[13][10]                     '^A'    Move cursor to start of line.[13][10]    <CAN>         or '^X'    Reset command input processing.[13][10]    <BS>          or '^H'    Delete previous input character.[13][10]    <DEL>    <R-12:29:06>                Restart current line input.     */[13][10][13][10]< [13][10]<R-12:29:06>[13][10]/* No command code entered. */[13][10]Enter Verb[13][10]  (ACT, ALW, CANC, DGN, DL, DLT, ED, ENT, INH, INIT,[13][10]   LOGOFF, OPR, RD, REPT, RLS, RST, RTRV, SEND, SET, STA,[13][10]   STP, SW, UL) : R<R-12:29:06>TRV-ONT::ONT-1-1-1-2-63::<W-12:29:06>[13]<R-12:29:07>[13][10][13][10]RTRV-ONT::ONT-1-1-1-2-63:: [13][10]Execute ? (Y,N) [Y] : <W-12:29:07>y[13]<R-12:29:07>y[13][10]<R-12:29:07>[13][10]<R-12:29:07>IP 0[13][10][13][10]< <W-12:29:08> <R-12:29:08>[13][10][13][10]   OONO-ALBW-0001 11-03-10 12:29:16[13][10]M  0 COMPLD[13][10]   /* RTRV-<R-12:29:08>ONT::ONT-1-1-1-2-63:: */[13][10]   "ONT-1-1-1-2-63::BTRYBKUP=NO,BERINT=8000,DESC1=\"50MBInet\",[13][10]   DESC2=\"Slotvdijk3A\",PROVVERSION=\"*\",SERNUM=ALCLF9AD56B9,[13][10]   SUBSLOCID=\"WILDCARD\",SWVERPLND=\"3FE52258AFYA12\",FECUP=ENABLE,[13][10]   SCHEDPROFID=1,SCHEDPROFNM=\<R-12:29:08>"defSubSchedProf\",POWERSHEDPROFID=0,[13][10]   POWERSHEDPROFNM=\"NULL\",ONTENABLE=AUTO,P2PENABLE=DISABLE,[13][10]   RATELIMITOPT=ENABLE,OPTICSHIST=DISABLE,PLNDVAR=\"\",[13][10]   DLSW=\"3FE52258AHCA27\",EQPTVERNUM=3FE51880AAAB01,SWVERACT=3FE52258AFYA12,[13][10]   SWVERPSV=3FE522<R-12:29:08>58AHCA27,VENDORID=ALCL,EQUIPID=          I241GB,NUMSLOTS=3,[13][10]   NUMTCONT=31,NUMTRFSCH=31,NUMPQ=31:IS-NR"[13][10];[13][10][13][10]< <R-12:29:09>
================================================================================
WFMDRetVal=1 Waiting for: "IP 0"
WFMDRetVal=2 Waiting for: "/* The command code entered is not a valid command code. */"
WFMDRetVal=3 Waiting for: "/* The command code entered is not a valid command code. */"
WFMDRetVal=4 Waiting for: "Execute ? (Y,N) [Y] :"

Below is the prompt that the script is waiting for but that will never occur

WFMDRetVal=8 Waiting for: "    <DOWN ARROW>  or '^N'    Recall successiv<"

Below is the returned data that is in essence entirely correct!

WFMDBuffer="[13][10][13][10]   oono-albw-0001 11-03-10 12:29:16[13][10]m  0 compld[13][10]   /* rtrv-ont::ont-1-1-1-2-63:: */[13][10]   "ont-1-1-1-2-63::btrybkup=no,berint=8000,desc1=\"50mbinet\",[13][10]   desc2=\"slotvdijk3a\",provversion=\"*\",sernum=alclf9ad56b9,[13][10]   subslocid=\"wildcard\",swverplnd=\"3fe52258afya12\",fecup=enable,[13][10]   schedprofid=1,schedprofnm=\"defsubschedprof\",powershedprofid=0,[13][10]   powershedprofnm=\"null\",ontenable=auto,p2penable=disable,[13][10]   ratelimitopt=enable,opticshist=disable,plndvar=\"\",[13][10]   dlsw=\"3fe52258ahca27\",eqptvernum=3fe51880aaab01,swveract=3fe52258afya12,[13][10]   swverpsv=3fe52258ahca27,vendorid=alcl,equipid=          i241gb,numslots=3,[13][10]   numtcont=31,numtrfsch=31,numpq=31:is-nr"[13][10];[13][10][13][10]<  "
================================================================================
<W-12:29:39>logoff;[13]<D 12:29:39>
<SCRIPT VALUES>
<HOSTNAME="    <DOWN ARROW>  or '^N'    Recall successiv">
<PROMPT VTY="    <DOWN ARROW>  or '^N'    Recall successiv<">
<PROMPT ENABLE="">
<PROMPT CONFIG="">

The prompt that the script is waiting for is inadvertedly picked up during logging in to the system, reason is that the default system prompt is "<" that is also returned as part of the logon banner.

Below the propperly formatted systembanner after successful logon:

<

IP 0

Welcome to FTTU


   /*               A L C A T E L - L U C E N T                 */


   OONO-ALBW-0001 11-03-10 12:58:44
M  0 COMPLD
   /* act-user */
   /*    Alcatel-Lucent FTTU : This is a private computer system.    */
   /*    Unauthorized access or use may lead to prosecution.         */
   /* last successful login: 10/03/11 12:58:08 */
   /* 1 User(s) Logged On */
;


/*                    HELP MENU

    HELP          or  ?      Type HELP or ? for this menu.
    MENU                     Type MENU for menu mode.
    <UP ARROW>    or '^B'    Recall previous commands.
    <DOWN ARROW>  or '^N'    Recall successive commands.
    <LEFT ARROW>  or '^D'    Move cursor left one space.
    <RIGHT ARROW> or '^F'    Move cursor right one space.
                     '^E'    Move cursor to end of line.
                     '^A'    Move cursor to start of line.
    <CAN>         or '^X'    Reset command input processing.
    <BS>          or '^H'    Delete previous input character.
    <DEL>                    Restart current line input.     */

<

Is there a way arround this problem? Additionally, a lot of the returned prompts contain the current date/time making testing for specific prompts difficult if not impossible, is it possible to use wildchards in the prompt definitions or otherwise instruct Cat Tools to ignore specific parts of the returned prompts?

Regards,

Henk

 
  • Re: Custom Device prompts definition
    Steve Welsh

    Hi Henk,

    CatTools device scripts normally work around a known 'anchor point' (normally the CLI device hostname prompt).

    From the sample capture you've provided, it looks like there is nothing consistant which can be used as an anchor point therefore you may be out of luck trying to get this device supported with a custom script.

    Also, you mentioned about a date/time stamp appearing?  Is this like a ticking clock which gets updated regardless of whether commands are being sent or not?  If so, then I remember a request to support something similar on an old HP device many years ago, and as you say, its pretty much near impossible to create a working script for something which keeps changing like this.

    You may want to check your device user manual to see if there is any way to reconfigure this particular device to use a more industry standard command line interface (like Cisco IOS) rather than the menu system?

    I know that several vendors have options to switch between CLI and Menu systems; so maybe with a bit of luck you may have something similar on this device?

    Kind regards,

    Steve

    • Re: Custom Device prompts definition

      Hello Steve,

      I was afraif for that however I am making some progress and I might be able to work my way arround thse issues. I am currently playing with the definition of the various prompts (misusing them), is there a clear consistant way when a particular prompt is used by the Send CLI Commands script. When playing with the listed prompts below I noticed that they have a huge impact but I am a littlebit confused when a particular prompt is actively being used by the script.

      Private Const DEVICE_STANDARDPROMPT =
      Private Const DEVICE_PRIVILEGEDPROMPT =
      Private Const DEVICE_CONFIGPROMPT =
      Private Const DEVICE_MORETEXT = 
       
      Regards,

      Henk

      • Re: Custom Device prompts definition
        Steve Welsh

        Hi Henk,

        The prompts:

        Private Const DEVICE_STANDARDPROMPT = 
        Private Const DEVICE_PRIVILEGEDPROMPT = 
        Private Const DEVICE_CONFIGPROMPT = 

        are the normal default prompts which tell CatTools that the command being executed has completed.

        Generally these should be set as the last 3 elements within the 'rgMults' array.

         

        The prompt:

        Private Const DEVICE_MORETEXT = 

        is the prompt to check for when the output 'paging' has not been disable on the device.  You set this to be all (or part) of the paging prompt text you see when command output is returned 'paged' (for  example:   --  more -- )

        This element should be set in the 'rgMult' array BEFORE the 3 hostname prompts above, so CatTools handles this scenario first. 

         

        Hope this helps.

         

        Steve

    • Re: Custom Device prompts definition
      netadm1n

      Hi Steve,

           I'm running into a similar issue that hinges on what you just said - that CatTools is determined to work around a known anchor point.  I can see how that is a handy way of getting your bearings when orchestrating a dialogue with a device, but what harm would it do to allow someone to configure CatTools to blindly send output to a device, and capture all output to a file?  I've got some Cisco CE500's that have no CLI whatsoever.  However, I can telnet directly to TCP 80 on them and issue HTTP commands, simple text, that give me the output from them I'm looking for.  Interestingly though, when you connect to a web server, it doesn't send you any ouput back at all until you send it something first.  That shouldn't be a problem at all.  Unfortunately though, because CatTools insists on wanting to have an 'anchor point', it is not cooperating.  Not only that, even though I've configured CatTools to treat this device as entirely generic, I can see from the debug capture that it is looking for Cisco specific anchor points.  What's up with that?

      • Re: Custom Device prompts definition
        Steve Welsh

        Hi netadm1n,

        The CatTools product is designed around a working CLI interface which you can reach via Telnet or SSH.  Some menu driven device O/S are supported, however in general these are a real pain to get working.

        To date, we do not provide support for devices with HTTP interfaces.

        However... from what you mentioned above, it would seem that you are able to initiate a direct Telnet connection to the device (on Port 80) using CatTools, but it falls over on the anchor-point determination.

        I am guessing that you are using the Generic.Device (device type) in CatTools for this?

        Have you tried to experiment with the Variations feature within the Generic.Device setup? http://www.kiwisyslog.com/help/cattools/dev_devicevariations.htm

        In the Variations feature, you can override the determining of the hostname prompts by specifying them in the variations 'Full Prompts' tab.

        However the trick here is what to specify for your device?

        What you need to do is find some piece of text within the device response which normally occurs at the end (or as near to it) after a command has returned its results.

        For example:  with some menu driven interfaces, I would set the prompts to be things like the footer text (which tells you to press key such and such to go back to Main Menu), so long as it is always going to appear on every response.

         

        I would be very interested to hear if you have any luck with this.

         

        Steve