s_add_global_config

s_add_global_config.script_main(session)
SINGLE device script
Author: Jamie Caesar

This script will add global configuration commands to the connected device. The commands sent will depend on the operating system of the connected device. For example, IOS devices get the commands listed in the ‘ios’ section of the settings for this script. If the device is running NX-OS, it will get the commands from the ‘nxos’ section of the settings, etc.

This script will prompt you to run in “Check Mode”, where the configuration changes the script would be pushed to the device are ONLY written to a file and NO CHANGES will be made to the device. If you select “No” when prompted this script will push the configuration changes to the device. Also, when the changes are pushed to the device this script will save the running config before and after the changes are made, and will also output a log of the configuration session showing all the commands pushed.

Script Settings (found in settings/settings.ini):

  • show_instructions - When True, displays a pop-up upon launching the script
    explaining where to modify the list of commands sent to devices. This window also
    prompts the user if they want to continue seeing this message. If not, the script
    changes this setting to False.
  • ios - A comma separated list of commands that will be sent to IOS devices.
  • ios-xr - A comma separated list of commands that will be sent to IOS-XR devices.
  • nxos - A comma separated list of commands that will be sent to NX-OS devices.
  • asa - A comma separated list of commands that will be sent to ASA devices.
Parameters:session (sessions.Session) – A subclass of the sessions.Session object that represents this particular script session (either SecureCRTSession or DirectSession)