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
- #!/bin/bash
- # Runs on Startup Event 101
- # This script runs and remove all the USB port 3 and 4 on the Quad UART
- #
- # Get all the Access devices
- outFile=/tmp/test.txt
- cliFile=/tmp/cliFile.cli
- cliCmdStr="cli show /access/"
- su admin - -c "$cliCmdStr" > $outFile
- echo "cd /settings/devices/" > $cliFile
- # Get all the USB Devices that have sub port 3 and 4
- matchPattern='usbS[0-9]-[0-9]+-[3-4]'
- while IFS= read -r line
- do
- if [[ "$line" =~ $matchPattern ]]; then
- echo "delete $BASH_REMATCH" >> $cliFile;
- echo "yes" >> $cliFile
- fi
- done < $outFile
- echo "commit" >> $cliFile
- sudo su - admin -c "cli -f $cliFile"
- rm $outFile
- rm $cliFile
- 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 ...