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