This task plugin uses nornir-netmiko netmiko_send_command task to send multiple commands to devices.


netmiko_send_commands sample usage

Code to invoke netmiko_send_commands task:

from nornir_salt import netmiko_send_commands

output =
    commands=["show run", "show clock"]

netmiko_send_commands returns

Returns Nornir results object with individual tasks names set equal to commands sent to device.

netmiko_send_commands reference

nornir_salt.plugins.tasks.netmiko_send_commands.netmiko_send_commands(task: nornir.core.task.Task, commands=None, interval=0.01, use_ps: bool = False, split_lines: bool = True, new_line_char: str = '_br_', **kwargs)

Nornir Task function to send show commands to devices using nornir_netmiko.tasks.netmiko_send_command plugin

Per-host commands can be provided using host’s object data attribute with __task__ key with value set to dictionary with commands key containing a list of or a multiline string of commands to send to device, e.g.:


["ping source", "show clock"]

Alternatively, __task__ can contain filename key with commands string to send to device.

  • kwargs – (dict) any additional arguments to pass to netmiko_send_command nornir-netmiko task

  • commands – (list or str) list or multiline string of commands to send to device

  • interval – (int) interval between sending commands, default 0.01s

  • use_ps – (bool) set to True to switch to experimental send_command_ps method

  • split_lines – (bool) if True (default) - split multiline string to commands, if False, send multiline string to device as is; honored only when use_ps is True, split_lines ignored if use_ps is False

  • new_line_char – (str) characters to replace in commands with new line \n before sending command to device, default is _br_, useful to simulate enter key

Return result

Nornir result object with task results named after commands