changed help for filters freq->on
[spider.git] / html / adminmanual-3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5  <TITLE>The DXSpider Installation and Administration Manual : Configuration</TITLE>
6  <LINK HREF="adminmanual-4.html" REL=next>
7  <LINK HREF="adminmanual-2.html" REL=previous>
8  <LINK HREF="adminmanual.html#toc3" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="adminmanual-4.html">Next</A>
12 <A HREF="adminmanual-2.html">Previous</A>
13 <A HREF="adminmanual.html#toc3">Contents</A>
14 <HR>
15 <H2><A NAME="s3">3. Configuration</A></H2>
16
17 <H2><A NAME="ss3.1">3.1 Allowing ax25 connects from users</A>
18 </H2>
19
20 <P>As stated previously, the aim of this document is not to tell you how to configure Linux or the ax25 utilities.  However, 
21 you do need to add a line in your ax25d.conf to allow connections to DXSpider for your users.  For each interface that 
22 you wish to allow connections on, use the following format ...
23 <P>
24 <BLOCKQUOTE><CODE>
25 <PRE>
26 default  * * * * * *  - sysop /spider/src/client client %u ax25
27 </PRE>
28 </CODE></BLOCKQUOTE>
29 <P>
30 <H2><A NAME="ss3.2">3.2 Allowing telnet connects from users</A>
31 </H2>
32
33 <P>Allowing telnet connections is quite simple.  Firstly you need to add a line in /etc/services to allow connections to a 
34 port number, like this ....
35 <P>
36 <BLOCKQUOTE><CODE>
37 <PRE>
38 spdlogin   8000/tcp     # spider anonymous login port
39 </PRE>
40 </CODE></BLOCKQUOTE>
41 <P>Then add a line in /etc/inetd.conf like this ....
42 <P>
43 <BLOCKQUOTE><CODE>
44 <PRE>
45 spdlogin stream tcp nowait root /usr/sbin/tcpd /spider/src/client login telnet
46 </PRE>
47 </CODE></BLOCKQUOTE>
48 <P>
49 <P>This needs to be added above the standard services such as ftp, telnet etc.  Once this is done, you need to restart inetd 
50 like this ....
51 <P>
52 <BLOCKQUOTE><CODE>
53 <PRE>
54 killall -HUP inetd
55 </PRE>
56 </CODE></BLOCKQUOTE>
57 <P>
58 <P>
59 <P>Now login as <EM>sysop</EM> and cd spider/perl. You can test that spider is accepting telnet logins by issuing the 
60 following command ....
61 <P>
62 <BLOCKQUOTE><CODE>
63 <PRE>
64 client.pl login telnet
65 </PRE>
66 </CODE></BLOCKQUOTE>
67 <P>You should get a login prompt and on issuing a callsign, you will be given access to the cluster.  Note, you will not 
68 get a password login.  There seems no good reason for a password prompt to be given so it is not asked for.
69 <P>
70 <P>Assuming all is well, then try a telnet from your linux console ....
71 <P>
72 <BLOCKQUOTE><CODE>
73 <PRE>
74 telnet localhost 8000
75 </PRE>
76 </CODE></BLOCKQUOTE>
77 <P>
78 <P>You should now get the login prompt and be able to login as before.
79 <P>
80 <H2><A NAME="ss3.3">3.3 Setting up node connects</A>
81 </H2>
82
83 <P>In order to allow cluster node connections, spider needs to know that the connecting callsign is a cluster node.  This 
84 is the case whether the connect is incoming or outgoing.
85 In spider this is a simple task and can be done in runtime.
86 <P>
87 <P>Start up the cluster as you did before and login as the sysop with client.pl.
88 The cluster node I am wanting to make a connection to is GB7BAA but you would obviously use whatever callsign you 
89 required.
90 At the prompt type ...
91 <P>
92 <BLOCKQUOTE><CODE>
93 <PRE>
94 set/node gb7baa
95 </PRE>
96 </CODE></BLOCKQUOTE>
97 <P>
98 <P>The case does not matter as long as you have a version of DXSpider later than 1.33.  Earlier versions required the 
99 callsign to be in upper case.
100 <P>
101 <P>That is now set, it is as simple as that.  To prove it, login on yet another console as sysop and issue the command ...
102 <P>
103 <BLOCKQUOTE><CODE>
104 <PRE>
105 client.pl gb7baa (using the callsign you set as a node)
106 </PRE>
107 </CODE></BLOCKQUOTE>
108 <P>
109 <P>You should get an initialisation string from DXSpider like this ...
110 <P>
111 <BLOCKQUOTE><CODE>
112 <PRE>
113 client.pl gb7baa
114 PC38^GB7MBC^~
115 </PRE>
116 </CODE></BLOCKQUOTE>
117 <P>If the callsign you just set up as a cluster node is for an incoming connect, this is all that needs to be done.  
118 If the connection is to be outgoing then a connection script needs to be written.
119 <P>
120 <H2><A NAME="ss3.4">3.4 Connection scripts</A>
121 </H2>
122
123 <P>Because DXSpider operates under Linux, connections can be made using just about any protocol;  AX25, NETRom, tcp/ip, 
124 ROSE etc are all possible examples.  Connect scripts live in the /spider/connect directory and are simple ascii files.  
125 Writing a script for connections is therefore relatively simple.  
126 <P>
127 <P>The connect scripts consist of lines which start with the following keywords or symbols:-
128 <P>
129 <P>
130 <PRE>
131         
132 #               All lines starting with a # are ignored, as are completely blank lines.
133
134 timeout         timeout followed by a number is the number of seconds to wait for a 
135                 command to complete. If there is no timeout specified in the script 
136                 then the default is 60 seconds.
137
138 abort           abort is a regular expression containing one or more strings to look 
139                 for to abort a connection. This is a perl regular expression and is 
140                 executed ignoring case.
141
142 connect         connect followed by ax25 or telnet and some type dependent 
143                 information. In the case of a telnet connection, there can be up to 
144                 two parameters.
145                 The first is the ip address or hostname of the computer you wish to 
146                 connect to and the second is the port number you want to use (this 
147                 can be left out if it is a normal telnet session).
148                 In the case of an ax25 session then this would normally be a call to
149                 ax25_call or netrom_call as in the example above. It is your
150                 responsibility to get your node and other ax25 parameters to work 
151                 before going down this route!
152
153 '               ' is the delimiting character for a word or phrase of an expect/send 
154                 line in a chat type script. The words/phrases normally come in pairs, 
155                 either can be empty. Each line reads input from the connection until 
156                 it sees the string (or perl regular expression) contained in the
157                 left hand string. If the left hand string is empty then it doesn't 
158                 read or wait for anything. The comparison is done ignoring case.
159                 When the left hand string has found what it is looking for (if it is) 
160                 then the right hand string is sent to the connection.
161                 This process is repeated for every line of chat script. 
162
163 client          client starts the connection, put the arguments you would want here 
164                 if you were starting the client program manually. You only need this 
165                 if the script has a different name to the callsign you are trying to 
166                 connect to (i.e. you have a script called other which actually 
167                 connects to GB7DJK-1 [instead of a script called gb7djk-1]).
168 </PRE>
169 <P>
170 <P>There are many possible ways to configure the script but here are two examples, one for a NETRom/AX25 connect and 
171 one for tcp/ip.  
172 <P>
173 <BLOCKQUOTE><CODE>
174 <PRE>
175 timeout 60
176 abort (Busy|Sorry|Fail)
177 # don't forget to chmod 4775 netrom_call!
178 connect ax25 /usr/sbin/netrom_call bbs gb7djk g1tlh
179 'Connect' '' 
180 'Connect' 'c np7'
181 'Connect' 'c gb7dxm'
182 # you can leave this out if you call the script 'gb7dxm'
183 client gb7dxm ax25
184 </PRE>
185 </CODE></BLOCKQUOTE>
186 <P>
187 <P>
188 <P>
189 <BLOCKQUOTE><CODE>
190 <PRE>
191 timeout 15
192 connect telnet dirkl.tobit.co.uk
193 'login' 'gb7djk'
194 'word' 'gb7djk'
195 # tell GB7DJK-1 that it is connected to GB7DJK
196 # you can leave this out if you call this script 'gb7djk'
197 client gb7djk telnet
198 </PRE>
199 </CODE></BLOCKQUOTE>
200 <P>
201 <P>Both these examples assume that everything is set up properly at the other end.  You will find other examples in 
202 the /spider/examples directory.
203 <P>
204 <H2><A NAME="ss3.5">3.5 Starting the connection</A>
205 </H2>
206
207 <P>You start the connection, from within a sysop enabled cluster login, by typing in the word <EM>connect</EM> followed 
208 by a script name like this ....
209 <P>
210 <BLOCKQUOTE><CODE>
211 <PRE>
212 G0VGS de GB7MBC 13-Dec-1998 2041Z >connect gb7djk-1
213 connection to GB7DJK-1 started
214 G0VGS de GB7MBC 13-Dec-1998 2043Z >
215 </PRE>
216 </CODE></BLOCKQUOTE>
217 <P>This will start a connection using the script called <EM>gb7djk-1</EM>.  You can follow the connection by watching the 
218 term or console from where you started <EM>cluster.pl</EM>.  You should see something like this ...
219 <P>
220 <BLOCKQUOTE><CODE>
221 <PRE>
222 &lt;- D G1TLH connect gb7djk-1
223 -> D G1TLH connection to GB7DJK-1 started
224 -> D G1TLH G1TLH de GB7DJK 13-Dec-1998 2046Z >
225 timeout set to 15
226 CONNECT sort: telnet command: dirkl.tobit.co.uk
227 CHAT "login" -> "gb7djk"
228 received "
229 Red Hat Linux release 5.1 (Manhattan)
230 Kernel 2.0.35 on an i586
231 "
232 received "login: "
233 sent "gb7djk"
234 CHAT "word" -> "gb7djk"
235 received "gb7djk"
236 received "Password: "
237 sent "gb7djk"
238 Connected to GB7DJK-1, starting normal protocol
239 &lt;- O GB7DJK-1 telnet
240 -> B GB7DJK-1 0
241 GB7DJK-1 channel func  state 0 -> init
242 &lt;- D GB7DJK-1 
243 &lt;- D GB7DJK-1 Last login: Sun Dec 13 17:59:56 from dirk1
244 &lt;- D GB7DJK-1 PC38^GB7DJK-1^~
245 &lt;- D GB7DJK-1 PC18^ 1 nodes, 0 local / 1 total users  Max users 0  Uptime 0 00:00^5447^~
246     etc
247 </PRE>
248 </CODE></BLOCKQUOTE>
249 <P>
250 <P>With later versions of Spider there is a set/login command for users.  This tells them when a user or node logs in 
251 or out.  If you do not add a line to your scripts after the final line (or before the client line which should always 
252 be last if needed) then the login/logout information will be sent to users <I>before</I> the login actually 
253 completes.  This means if a node is unreachable, it will continue sending logins and logouts to users even though it 
254 is not actually connecting.  To avoid this use the following line ...
255 <P>
256 <BLOCKQUOTE><CODE>
257 <PRE>
258 'connect' ''
259 </PRE>
260 </CODE></BLOCKQUOTE>
261 <P>
262 <P>In a script, this might look like ...
263 <P>
264 <BLOCKQUOTE><CODE>
265 <PRE>
266 timeout 35 
267 abort (Busy|Sorry|Fail)
268 connect telnet mary 3000
269 'ogin:' 'gb7mbc'
270 '>' 'telnet 44.131.93.96 7305'
271 'connect' ''
272 </PRE>
273 </CODE></BLOCKQUOTE>
274 <P>
275 <H2><A NAME="ss3.6">3.6 Telnet echo</A>
276 </H2>
277
278 <P>Cluster links in particular suffer greatly from the presence of telnet echo.  This is caused
279 by the telnet negotiation itself and can create at worst severe loops.  At best it creates
280 unnecessary bandwidth and large logfiles!  There are things that can be done to limit this
281 problem but will not always work dependent on the route taken to connect.
282 <P>
283 <P>Telnet echo itself should only be a problem if the connection is being made to the telnet
284 port (23).  This port uses special rules that include echo negotiation.  If the connection
285 is to a different port, such as 8000, this negotiation does not happen and therefore no
286 echo should be present.
287 <P>
288 <P>Sometimes it is not possible to make a direct connection to another node and this can
289 cause problems.  There is a way of trying to suppress the telnet echo but this will not
290 always work, unfortunately it is difficult to be more specific.  Here is an example
291 of what I mean ...
292 <P>
293 <BLOCKQUOTE><CODE>
294 <PRE>
295 timeout 35
296 abort (Busy|Sorry|Fail)
297 connect telnet mary.lancs.ac.uk
298 'ogin:' 'gb7mbc'
299 'word:' 'mypasswd'
300 '\$' 'stty -echo raw'
301 '\$' 'telnet 44.131.93.96'
302 'connect' ''
303 </PRE>
304 </CODE></BLOCKQUOTE>
305 <P>So, the first connection is made by Spider.  This is fine as Spider uses the Net_Telnet
306 script from within perl.  This actually uses TCP rather than TELNET so no negotiation
307 will be done on the first connection.  Once connected to mary.lancs.ac.uk, the command
308 is sent to suppress echo.  Now a telnet is made to a cluster node that is accepting
309 connections on port 23.  The problem with this link is that the negotiation is made by
310 the remote machine, therefore you have no control over it.  The chances are that this
311 link will create echo and there will be no way you can stop it.
312 <P>
313 <P>
314 <H2><A NAME="ss3.7">3.7 Automating things</A>
315 </H2>
316
317 <P>Ok, you should now have DXSpider running nicely and allowing connects by cluster nodes or users.  However, it has 
318 to be shutdown and restarted manually and if connection scripts fail they have to be started again manually too, not 
319 much use if you are not at the console!  So, in this section we will automate both.  Firstly starting the cluster.
320 <P>
321 <H3>Autostarting the cluster</H3>
322
323 <P>This is not only a way to start the cluster automatically, it also works as a watchdog, checking the sanity of 
324 DXSpider and respawning it should it crash for any reason.
325 Before doing the following, shutdown the cluster as you did earlier.
326 <P>
327 <P>Login as root and bring up the /etc/inittab file in your favourite editor.  Add the following lines to the file near 
328 the end ...
329 <P>
330 <BLOCKQUOTE><CODE>
331 <PRE>
332 ##Start DXSpider on bootup and respawn it should it crash
333 DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
334 </PRE>
335 </CODE></BLOCKQUOTE>
336 <P>
337 <P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart it should it crash for any reason.
338 <P>
339 <P>As root type the command <EM>telinit q</EM>.  DXSpider should start up immediately.  You will see the output on tty7 
340 and if you login as <EM>sysop</EM> you should find everything running nicely.
341 <P>
342 <P>So far so good, now to automate script connections...
343 <P>
344 <H3>The crontab file</H3>
345
346 <P>Login as <EM>sysop</EM> and create a file in /spider/local_cmd called crontab.  Edit it with your favourite editor and 
347 add a line like this (I have included a comment)
348 <P>
349 <BLOCKQUOTE><CODE>
350 <PRE>
351 # check every 10 minutes to see if gb7xxx is connected and if not
352 # start a connect job going
353
354 0,10,20,30,40,50 * * * * start_connect('gb7xxx') if !connected('gb7xxx')
355 </PRE>
356 </CODE></BLOCKQUOTE>
357 <P>
358 <P>The callsign involved will be the callsign of the cluster node you are going to connect to.  This will now check 
359 every 10 minutes to see if gb7xxx is connected, if it is then nothing will be done.  If it is not, then a connect 
360 attempt will be started.
361 <P>
362 <P>There are probably lots of other things you could use this crontab file for.  If you want to know more about it, look 
363 at the 
364 <A HREF="http://www.dxcluster.org/cron.html">DXSpider</A> website at the cron page where it is 
365 explained more fully.
366 <P>
367 <HR>
368 <A HREF="adminmanual-4.html">Next</A>
369 <A HREF="adminmanual-2.html">Previous</A>
370 <A HREF="adminmanual.html#toc3">Contents</A>
371 </BODY>
372 </HTML>