r1146 Added more help
[racktables] / inc / help.php
CommitLineData
fe339610
DO
1<?
2/*
3*
4* This file contains help rendering functions for RackTables.
5*
6*/
7
8// Generate a link to the help tab.
9function genHelpLink ($tabno)
10{
11 global $root;
12 return "${root}?page=help&tab=${tabno}";
13}
14
15// Checks if a topic is present for page and tab and render a hinting element;
16// do nothing otherwise.
17function lookupHelpTopic ($pageno, $tabno)
18{
19 global $helptab;
20 if (!isset ($helptab[$pageno][$tabno]))
21 return;
ae9a3784 22 echo "<li style='position: absolute; top: 80px; right: 0px;'><a style='background-color: #f0f0f0; border: 0;' href='" . genHelpLink ($helptab[$pageno][$tabno]);
fe339610
DO
23 echo "' alt='Help' title='Help is available for this page'>";
24 printImageHREF ('helphint');
ae9a3784 25 echo '</a>';
fe339610
DO
26 return;
27}
28
29// Prints the help page content.
30function renderHelpTab ($tabno)
31{
32 switch ($tabno)
33 {
34//------------------------------------------------------------------------
35 case 'default':
36 startPortlet ('Hello there!');
37 echo '
38This is the help system of a working RackTables installation. Select one of the
39tabs above to find information on specific topics. If you are new to this
40software, just follow to the next tab.
41';
42 finishPortlet();
43 break;
44//------------------------------------------------------------------------
45 case 'quickstart':
491dbf66 46 startPortlet ('The 1st rack');
fe339610
DO
47 echo
48'
49The datacenter world is built up from resources. The first resource to start
491dbf66 50with is rackspace, which in turn is built up from racks. To create your first
fe339610
DO
51rack, open Configuration->Dictionary page and go to "Edit words" tab.
52<p>
53Here you see a bunch of portlets, each holding some odd data. The one you need
54right now is called "RackRow (3)". The only thing you need to do now is to think
55about the name you want to assign to the first group of your racks and to type
56it into the form and press OK. This can be changed later, so a simple "server
57room" is Ok.
58<p>
59Now get back to the main page and head into Rackspace page. You will see you
60rack row with zero racks. Click it and go to "Add new rack" tab. This is the
491dbf66
DO
61moment where you create the rack itself, supplying its name and height. The rack
62is empty.
fe339610 63';
491dbf66
DO
64 finishPortlet();
65 startPortlet ('The 1st object');
66 echo
67'
68To populate the rack, you need some stuff called objects. Let\'s assume you
69have a server.
70';
71 finishPortlet();
fe339610
DO
72 break;
73//------------------------------------------------------------------------
74 case 'rackspace':
75 startPortlet ('Rack design');
76 echo
77 "Rack design defines the physical layout of a rack cabinet. " .
78 "Most common reason to use the tab is absence of back rails, although " .
79 "any other design can be defined.<p>" .
80 "In this tab you can change mounting atoms' state between 'free' and 'absent'.<br>" .
81 "A selected checkbox means atom presence.";
82 finishPortlet();
83 startPortlet ('Rackspace problems');
84 echo
85 "Rack problems prevent free rackspace from being used for mounting. Such rackspace is considered " .
86 "unusable. After the problem is gone, the atom can become free again. " .
87 "In this tab you can change atoms' state from free to unusable and back.<br>" .
88 "A selected checkbox means a problem.";
89 finishPortlet();
90 break;
150fdd66
DY
91//------------------------------------------------------------------------
92 case 'iprange':
93 startPortlet ('IP Range');
94 echo
95 "This tab manages IPv4 resources. All IPv4 addresses are grouped to subnets. Subnets are flat and don't make a hierarchy. " .
96 "In other words, the whole IPv4 range you have can be divided into subnets. " .
97 "Every IPv4 address there must belong to one and only one subnetwork.";
98 finishPortlet();
99 startPortlet ('IP Address');
100 echo
101 "Every IP address can be either bound to an interface or free. On the other hand, it can " .
102 "be either reserved or not. That makes 4 possible states: bound - reserved, bound - unreserved, free - reserved ".
103 "free - unreserved. The first state is considered as \"conflicting\" and will be shown red-highlited. ".
104 "An IP address may have a \"Name\" assigned to it, which is intended to be used as a short comment. ".
105 "An example would be \"The default GW\" or \"Reserved for field engineer\" ".
106 "Binding an address to an interface is called \"allocation\". The interface is a rack object plus an interface name. " .
107 "The interface name can be the same as a physical port label on that box or something else. " .
108 "If you are binding it to a linux box with 2 physical ports, you might want to name interfaces as " .
109 "eth0, eth1, eth0:4, eth1.110, etc, whereas your physical port names will be eth1 and eth2 " .
110 "The difference between ports and interfaces is that say a switch may have 24 ports and only 1 interface, ".
111 "which is accessable from any of those ports. Generally, one IP address can be bound only to one interface, ".
112 "otherwise it's considered as a \"collision\". However, there are exceptions and a tool to mark ".
113 "those exceptions. There is a \"bond type\" or \"interface type\", which can be either \"Regular\" ".
114 "or \"Shared\" or \"Virtual\". Shared means that 2 or more peers share the same IP address ".
115 "like it's done in VRRP or HSRP. Usually, there is only one box possessing it at a time ".
116 "but when it dies, another one will have it. Shared bonds will not conflict with each other, ".
117 "but will conflict with regular bindings of the same IP address. Virtual interface is ".
118 "an assignment that usually don't broadcast itself through the network, but will allow ".
119 "the OS to accept packets with that IP address sent to the box. This is widely used ".
120 "in loadbalancing technics where loadbalancers simply do ARP proxy; they rewrite L2 address ".
121 "in L2 frames with target's address and resend them back to the network. Virtual interfaces ".
122 "do not conflict with any other interface types. Note: do not use virtual interfaces if ".
123 "your loadbalancer uses NAT. There is a NAT tab for that instead.";
124
125 finishPortlet();
126 break;
127//------------------------------------------------------------------------
128 case 'ports':
129 startPortlet ('Ports');
130 echo
131 "A port or physical interface is a small thingy on your box you can connect a cable to. ".
132 "So far this software can only handle network ports. No power outlets yet. Each port can ".
133 "have a local name, that is how this port is visible from the OS point of view. For linux box ".
134 "that will be eth0, eth1, etc. Visible lable is what is written on the port on the box ".
135 "Depending on the manufacturer you may observe labels as \"1\", \"2\", etc or something else. ".
136 "Port type is an essential property that allows port connections to be properly arranged. ".
137 "It lets you know that you won't be able to connect optical and copper ports together with one cable. ".
138 "Some ports have an L2 address. It's helpful to populate those, as you may find it handy to ".
139 "find ports by L2 addresses while investigating your STP tree. Now you can link or reserve ports ".
140 "Reserving a port is simply adding a comment to it, thus preventing it to be linked. ".
141 "A good reservation can be \"Reserved for a field engineer laptop\". Linking ports is creating ".
142 "a connection between them. That is plugging a cable to them. Only ports with compatible ".
143 "types can be linked. Say, RJ-45/100-Base TX can be linked to RJ-45/1000-Base TX, but can't ".
144 "be linked to LC/100-BASE FX. In many cases you'll need to add a bunch of ports from a switch. ".
145 "In this case there is a text area and a format selector. Just choose your device and format, ".
146 "paste the output to the textarea and click \"Parse output\" button. Also, you need to ".
147 "choose which port type is to be used, since it's not possible to guess that from the output.";
148 finishPortlet();
149//------------------------------------------------------------------------
150 case 'portfwrd':
151 startPortlet ('NATv4');
152 echo
153 "Boxes can translate their own L4 addresses to other L4 addresses on other boxes. This is called ".
154 "NAT. In protocol selection box you can choose 2 protocols so far, UDP and TCP. Source is one of ".
155 "IP addresses assigned to the box and after a colon is a box for numerical port. As a target you ".
156 "have to choose a target IP address and port it will be translated to. Add a decription if you like. ".
157 "After submitting the form you will find that if there was an object assined to the target IP address ".
158 "it will be shown as well. A single source IP address/port can be assigned to multiple target IP ".
159 "addresses/ports. That will represent an L4 loadbalancing. And vice versa, multiple sources can be ".
160 "translated to one target";
161 finishPortlet();
491dbf66
DO
162//------------------------------------------------------------------------
163 case 'workflow':
164 startPortlet ('People');
165 echo
166'
167<div class=helptext>
168<ul>
169 <li>Datacenter engineers</li>
170 <li>System administrators</li>
171 <li>Network administrators</li>
172 <li>Helpdesk</li>
173</ul>
174</div>
175';
176 finishPortlet();
177 startPortlet ('Common tasks');
178 echo
179'
180<div class=helptext>
181<ul>
182 <li>Resource allocation</li>
183 <li>Search</li>
184 <li>Changes tracking</li>
185</ul>
186</div>
187';
188 finishPortlet();
189 startPortlet ('Effective collaboration and best practices');
190 echo
191'
192<div class=helptext>
193<ul>
194 <li>Resource allocation</li>
195 <li>Search</li>
196 <li>Changes tracking</li>
197</ul>
198</div>
199';
200 finishPortlet();
201 break;
202//------------------------------------------------------------------------
203 case 'objects':
204 startPortlet ('Object life cycle');
205 echo
206'
207<div class=helptext>
208<ul>
209 <li>Creation</li>
210 <li>Resource allocation</li>
211 <li>Possible changes</li>
212 <li>Retiring</li>
213</ul>
214</div>
215';
216 finishPortlet();
217 break;
fe339610
DO
218//------------------------------------------------------------------------
219 default:
220 startPortlet ('Oops!');
221 echo "There was no help text found for help tab '${tabno}' in renderHelpTab().";
222 finishPortlet();
223 break;
224//------------------------------------------------------------------------
225 }
226}
227
228?>