Creating Custom Widgets For The Dashboard - Black Box LES1101A-R2 User Manual

1101 and 1102 secure device servers
Hide thumbs Also See for LES1101A-R2:
Table of Contents

Advertisement

1101 and 1102 Secure Device Servers
To configure what is to be displayed by each widget:
Go to the Configure widgets panel and configure each selected widget (for example, specify which UPS status is to be displayed on the ups
widget or the maximum number of Managed Devices to be displayed in the devices widget).
Click Apply.
NOTE:
Dashboard configuration is stored in the /etc/config/config.xml file. Each configured dashboard will increase the config file. If this file gets
too big, you can run out of memory space on the console manager.

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 anything. You can have as many custom dashboard
files as you want.
Inside this file you can put any code you want. 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 directly on the screen, inside the specific widget.
The best way to format the output would be to send HTML commands back to the browser by adding echo commands in the script:
echo '<table>'
You can of course run any command and its output will be displayed in the widget window directly.
Below is an example script that writes the current date to a file, and then echos 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
114
Figure 12-8. Configure widgets.
724-746-5500 | blackbox.com

Advertisement

Table of Contents
loading

This manual is also suitable for:

Les1102a11011102

Table of Contents