Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

If you have already setup credential sets, then you can let opConfig guess which to use for your node using 

opconfig-cli.pl act=discover node=TheNewNodeName 

If none of the Transport+Credential Set combinations work for the node, opconfig-cli.pl will print an error message.

Automating node import

One can use a cron entry to schedule the opconfig-cli.pl processes as described above, this would import new nodes and update old node information from NMIS on a regular basis.

There are two things to consider when automating this.  Firstly the "discover" process which tests for a working combination of the transport (ssh/telnet) and credentials is not recommended for larger numbers of nodes or if have more than about 3 or 4 credential sets to try for obvious reasons.  Secondly you may want to apply a filter on which nodes should be considered as Active for opConfig.

One way to automate some of these is to create custom entries in your OS_Rules.nmis.  You can use OS_Rules filter and set policies to apply the transport type, the credential set to use and even the enabled or disabled flag.

Here is an example which extends the Cisco IOS section to automatically set the transport and credential sets for all Cisco devices.

Code Block
languageperl
titleOS_Rules
  10 => {
                'IF' => {
                        'sysDescr' => qr/IOS XR/,
                },
                'SET' => {
                        'connection_info.personality' => 'ios',
                        'os_info.os' => 'IOS-XR',
			###  These two lines then SET SSH as the transport and the credential_set to use for username and password or SSH keys. 
						'connection_info.transport' => 'SSH',
						'connection_info.credential_set' => 'default_username_password',
            ###  ----
                },
                'CAPTURE' => [
                        # Cisco IOS XR Software (Cisco IOS XRv Series),  Version 5.1.1
                        # Cisco IOS XR Software (Cisco ASR9K Series);  Version 5.2.4[Default]\n\nCopyright (c) 2015 by Cisco Systems; Inc.
                        [ 'sysDescr' => qr/Version (\d+\.\d+\.\d+)/ => 'os_info.version' ],
                        # the train is the major version
                        [ 'os_info.version' => qr/^(\d+\.\d+)\.\d+$/ => 'os_info.major' ],
                        [ 'os_info.major' => qr/(.+)/ => "os_info.train" ],
                                ],
                BREAK => 'true',
        },


Checking operation 

opConfig 4 Troubleshooting

...