Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added warning re stray files in pb lib dirs

...

A personality tells opConfig (or more precisely, the lower-level module Net::Appliance::Session) how to interact with a device, how to know when the connection is ready for the username or password, how to enter privileged mode, what prompt state the current connection is atin, and so on.

Personalities are defined by phrasebooks, the name of the folder containing the phrasebook defines the name of the personality.

...

A phrasebook is a file named "pb" that contains a list of prompts and macros, and the name of the directory the phrasebook resides in will be it's its personality name.  Phrasebooks are Phrasebooks may be built up hierarchically from data in a directory structure, each subdirectory multiple subdirectories; e.g. a phrasebook "deeper down" in the  hierarchy has the ability to override settings loaded from the parent directoryother directories "higher up".

Eg.

unix/pb <- may contain  a whole or partial phrasebook
unix/bash/pb <- contains everything in unix/pb, anything in this pb will override unix/pb
unix/csh/pb  <- contains everything in unix/pb, anything in this pb will override unix/pb

...

Prompts have specific names like user, pass, generic and privileged that are mapped to regular expressions, when a regular expression matches opConfig it assumes it is at that prompt.

One very important thing to bear in mind:

  • You must not save any files except the desired phrasebook in a phrasebook library directory.
    If a phrasebook directory contains any other files (e.g. a backup of a phrasebook file created by your editor), then the  Net::Appliance::Session module will load these files as well.
    Depending on the file ordering  the bad files will likely override some or all of the configuration that you put into your "real" phrasebook file.

Phrasebook macros and prompts

...