| 1 | $telrc = { | ||
| 2 | 'profile' => { | ||
| 3 | 'default' => { 'password' => 'DINGLEHOPPER!', 'user' => $ENV{USER}, | ||
| 4 | 1 | 'sshoptions' => [ 'UserKnownHostsFile=/dev/null', 'StrictHostKeyChecking=no' ], | |
| 5 | 'pagercmd' => 'term len 0', | ||
| 6 | 'syntax' => 'Cisco', | ||
| 7 | }, | ||
| 8 | 'casa' => { 'handlers' => { '\cZ' => \&handle_ctrl_z } }, | ||
| 9 | 'zhone' => { 'user' => 'admin', 'method' => 'telnet', 'prompt' => '>', 'enablecmd' => 'priv' }, | ||
| 10 | 'vyos' => { 'prompt' => '\$', 'pagercmd' => 'set term length 0' }, | ||
| 11 | 'juniper' => { 'logoutcmd' => 'exit', 'syntax' => 'Juniper', | ||
| 12 | 'pagercmd' => 'set cli screen-length 0', 'prompt' => '>' }, | ||
| 13 | 'dlink' => { 'method' => 'telnet', 'handlers' => { '\177' => \&handle_backspace }, | ||
| 14 | 'syntax' => 'Dlink', 'pagercmd' => 'disable clipaging' }, | ||
| 15 | 'mikrotik' => { 'logoutcmd' => '/quit', 'prompt' => '>' }, | ||
| 16 | 'at' => { 'ciphertype' => 'des', 'user' => 'engr' }, | ||
| 17 | 'hatteras' => { 'ciphertype' => 'des' } | ||
| 18 | }, | ||
| 19 | 'rtr' => [ # this is an array so order matters | ||
| 20 | { 'regex' => '^cerf$', 'method' => 'telnet', 'hostname' => 'route-server.cerf.net', 'prompt' => 'route-server>' }, | ||
| 21 | { 'regex' => '^att$', 'user' => 'rviews', 'method' => 'telnet', 'hostname' => 'route-server.ip.att.net', 'prompt' => 'route-server>' }, | ||
| 22 | { 'regex' => '^ix$', 'user' => 'rviews', 'method' => 'telnet', | ||
| 23 | 'hostname' => 'route-views.oregon-ix.net', 'prompt' => 'route-views>' }, | ||
| 24 | { 'regex' => '^quagga$', 'method' => 'telnet', 'hostname' => '127.0.0.1', port => 2605 }, | ||
| 25 | { 'regex' => '^ubi', 'user' => 'ubnt', 'method' => 'ssh' }, | ||
| 26 | { 'regex' => '192.168.13.10-28', 'profile' => 'zhone_olt' }, | ||
| 27 | # to clarify what we're doing here, if the name matches | ||
| 28 | # these regex we load the listed profile. | ||
| 29 | { 'profile' => 'casa', 'regex' => '^casa1-' }, | ||
| 30 | { 'profile' => 'zhone', 'regex' => '^dsl' }, | ||
| 31 | { 'profile' => 'hatteras', 'regex' => '^hat' }, | ||
| 32 | { 'profile' => 'mikrotik', 'regex' => '^gw1-mkt-site' }, | ||
| 33 | { 'profile' => 'at', 'regex' => '^(ds|sw).*(site-name).*' }, | ||
| 34 | ], | ||
| 35 | |||
| 36 | # if we see these strings in the banner while we're connecting to the | ||
| 37 | # device then we load the corresponding profile | ||
| 38 | 'banners' => { | ||
| 39 | 'Bay Networks BayStack' => 'baystack', | ||
| 40 | 'DES-3(5|3)(50|26) (Ethernet|Fast Ethernet)' => 'dlink', | ||
| 41 | 'Casa Systems' => 'casa', | ||
| 42 | 'JUNOS' => 'juniper', | ||
| 43 | 'VyOS' => 'vyos', | ||
| 44 | }, | ||
| 45 | |||
| 46 | # if these exist they will be loaded when the config file is parsed | ||
| 47 | 'syntax' => [ | ||
| 48 | 'MyCompanyName', | ||
| 49 | ], | ||
| 50 | }; | ||
| 51 |