App-Tel

 view release on metacpan or  search on metacpan

dottelrc.sample  view on Meta::CPAN

$telrc = {
          'profile' => {
                       'default' => { 'password' => 'DINGLEHOPPER!', 'user' => $ENV{USER},
                                      'sshoptions' => [ 'UserKnownHostsFile=/dev/null', 'StrictHostKeyChecking=no' ],
                                      'pagercmd' => 'term len 0',
                                      'syntax' => 'Cisco',
                       },
                       'casa' => { 'handlers' =>  { '\cZ' => \&handle_ctrl_z } },
                       'zhone' => { 'user' => 'admin', 'method' => 'telnet', 'prompt' => '>', 'enablecmd' => 'priv' },
                       'vyos' => { 'prompt' => '\$', 'pagercmd' => 'set term length 0' },
                       'juniper' => { 'logoutcmd' => 'exit', 'syntax' => 'Juniper',
                                      'pagercmd' => 'set cli screen-length 0', 'prompt' => '>' },
                       'dlink' => { 'method' => 'telnet', 'handlers' => { '\177' => \&handle_backspace },
                                          'syntax' => 'Dlink', 'pagercmd' => 'disable clipaging' },
                       'mikrotik' => { 'logoutcmd' => '/quit', 'prompt' => '>' },
                       'at' => { 'ciphertype' => 'des', 'user' => 'engr' },
                       'hatteras' => { 'ciphertype' => 'des' }
                     },
          'rtr' => [   # this is an array so order matters
                   { 'regex' => '^cerf$', 'method' => 'telnet', 'hostname' => 'route-server.cerf.net', 'prompt' => 'route-server>' },
                   { 'regex' => '^att$', 'user' => 'rviews', 'method' => 'telnet', 'hostname' => 'route-server.ip.att.net', 'prompt' => 'route-server>' },
                   { 'regex' => '^ix$', 'user' => 'rviews', 'method' => 'telnet',
                                  'hostname' => 'route-views.oregon-ix.net', 'prompt' => 'route-views>' },
                   { 'regex' => '^quagga$', 'method' => 'telnet', 'hostname' => '127.0.0.1', port => 2605 },
                   { 'regex' => '^ubi', 'user' => 'ubnt', 'method' => 'ssh' },
                   { 'regex' => '192.168.13.10-28', 'profile' => 'zhone_olt' },
                   # to clarify what we're doing here, if the name matches
                   # these regex we load the listed profile.
                   { 'profile' => 'casa', 'regex' => '^casa1-' },
                   { 'profile' => 'zhone', 'regex' => '^dsl' },
                   { 'profile' => 'hatteras', 'regex' => '^hat' },
                   { 'profile' => 'mikrotik', 'regex' => '^gw1-mkt-site' },
                   { 'profile' => 'at', 'regex' => '^(ds|sw).*(site-name).*' },
                 ],

        # if we see these strings in the banner while we're connecting to the
        # device then we load the corresponding profile
        'banners' => {
                'Bay Networks BayStack' => 'baystack',
                'DES-3(5|3)(50|26) (Ethernet|Fast Ethernet)' => 'dlink',
                'Casa Systems' => 'casa',
                'JUNOS' => 'juniper',
                'VyOS' => 'vyos',
        },

        # if these exist they will be loaded when the config file is parsed
        'syntax' => [
            'MyCompanyName',
        ],
};



( run in 1.158 second using v1.01-cache-2.11-cpan-6aa56a78535 )