1Net::CLI::Interact::ManUusaelr::CPohnrtarsiebbuotoekdN(e3Pt)e:r:lCLDIo:c:uImnetnetraatcito:n:Manual::Phrasebook(3)
2
3
4

NAME

6       Net::CLI::Interact::Manual::Phrasebook - List of Supported CLIs
7

INTRODUCTION

9       The bundled phrasebook includes support for a variety of network device
10       CLIs.  Many were contributed by users of the module. If you set up a
11       new CLI dictionary, please consider contributing it back! The
12       phrasebook specification is given in Net::CLI::Interact::Phrasebook.
13
14       For each supported CLI, there is a name which must be passed in the
15       "personality" option to Net::CLI::Interact's "new()" method; this is
16       the same as the directory containing the phrasebook file.
17
18       After that, you can call the included Macros, and the module will use
19       the included Prompt to match the current state of the CLI. More
20       information is available in the Tutorial and Cookbook.
21

PERSONALITIES

23       See the files themselves at the following link for full details:
24       <https://github.com/ollyg/Net-CLI-Interact/tree/master/share/phrasebook>.
25
26       ·   ASA
27
28       ·   Avaya
29
30       ·   Bash
31
32       ·   CatOS
33
34       ·   Cisco (generic)
35
36       ·   Csh
37
38       ·   ExtremeOS
39
40       ·   F5
41
42       ·   Fortinet
43
44       ·   Foundry / Brocade
45
46           Before connecting to the device you probably want to set the output
47           separator to be:
48
49            $nci->transport->ors("\r\n");
50
51           For users of Net::Appliance::Session this should be:
52
53            $session_obj->nci->transport->ors("\r\n");
54
55       ·   FWSM
56
57       ·   FWSM 3
58
59       ·   HP
60
61       ·   IOS
62
63       ·   JunOS
64
65       ·   Mikrotik
66
67       ·   Nortel
68
69       ·   OVMCLI
70
71       ·   PIXOS
72
73       ·   PIXOS 7
74
75       ·   Qnap
76
77       ·   RedBack
78
79       ·   ScreenOS
80
81       ·   WLC
82
83       ·   Zyxel
84

SUPPORTING A NEW DEVICE

86       In order to support a new device, particularly for the
87       Net::Appliance::Session module, there is a basic set of prompts and
88       macros you must create.
89
90   Required Prompts
91       With SSH, no "user" prompt is required, but for other transports you
92       should include a prompt named "user" which matches the ""Username:""
93       prompt presented by the device.
94
95        # example only!
96        prompt user
97            match /[Uu]sername/
98
99       With all transports you must provide a "pass" prompt which matches the
100       ""password:"" prompt presented by the device.
101
102        # example only!
103        prompt pass
104            match /[Pp]assword: ?$/
105
106       The last essential prompt is of course a simple command line prompt
107       match, and this should be named "generic".
108
109        # example only!
110        prompt generic
111            match /> ?$/
112
113   Desirable Prompt and Macros
114       To cleanly disconnect from your device session, you might want to
115       include a macro named "disconnect" with the relevant command. Note
116       there is no need for a "match" statement in this macro, as the device
117       should have detached!
118
119        # example only!
120        macro disconnect
121            send exit
122
123       For paging support, include either only a "prompt" macro, or two macros
124       named "enable_paging" and "disable_paging", depending on what the
125       device requires.  In all cases, there must be one substitution ("%s")
126       which is where the number of page lines will be inserted into the
127       command.
128
129        # example only!
130        macro paging
131            send terminal length %s
132
133       For privileged mode (super-user) support, include a prompt named
134       "privileged" first, and then include macros named "begin_privileged"
135       and "end_privileged" to enter and leave the mode, respectively. Note
136       that both macros will require explicit match statements, because the
137       prompt encountered after issuing the command will be different to that
138       encountered before.
139
140        # example only!
141        prompt privileged
142            match /# ?$/
143
144        macro begin_privileged
145            send enable
146            match user or pass or privileged
147
148        macro end_privileged
149            send disable
150            match generic
151
152       Similarly for configure mode, include a prompt named "configure" first,
153       and then include macros named "begin_configure" and "end_configure" to
154       enter and leave the mode, respectively. Note that both macros will
155       require explicit match statements, because the prompt encountered after
156       issuing the command will be different to that encountered before.
157
158        # example only!
159        prompt configure
160            match /\(config[^)]*\)# ?$/
161
162        macro begin_configure
163            send configure terminal
164            match configure
165
166        macro end_configure
167            send exit
168            match privileged
169
170
171
172perl v5.30.1                      2020N-e0t1:-:3C0LI::Interact::Manual::Phrasebook(3)
Impressum