> > | RackPlannerPlugin
The RackPlannerPlugin handles the tag %RACKPLANNER% and renders a rack overview (HTML table) with devices (computer, router, switches, ...).
Syntax Rules
Devices are defined within a TWiki table. Following columns are supported:
Device |
Rack |
Starting Unit |
Form Factor |
Connected to: |
Owner |
Color/Image |
Notes |
device name(s) (separated by ' / ' or ' # ' ) |
rack name |
a starting unit (a number between 1 and units ) |
a form factor (units, e.g. 4U, 2, 1U, ...) |
device(s) is/are connected to ... (comma separated list of other devices, ports ...); every 'connected to' item is displayed as a icon (see connectedtoicon , e.g. ) with the text as tooltip; if you use links the icons are also links; |
the device owner(s) is/are displayed as tooltip of the device name |
colors or a background image (a URL or shortcut, e.g. @sun - see attachments) for the table data cell |
notes are displayed as a icon (notesicon e.g. ) with the note as tooltip; if you use a link the icon is also a link |
must |
must |
must |
must |
optional |
optional |
optional |
optional |
Examples |
Server1 |
RackS21 |
10 |
2U |
port31 |
server admins |
blue,white |
not in use |
Patchfield1 / Switch2 |
RackS21 |
40 |
1U |
switch3 / router4 |
network admins / network admins |
blue,white / green,white |
3 ports free / 8 ports free |
SunServer2 |
RackS21 |
15 |
4U |
port12 |
sun server admins |
blue,white,!@sun |
|
You can use following %EDITTABLE% tag (EditTablePlugin must be installed) to simplify some things ( it must be one line):
%EDITTABLE{format="|text,10,|text,10,|text,5,1|select,1,1U,2U,3U,4U,5U,6U,7U,8U,9U,10U|text,20,|text,20,|text,10,|textarea,3x20|"
header="|*Device*|*Rack*|*Starting Unit*|*Form Factor*|*Connected to:*|*Owner*|*Color/Image*|*Notes*|"}%
This %EDITTABLE% tag is an example. Feel free to modify the attributes (format and header ). Hint: Put a %TABLE{initsort="3" initdirection="down"}% tag before the %EDITTABLE% tag to sort the table like the rack (modify initdirection to "up" if your first unit is at the top of the rack (dir="topdown" )).
Notes:
- The device order in the table is not relevant (except there's a conflict) but the column order is relevant (because the table header will be ignored).
- If more than one device uses the same unit the conflict will be displayed with a icon (see
conflicticon attribute, e.g. ). The tooltip of the icon contains the device names.
- If you have more than one device in the same unit you have to put them into a single table row and separate device names, 'connected to', owner, colors, notes with a
' / ' or a ' # ' (a whitespace before and after the separator is required).
Attributes
Usage: %RACKPLANNER{attribute1="value" attribute2="value" ... }%
Example: %RACKPLANNER{racks="rack1, rack2"}%
Attribute |
Description |
Example/Default |
Behavior: |
autotopic |
set it on and every rack name is automatically used as source topic for the device definition (racks attribute is required and the value is attached to the topic attribute value); useful if you define your racks and devices on topics with the same names as the racks |
autotopic="off" |
dir |
sets the direction of the units: topdown - unit 1 is at the top of the rack; bottomup - unit 1 is at the bottom of the rack; leftright - units are shown horizontal with unit 1 at the left; rightleft - units are shown horizontal with unit 1 at the right |
dir="bottomup" |
clicktooltip |
if enabled JavaScript tooltips are only shown with a mouse click to the table cell instead of 'mouse over' (related: enablejstooltips, clicktooltiptext) |
clicktooltip="off" |
enablejstooltips |
enables/disables JavaScript tooltips |
enablejstooltips="1" |
racks |
a comma separated list of rack names to show; if omitted all racks found on topics (see topic attribute) are shown |
racks="rack1,rack2" |
steps |
unit steps to display (useful if you use only every steps unit of a rack) |
steps="1" |
topic |
a comma separated list of source topics |
topic="%TOPIC%" |
units |
units to show |
units="46" |
Icons: |
conflicticon |
if a conflict exists this icon will be displayed |
conflicticon="%S%" |
connectedtoicon |
if a 'connected to' entry exists this icon will be displayed with the entry as tooltip |
connectedtoicon="%M%" |
notesicon |
if a 'notes' entry exists this icon will be displayed with the note as tooltip |
notesicon="%P%" |
ownericon |
only used for JavaScript tooltips |
ownericon="%ICON{persons}%" |
Formatting: |
clicktooltiptext |
tooltip text if clicktooltip is enabled |
clicktooltiptext="click for information" |
columnwidth |
column width |
columnwidth="50px" |
devicebgcolor |
default device background color |
devicebgcolor="#f0f0f0" |
devicefgcolor |
default device foreground color |
devicefgcolor="#000000" |
displayconnectedto |
if enabled the 'connected to' text entry will be displayed in the table cell instead of the 'connected to' icon |
displayconnectedto="off" |
displaynotes |
if enabled the 'notes' entry will be displayed in the table cell instead of the 'notes' icon |
displaynotes="off" |
displayowner |
if enabled the 'owner' entry will be displayed in the table cell |
displayowner="off" |
displaystats |
if enabled the statistics will be displayed |
displaystats="on" |
displayunitcolumn |
if enabled the unit column will be displayed (related: unitcolumnpos , unitcolumnformat ) |
displayunitcolumn="1" |
emptybgcolor |
default empty unit background color |
emptybgcolor="#f0f0f0" |
emptyfgcolor |
default empty unit foreground color |
emptyfgcolor="#000000" |
emptytext |
text for empty units (replacements: %U - unit number; %R - rack name) |
emptytext="empty" |
fontsize |
font size of the text (in px, pt, em, ... or xx-small, x-small, small, medium, large,x-large, xx-large, smaller, larger); don't forget to reduce the iconsize if you reduce the fontsize |
fontsize="small" |
iconsize |
icon size |
iconsize="16" |
maxheight |
defines the maximum height auf the visible rack table |
undefined / maxheight="680px" |
name |
entry of the first cell (header of the unit row) |
name="U" |
rackstatformat |
rack statistics format (replacements: %EU - empty units; %LEB - largest empty block; %OU - occupied units) |
rackstatformat="Empty: %EUU %BR%Largest Empty Block: %LEBU %BR%Occupied: %OUU" |
statformat |
statistics format (replacements: %R - rack count; %EU - empty units; %LEB - largest empty block; %OU - occupied units; %U - # units) |
statformat="#Racks: %R, #Units: %U, Occupied: %OUU, Empty: %EUU, Largest Empty Block: %LEBU" |
textdir |
defines text direction; allowed values: topdown , leftright ( only supported for dir="leftright" and dir="rightleft" yet) |
textdir="leftright" |
tooltipbgcolor |
tooltip background color (default: color from definition table) |
tooltipbgcolor="" |
toolitpfgcolor |
tooltip foreground color (default: color from definition table) |
tooltipfgcolor="" |
tooltipfixleft |
tooltip position fix (skin dependent) |
tooltipfixleft=-163 |
tooltipfixtop |
tooltip position fix (skin dependent) |
tooltipfixtop=0 |
tooltipformat |
tooltip format (replacements: %DEVICE% : device name; %FORMFACTOR% : form factor; %RACK% : rack name; %SUNIT% : starting unit; %EUNIT% : ending unit; %OWNER% : onwer; %NOTES% : notes; %OWNERICON% : owner icon; %NOTESICON% : notes icon; %CONNECTEDTOICON% : 'connected to' icon; %CLOSEBUTTON% : a close button) |
tooltipformat="<b><span title="Device name"> %DEVICE%: </span></b> <span title="Form factor">%FORMFACTOR%</span> (<span title="Start-End units">%SUNIT%-%EUNIT%</span>, <span title="Rack name">%RACK%</span>)<div title="Owner">%OWNERICON% %OWNER% </div><div title="Connected to">%CONNECTEDTOICON% %CONNECTEDTO% </div><div title="Notes">%NOTESICON% %NOTES% </div><div style="font-size:xx-small;text-align:right;"><span style="background-color:red;" title="Close tooltip">%CLOSEBUTTON%</span></div>" |
unitcolumnbgcolor |
background color of the unit column |
unitcolumnbgcolor="white" |
unitcolumnfgcolor |
foreground color of the unit column |
unitcolumnfgcolor="black" |
unitcolumnformat |
format of the unit column (replacement: %U - unit) |
unitcolumnformat="%U" |
unitcolumnpos |
positions of the unit column: left , right , both (left and right ), all (both and between racks) |
unitcolumnpos="left" |
Notes:
- You can use TextFormattingRules for some attribute values: conflicticon, connectedtoicon, emptytext, name, notesicon
- Every attribute of
%RACKPLANNER% can also be used as plugin setting. You only have to use capital letters.
Example
U | rack1 |
rack2 |
---|
46 | 45 | 44 | 43 | 42 | 41 | 40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
| . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | server02 |
| | | | server01 |
| . | . | . | . | . | . | server04 |
| | | | | . | . | . | . | . | ServerName |
| | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | a very very very very long text |
| | Empty: 41U Largest Empty Block: 41U Occupied: 5U | Empty: 38U Largest Empty Block: 27U Occupied: 8U |
---|
| #Racks: 2, #Units: 92, Occupied: 13U, Empty: 79U, Largest Empty Block: 41U |
server02: 4U ( 5-2, rack1) some notes server01: 1U ( 1-1, rack1) me some notes to server1 server04: 5U ( 40-36, rack2) someone else P123 goes to .. a very very very very long text: 1U ( 1-1, rack2)
<-- /editTable -->
Plugin Settings
Plugin settings are stored as preferences variables. To reference
a plugin setting write %<plugin>_<setting>% , i.e. %EMPTYPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Render a rack overview (e.g. of 19'' computer racks) with HTML tables
- Debug plugin: (See output in
data/debug.txt )
- Rack units (default: 46):
- Device background/foreground colors:
- Set DEVICEBGCOLOR = #f0f0f0
- Set DEVICEFGCOLOR = #000000
- Font and icon sizes:
- Set FONTSIZE = small
- Set ICONSIZE = 12px
- Fix tooltip positions (skin dependent):
- # Set TOOLTIPFIXLEFT = -163
- # Set TOOLTIPFIXTOP = 0
- Note: Every attribute of
%RACKPLANNER% can also be used as plugin setting. You only have to use capital letters.
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- Download the ZIP file from the Plugin web (see below)
- Unzip
RackPlannerPlugin.zip in your twiki installation directory. Content: File: | Description: | data/TWiki/RackPlannerPlugin.txt | Plugin topic | data/TWiki/VarRACKPLANNER.txt | Documentation | lib/TWiki/Plugins/RackPlannerPlugin.pm | Plugin Perl module | lib/TWiki/Plugins/RackPlannerPlugin/RackPlanner.pm | Plugin Perl library | pub/TWiki/RackPlannerPlugin/rackplannertooltips.js | JavaScript module | ==pub/TWiki/RackPlannerPlugin/*.png | some base icons for devices |
- Configure the Plugin:
- TWiki 4.0 and up: Run the configure script to enable the Plugin
- Change the Plugin settings as needed
- Test if the installation was successful:
Plugin Info
Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences
-- TWiki:Main.DanielRohde - 31 Aug 2006 |