README-ned-settings

NED settings details


This NED is equipped with a number of runtime configuration options "NED settings" allowing for customization by the end user. All options are configurable using the NSO API for NED settings. Most NED settings can be configured globally, per device profile or per device instance in the following locations:

global /ncs:devices/global-settings/ned-settings/cisco-nx/ profile /ncs:devices/ncs:profiles/profile:/ned-settings/cisco-nx/ device /ncs:/device/devices/device:/ned-settings/cisco-nx/

Profiles setting overrides global-settings and device settings override profile settings, hence the narrowest scope of the setting is used by the device.

If user changes a ned-setting, then user must reconnect to the device, i.e. disconnect and connect in order for the new setting to take effect.

From the NSO CLI the device instance NED settings for this NED are available under:

# config
# devices device dev-1 ned-settings cisco-nx

Press TAB to see all the NED settings.

Table of contents


1. ned-settings cisco-nx
2. connection
   2.1. ssl
3. proxy
4. proxy2
5. file-transfer
6. logger
7. auto-prompts
8. system-interface-defaults
9. live-status
10. api
11. read
   11.1. replace-config
12. write
   12.1. config-dependency
   12.2. inject-command
13. transaction
   13.1. config-abort-warning
   13.2. config-ignore-error
   13.3. inject-on-enter-exit-mode
14. persistence
15. behaviours
16. developer
   16.1. simulate-show

1. ned-settings cisco-nx


The following top level ned-settings can be modified.

2. ned-settings cisco-nx connection


Cisco Nexus connection configuration.

2.1. ned-settings cisco-nx connection ssl


Use SSL for NXAPI connections (set either 'accept-any' or a server certificate to use SSL).

3. ned-settings cisco-nx proxy


Configure NED to access device via a proxy.

4. ned-settings cisco-nx proxy2


Configure double-proxy setup: NSO <-> proxy <-> proxy2 <-> device.

5. ned-settings cisco-nx file-transfer


file-transfer configuration for scp|sftp|bash write methods.

6. ned-settings cisco-nx logger


Settings for controlling logs generated.

7. ned-settings cisco-nx auto-prompts


When using 'live-status exec any' or 'config exec' one can pass a sequence of responses to the device when 'standard' questions/prompts are received in the NED (i.e. with the square-bracket syntax described above). An alternative way to pass answer to prompts is using ned-settings 'auto-prompts', which is a way to register standard answers to standard questions. These are given as a list of question/answer pairs. The 'question' in this respect is given as a regexp.

For example, to always answer the question about overwriting files when doing file copy one can add the following ned-setting:

ned-settings cisco-nx auto-prompts 1 question "Do you want to overwrite (y/n)?[n] " answer y

This will catch the question from the device, and answer 'y'. Note that this can be used together with the square-bracket responses, for example to give a password to a file-copy command.

8. ned-settings cisco-nx system-interface-defaults


Settings to handle dynamic defaults of interfaces (corresponding to the setting of 'system default switchport' in the device), see README.md section 9.

9. ned-settings cisco-nx live-status


Configure NED settings related to live-status.

10. ned-settings cisco-nx api


Configure API (new API features/changes).

11. ned-settings cisco-nx read


Settings used when reading from device.

11.1. ned-settings cisco-nx read replace-config


Replace (or filter) config when reading from device.

12. ned-settings cisco-nx write


Settings used when writing to device.

12.1. ned-settings cisco-nx write config-dependency


  • write config-dependency

This ned-setting can be used to add dynamic dependency rules to the NED before being permanently fixed in the NED. This can be useful if a dependency bug is found and you do not want to upgrade the NED or are in a hurry for the fix.

Apart from the list id, each ned-setting list entry is configured with:

mode Regex specifying config mode where the rule is checked, don't set for top-mode.

move Regex specifying line(s) to move.

action Where to move the line(s). Can be set to before|after|last|first.

stay Regex specifying where 'move' lines will be moved with before|after action.

12.2. ned-settings cisco-nx write inject-command


  • write inject-command

The cisco-nx write inject-command ned-setting can be used to inject command line(s) in a transaction. This can be needed, for example, when deleting crypto config which requires a clear command to be run before delete.

The ned-settings is configured with:

id User defined name for this ned-setting used to identify the list entry

config-line The config line(s) where command should be injected (DOTALL regexp)

command The command (or config) to inject after|before config-line. Prefix with 'do ' if you want to run exec command in config mode. Prefix with 'exec ' if you want to run exec command in exec mode.

'where', eight values are supported: before-each inject command before each matching before-first inject command before first matching after-each inject command after each matching after-last inject command after last matching before-topmode inject command before regex topmode after-topmode inject command after regex topmode first inject command first if regex matches or is unset last inject command last if regex matches or is unset

An example (of a previously hard coded inject case):

devices global-settings ned-settings cisco-nx write inject-command C1 config-line "no crypto ikev2 keyring \S+" command "do clear crypto session" before-first devices global-settings ned-settings cisco-nx write inject-command C2 config-line "no crypto ikev2 keyring \S+" command "do clear crypto ikev2 sa fast" before-first

The above inject command configs will cause a delete of ikev2 keyring to look like this:

do clear crypto session do clear crypto ikev2 sa fast no crypto ikev2 keyring XXX

$i (where i is value from 1 to 9) can also be used to inject matches values from the config line. For example:

devices global-settings ned-settings cisco-nx write inject-command C2 config-line "no interface Tunnel(\d+)" command "do clear dmvpn session interface Tunnel $1 static" before-first

with a deletion of interface Tunnel100 results in:

!do clear dmvpn session interface Tunnel 100 static no interface Tunnel100

Hence, $1 is replaced with the first group value from the config line, which is (\d+).

13. ned-settings cisco-nx transaction


Cisco Nexus transaction configuration.

13.1. ned-settings cisco-nx transaction config-abort-warning


Configure additional device warnings that shall be treated as errors and trigger an abort in the NED. Enter as a regex.

13.2. ned-settings cisco-nx transaction config-ignore-error


Configure additional device errors that shall be treated as warnings (i.e. to be ignored, not aborting transaction).

13.3. ned-settings cisco-nx transaction inject-on-enter-exit-mode


Use to inject extra lines at enter/exit of mode in diff to send to device (optionally giving key to limit to specific list-entry).

14. ned-settings cisco-nx persistence


Cisco Nexus persistence configuration, i.e. if/how the NED persists configuration to the startup-config.

15. ned-settings cisco-nx behaviours


Cisco Nexus NED behaviours, the settings in this section can be set to either enable, disable, or enabled given the value compared to the nx-os version of the device (e.g. to accomodate syntactic or semantic variations introduced in some version). To give a version-constraint for the nx-os version, the format is .. Examples:

16. ned-settings cisco-nx developer


Contains settings used by the NED developers.

16.1. ned-settings cisco-nx developer simulate-show


Used with live-status to inject simualted output for a show command.

Last updated

Was this helpful?