Deleting extra USB port for quad Uart

Deleting extra USB port for quad Uart

Introduction:

When using the USB connections for serial access, with a quad UART only a few ports are used.  It is a good idea to remove extra ports defined so that extra licenses can be freed. For the quad UART 4 licenses are used when it is connected, however removing these unused defined ports will release the licenses. 

Steps:

When the device is booting up, the extra ports can be removed so the licenses are freed for other use.  These are Managed Device (Access) licenses that allows to add more Managed Devices.

1. Login into root shell.  after in the CLI "shell sudo su -" can be used to go into the root shell
2. Add the script the remove_usb.sh into "/etc/scripts/auditing" folder
  1. #!/bin/bash
  2. # Runs on Startup Event 101
  3. # This script runs and remove all the USB port 3 and 4 on the Quad UART
  4. #
  5. # Get all the Access devices
  6. outFile=/tmp/test.txt
  7. cliFile=/tmp/cliFile.cli
  8. cliCmdStr="cli show /access/"
  9. su admin - -c "$cliCmdStr" > $outFile
  10. echo "cd /settings/devices/" > $cliFile
  11. # Get all the USB Devices that have sub port 3 and 4
  12. matchPattern='usbS[0-9]-[0-9]+-[3-4]'
  13. while IFS= read -r line
  14. do
  15.   if [[ "$line" =~ $matchPattern ]]; then
  16.           echo "delete $BASH_REMATCH" >> $cliFile;
  17.           echo "yes" >> $cliFile
  18.   fi
  19. done < $outFile
  20. echo "commit" >> $cliFile
  21. sudo su - admin -c "cli -f $cliFile"
  22. rm $outFile
  23. rm $cliFile
  24. exit 0
3. change the file mode into an executable with "chmod +x remove_usb.sh"
4. In the NGM Web UI. Choose "Auditing::Events::Event List and select Event 101 (Nodegrid System Started)















5. in the "Action Script" choose the remove_usb.sh.  This allows the script to run every time the Nodegrid boots up

Results:

All the USBS#-#-3 or 4 will be removed from the Managed Device hence, the licenses will be freed.

    • Related Articles

    • Adding a new license in the Nodegrid

      Adding a new license in the Nodegrid The license required for each serial port is included with the product. There are some features like cluster and docker requires the license to be added separately. Follow these steps to add a license through ...
    • USB Passthrouh Feature - Nodegrid

      USB Passthrouh This feature requires the latest USB controller, currently available on new NSR USB modules "year 2021 and later. It is also available on newer models of BSR and GSR. New models for BSR and GSR that support 5G with 5 Antenna holes will ...
    • How to Connect and Configure a USB Serial device on the NodeGrid ?

      Overview: The Nodegrid OS supports the serial connections via USB as well. In particular, it supports the connections USB - USB Micro, very used on some vendor switches (e.g. Cisco), as alternatives to the RJ45 console ports. For the testing, we used ...
    • Rename an attached serial port

      Prior to 5.10.x, to rename an attached serial port, you need to go to Managed Devices :: Devices, tick the serial port that you want to rename and click on "Rename": Then change the name and "Save": From 5.10.x you can now rename the serial port from ...
    • Mapping VMs to Managed Devices

      How to map Virtual Machines to managed devices - USB hosts/ports. Virtual machines can be mapped or point to any managed device such as USB port or a USB host. This is particularly beneficial when used with the passthrough feature when a target ...