Tripp Lite B093-004-2E4U-V 4-Port Console Server with 4G LTE Cellular Gateway, Dual GbE NIC, 4Gb Flash and Dual SIM

Owner's Manual - Page 232

For B093-004-2E4U-V. Also, The document are for others Tripp Lite models: B093-00X-2E4U-X, B097-016/048, B098-016/048, B098-016-V

PDF File Manual, 285 pages, Read Online | Download pdf file

B093-004-2E4U-V photo
Loading ...
Loading ...
Loading ...
232
15. Advanced Configuration
Tripp Lite console servers run the embedded Linux operating system. As such, administrator users can configure the console
server and monitor, and manage attached serial console and host devices from the command line using Linux commands and
the config utility (as described in 14. Configuration from the Command Line).
The Linux kernel in the console server also supports GNU bash shell script enabling the Administrator to run custom scripts.
This chapter presents a number of useful scripts and scripting tools including:
• delete-node, a general script for deleting users, groups, hosts, UPS systems, etc.
• ping-detect, which will run specified commands when a specific host stops responding to ping requests.
15.1 Custom Scripting
The console server supports GNU bash shell commands (refer to Appendix A), enabling the Administrator to run custom
scripts.
15.1.1 Custom Script to Run when Booting
The /etc/config/rc.local script runs whenever the system boots. By default, this script file is empty. You can add any
commands to this file if you want them to be run at boot time. For example, if you wanted to display hello world:
#!/bin/sh
echo “Hello World!”
If this script has been copied from a Windows computer, you may need to run the following command on the script before
bash can run it successfully:
# dos2unix /etc/config/rc.local
Another scenario would be to call another custom script from the /etc/config/rc.local file, ensuring your custom script will run
whenever the system is booted.
15.1.2 Running Custom Scripts when Alerts are Triggered
Whenever an alert is triggered, specific scripts are called. These scripts all reside in /etc/scripts/. Below is a list of the default
scripts that run for each applicable alert:
• For a connection alert (when a user connects or disconnects from a port or network host): /etc/scripts/portmanager-user-
alert (for port connections) or /etc/scripts/sdt-user-alert (for host connections).
• For a signal alert (when a signal on a port changes state): /etc/scripts/portmanager-signal-alert .
• For a pattern match alert (when a specific regular expression is found in the serial ports character stream): /etc/scripts/
portmanager-pattern-alert .
• For a UPS status alert (when the UPS power status changes between on line, on battery, and low battery): /etc/scripts/ups-
status-alert .
• For an environmental, power and alarm sensor alerts (temperature, humidity, power load and battery charge alerts): /etc/
scripts/environmental-alert .
• For an interface failover alert: /etc/scripts/interface-failover-alert .
All of these scripts perform a check to determine whether you have created a custom script to run. The code that performs this
check is shown below (an extract from the file /etc/scripts/portmanager-pattern-alert):
# If there’s a user-configured script, run it instead
scripts[0]=”/etc/config/scripts/pattern-alert.${ALERT_PORTNAME}”
scripts[1]=”/etc/config/scripts/portmanager-pattern-alert”
for (( i=0 ; i < ${#scripts[@]} ; i++ )); do
if [ -f “${scripts[$i]}” ]; then
exec /bin/sh “${scripts[$i]}”
done
Loading ...
Loading ...
Loading ...