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 207

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 ...
207
12.5.2 Creating Custom Widgets for the Dashboard
To run a custom script inside a dashboard widget:
Create a file called widget-<name>.sh in the folder /etc/config/scripts / , where <name> can be of your choosing. You can
have as many custom dashboard files as desired.
Inside this file, you can use any code you wish. When configuring the dashboard, choose widget-<name>.sh in the
dropdown list. The dashboard will run the script and display the output of the script commands inside the specific widget.
The best way to format the output is to send HTML commands back to the browser by adding echo commands in the script:
echo ‘<table>’
You can run any command and its output will display in the widget window directly.
Below is an example script writing the current date to a file and echoing HTML code back to the browser. The HTML code gets
an image from a specific URL and displays it in the widget.
#!/bin/sh
date >> /tmp/test
echo ‘<table>’
echo ‘<tr><td> This is my custom script running </td></tr>’
echo ‘<tr><td>’
echo ‘<img src=”http://www.vinras.com/images/linux-online-inc.jpg”>’
echo ‘</td></tr>’
echo ‘</table>’
exit 0
12. Status Reports
Loading ...
Loading ...
Loading ...