1 # install.pod - Torrus installation instructions
2 # Copyright (C) 2002 Stanislav Sinyagin
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 # $Id: install.pod.in,v 1.1 2010-12-27 00:04:36 ivan Exp $
19 # Stanislav Sinyagin <ssinyagin@yahoo.com>
23 =head1 Torrus Installation Instructions
27 =head2 Required Software
31 =item * Operating System
33 Any UNIX-like operation system where the required components are working.
34 The author's primary development platform is Cygwin
35 E<lt>http://www.cygwin.comE<gt>,
36 and the primary testing environments are Sun Solaris/SPARC and FreeBSD.
38 Note to B<VmWare> users: as recommended by Gord Philpott, Linux kernel for
39 guest machine needs to be compiled with the following feature enabled:
40 C<Character devices ---E<gt> Enhanced Real Time Clock Support>.
41 For other guest operating systems (e.g. FreeBSD), in order to let the
42 Torrus collector and monitor run properly, you need to add the following
43 lines to your F<torrus-siteconfig.pl>:
45 $Torrus::Scheduler::maxSleepTime = 15;
46 $Torrus::Scheduler::ignoreClockSkew = 1;
48 # B<Debian> package is maintained by Jurij Smakov and is available at
49 # E<lt>http://pkg-torrus.alioth.debian.orgE<gt>.
53 Perl version C<5.8.1> or higher is required. B<Version C<5.8.0> is not
54 recommended> because of memory access bugs and unpredictable behaviour.
55 Perl interpreter should be in PATH environment variable when
56 running C<./configure>, otherwise use
58 ./configure PERL=/path/to/perl
60 Torrus also supports Perl multithreading in Device Discovery engine and
61 in the Collector. Minimum requirements are as follows: Perl version 5.8.8
62 or higher, C<threads> module version 1.41 or higher, C<threads::shared> module
63 version 1.03 or higher. Older versions had bugs that were leading to
64 severe memory leaks and instability. After installing Perl 5.8.8,
65 you need to upgrade the C<threads> and C<threads::shared> modules manually
66 from CPAN. If any of the requirements is not met, the installer will
67 automatically disable the threads support in Torrus.
71 Round Robin Database Tool is available at:
72 E<lt>http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/E<gt>.
73 Both stable version C<1.0.x> and the development version C<1.1.x>
76 As of this writing, rrdtool version C<1.1.x> is still in its development
77 stage, but it is quite ready for using in production environments.
78 There's a small glitch in legend text alignment, and it will
83 libxml2 is the XML parser library from Gnome
84 project E<lt>http://www.gnome.orgE<gt>,
85 available as a standalone package.
86 Versions C<2.4.23> and above were tested.
88 =item * Berkeley DB version 4.2.52 or later
90 There are two distinct packages with slightly conflicting names:
91 The Berkeley DB from Sleepycat Software E<lt>http://www.sleepycat.comE<gt>,
92 and C<BerkeleyDB> Perl module available from CPAN. We will always refer
93 the latter as I<BerkeleyDB Perl module>.
95 The Berkeley DB database engine is used for all data storage.
96 Versions C<4.2.52> and above are recommended.
97 Older versions of Berkeley DB had problems with database integrity
98 in concurrent usage. By default, it installs
99 into F</usr/local/BerkeleyDB.4.2/>.
101 Unfortunately, the BerkeleyDB Perl module cannot find the include and
102 library files in that directory. Thus either configure Berkeley DB
103 with the option C<--prefix=/usr/local>, or you need to edit
104 F<config.in> in BerkeleyDB Perl module distribution.
108 Torrus requires an HTTP server. It is compatible with the following
113 =item * Apache 1.3 with mod_perl 1.0
115 =item * Apache 2.x with mod_perl 2.0
117 =item * lighttpd with FastCGI
119 =item * Apache with FastCGI
123 FastCGI is supported in Torrus version 1.0.9 or higher.
125 B<Note:> Starting from Torrus version 1.0.9, C<libapreq2> is no longer
128 See I<Torrus Web Interface Reference> for details on HTTP server configuration.
132 The Perl modules required are listed below. They are all available at
133 CPAN E<lt>http://www.cpan.orgE<gt>.
134 Some of them require other modules to be installed.
135 You can install all required modules with the following command,
136 executed from within the distribution directory:
138 perl -I `pwd`/setup_tools -MCPAN -e 'install Bundle::Torrus'
144 This is a Perl interface for libxml2, providing DOM standards compliant
145 interface. It is recommended that you use version C<1.54_3> or higher.
147 =item * BerkeleyDB perl module
149 Perl interface to the database software.
150 Version C<0.19> or higher is required.
152 =item * Template-Toolkit
154 This is a powerful set of tools for text template processing.
155 Torrus uses it for HTML files output.
156 See also the project homepage: E<lt>http://www.template-toolkit.orgE<gt>
160 Daemon invocation routines.
164 SNMP queries and traps interface. Version C<4.0.3> or higher is required.
165 I<Note>: Torrus versions prior to 1.0.9 are incompatible with Net::SNMP
166 version 6.0.0. You may need to downgrate the module to 5.2.0.
170 Escape and unescape unsafe characters
172 =item * Apache (mod_perl version 1.0)
174 Mod_perl is a Perl runtime environment integrated into Apache HTTP server.
176 =item * Apache::Session
178 User session tracking helper
180 =item * Date::Parse and Date::Format
182 Module for parsing the user input for date and time.
186 JSON data format support
191 =item * HTTP Browser requirements
193 The HTTP browser must be compatible with I<HTML 4.01 Strict> and I<CSS2>
194 specifications. The tests were made with the following browsers:
195 IE 5.5, Opera 6.12B1/Solaris, Opera 7.03/Win2K, Netscape 7.02.
199 =head2 Recommended Software
203 =item * C<XML::XUpdate::LibXML> by Petr Pajas
205 This Perl module implements XUpdate specification
206 E<lt>http://www.xmldb.org/xupdate/E<gt>. See Torrus User Guide for details.
208 =item * XSH by Petr Pajas
210 Available at E<lt>http://xsh.sourceforge.netE<gt>.
211 This is a shell wrapper for a set of utilities for XML extraction, browsing,
214 =item * libxslt from Gnome project
216 C<libxslt> is the XSLT stranslation library from Gnome
217 project E<lt>http://www.gnome.orgE<gt>, available as a standalone package.
218 It includes a binary executable, C<xsltproc>. See Torrus User Guide for
219 examples of its usage.
225 =head2 Installation Procedure
227 Create the group C<torrus> and a user C<torrus>. The user should be a member of
230 Add your Apache daemon user to the group C<torrus>.
231 Other users that will run any of Torrus processes must be included in
234 For example, in Solaris (you may need to specify the GID and UID numbers
235 according to your local administration policy):
238 useradd -c 'Torrus Daemon' -d /usr/local/torrus -g torrus torrus
239 usermod -G www,torrus www
241 Further installation process is mostly as usual:
247 The default directory layout is described below. Should you need to change it,
248 there is a number of variables and configuration options that you may use
249 as C<./configure> arguments. See C<./configure --help> for details.
250 Alternatively you can utilize the script C<./setup_tools/configure_fhs>,
251 which is designed to provide an FHS compliant setup. The script is equivalent
256 --mandir=/opt/share/man \
257 pkghome=/opt/torrus \
258 sitedir=/etc/opt/torrus
260 Do not try to change any paths by supplying them as C<make> variables,
261 this would most probably break the installation. The only C<make> variable
262 that is supported is C<DESTDIR>. It may be used for preparing the package for
263 further distribution. For example, the following command would install
264 all Torrus files as if F</tmp/stage> were the root of the filesystem:
266 make DESTDIR=/tmp/stage install
268 The presence of prerequisite Perl modules is checked during the execution
269 of C<./configure>. You can disable this by giving I<--enable-pkgonly> option.
271 The installer sets up the site configuration files, but only if
272 they don't already exist.
274 Plugin modules should be installed separately, after the Torrus software is
275 successfully installed. For each plugin, unpack the plugin distribution archive
276 to some directory, and execute
278 torrus install_plugin <UNPACKED_PLUGIN_DIR>
280 A number of directories is set up by default under the path C</var>,
281 and they must be writable by all Torrus processes, including the
284 You can control these directories' access rights by setting the following
285 environment variables: I<var_user>, I<var_group>, I<var_mode>, like follows:
287 ./configure var_group=wwwrun
289 Default values for operating systems other than Cygwin are: I<var_user=torrus>,
290 I<var_group=torrus>, I<var_mode=775>. Setgid bit is set by default for these
293 If available, you may place these directories on a fast media, for example,
294 a robust disk array. Changing the C<varprefix> variable would be generally
297 ./configure varprefix=/vol1/torrus_var
300 =head2 Torrus directory layout
303 Home directory for Torrus distribution files
306 torrus-config.pl and other configuration files
309 Command-line executables
312 POD and TXT documentation files
315 Miscelaneous example files
321 Plugins configuration
327 Supplementary files, DTDs, MIBs, color schemas, web plain files
330 Renderer output templates
333 Distrubution XML files
336 Site configurable files
339 Place for torrus-siteconfig.pl and other siteconfigs
341 @siteconfdir@/discovery/
342 Devdiscover input files
345 User-defined Renderer output templates
348 User XML configuration files
351 Place for man pages. All articles have the prefix C<torrus_>
367 Web interface session files
370 Recommended directory for RRD files generated by collectors
372 B<Note:> RRFW used the path F</var/snmpcollector> as the default path for
373 storing the RRD files. According to FHS specification, the recommended
374 path for service data files is recommended to be a subdirectory of F</srv>.
375 The path F<@defrrddir@> is used as default by C<torrus genddx>
376 utility, and you can always change it in the command line or in your
379 =head2 Configuring Torrus
381 The datasources are configured with C<%Torrus::Global::treeConfig>
382 hash in F<torrus-siteconfig.pl>.
384 In this hash, the keys give the tree names. The values for each tree name
385 are pointers to hashes, with the following keys and values:
386 I<xmlfiles> points to an array of source XML file names;
387 I<run> points to a hash with the names of the daemons
388 that would be automatically launched for the tree;
389 I<desription> gives a short line describing the tree contents.
391 Two additional arrays: C<@Torrus::Global::xmlAlwaysIncludeFirst> and
392 C<@Torrus::Global::xmlAlwaysIncludeLast> give a list of source XML
393 files that are included in every tree, in the beginning or in the end of
394 the XML files list. By default, this array consists of two files:
395 F<defaults.xml> and F<site-global.xml>. The second one is resided in
396 the user-configurable directory, and you can use it to override any
401 @Torrus::Global::xmlAlwaysIncludeFirst =
402 ('defaults.xml', 'site-global.xml');
404 %Torrus::Global::treeConfig = (
406 'description' => 'The First Tree',
407 'xmlfiles' => [qw(a1.xml a2.xml a3.xml)],
408 'run' => { 'collector' => 1, 'monitor' => 1 } },
410 'description' => 'The Second Tree',
411 'xmlfiles' => ['b1.xml', 'b2.xml'],
415 XML files are read additively within each tree, in the order
416 as they are listed. The XML compiler searches for the files in several
417 directories, listed in C<@Torrus::Global::xmlDirs>. By default, this list
418 conssists of two paths, one for Torrus distribution files, and the other
421 Files generated by C<devdiscover> usually contain I<include> statements
422 which add the vendor-specific XML files to the compilation.
424 Below follows a short description of some XML files that come with
425 Torrus distribution. Only F<site-global.xml> is installed in the directory
426 for user-configurable files, all others are placed in the distribution
433 Default parameters for the root of the datasources tree.
434 Default view definitions. B<Note:> this file is automatically
435 overwritten by C<make install>.
437 =item * site-global.xml
439 Parameters that you want to change or define for your site.
440 This file will be compiled for every tree after F<defaults.xml>,
441 and this is the place to override the defaults. The file that is supplied
442 with the Torrus distribution has some useful parameters that you may simply
444 B<Note:> this file is never overwritten by C<make install>.
446 =item * snmp-defs.xml
448 SNMP collector defaults. The file defines several templates
449 used for collecting SNMP data.
450 Do not change this file.
451 You may redefine the needed parameters in your site-specific files
454 =item * vendor/E<lt>vendorE<gt>.E<lt>productE<gt>[.E<lt>subsystemE<gt>].xml
456 SNMP collector definitions and templates for various hardware vendors and
457 products. C<devdiscover> includes some of these files automatically in the
460 =item * generic/*.xml
462 SNMP collector definitions and templates for vendor-independent MIBs. Most
463 files are named after corresponding RFC numbers.
467 In addition, the distribution package contains several example files.
469 For more details about XML configuration, see I<Torrus User Guide>
470 and I<Torrus XML Configuration Guide>.
472 =head2 Site configuration options
474 In addition to I<%Torrus::Global::treeConfig>, you may wish to set
475 some other parameters in your site configuration file
476 (F<torrus-siteconfig.pl>).
478 See F<torrus-config.pl> for the complete list
479 of varaibes that you may override in your site config. Among them,
480 most interesting are:
484 =item * C<$Torrus::Renderer::companyName>
486 The text that you specify here will appear in the top left corner
489 =item * C<$Torrus::Renderer::companyURL>
491 The company name text will be clickable with the URL specified in
497 =head2 Apache HTTP server configuration
499 Torrus web interface is designed to run under mod_perl environment
500 (E<lt>http://perl.apache.orgE<gt>).
502 See the I<Torrus Web Interface Reference> document for detailed instructions on
503 Apache configuration.
505 In short, typical Apache configuration for mod_perl version 1.0 would look
508 Alias /torrus/plain "@webplaindir@"
509 PerlRequire "@cfgdefdir@/webmux.pl"
511 SetHandler perl-script
512 PerlHandler Torrus::ApacheHandler
514 <Location /torrus/plain/>
515 SetHandler default-handler
519 =head2 Access Control Lists
521 By default, Torrus web interface requires user authentication.
522 You can disable this by changing C<$Torrus::CGI::authorizeUsers>
523 to zero in your F<torrus-siteconfig.pl>.
525 ACLs are controlled by C<acledit> utility. See I<Torrus Manual pages>
526 for detailed description. Example:
528 torrus acledit --addgroup=staff --permit=DisplayTree --for='*'
529 torrus acledit --addgroup=staff --permit=GlobalSearch --for='*'
530 torrus acledit --adduser=jsmith --password=mysecretpassword \
531 --cn="John Smith" --addtogroup=staff
532 torrus acledit --addgroup=admin \
533 --permit=DisplayTree --permit=DisplayAdmInfo --for='*'
537 In order to clean old HTTP session data, it is recommended to run
538 F<cleanup> script in a cron job, once per day:
540 #min hour mday month wday who command
541 5 3 * * * root @pkgbindir@/cleanup
544 =head2 Startup script
546 The Torrus distriubution provides a startup script which you can install in
547 the init scripts directory (/etc/init.d on most Unixes or /usr/local/etc/rc.d/
548 on FreeBSD). The script C<torrus> is created during the installation
549 process in the subdirectory <init.d> of the distribution directory.
551 The init script reads some parameters from F<@cfgdefdir@/initscript.conf>,
552 and F<@siteconfdir@/initscript.siteconf> if the latter exists.
553 By default, it makes the monitor daemons sleep for 20 minutes when
554 they are launched simultaneously with collector daemons.
557 =head2 Upgrade Procedure
559 Follow these instructions when upgrading from previous Torrus release.
561 In the previous distribution directory, look up the F<config.log> file.
562 It contains the configure options that you used in previous installation.
564 Unpack the new release distribution.
566 Run C<./configure> with the same options you used before.
568 Stop the collector and monitor processes
569 (usually by C</etc/init.d/torrus stop>).
575 Start the collector and monitor processes.
577 Start Apache process.
579 Also it is recommended to re-compile your XML configuration.
580 If you prefer not to do this, it's recommended that you clear the
581 Web interface cache both in your browser and in Torrus:
586 =head2 Planning the disk space
588 In a typical Torrus setup, there are two disk space consuming entities:
589 the RRDtool data storage and the Berkeley DB database.
591 RRDtool data files (or RRD's) are used to store the values that are gathered
592 by the collector daemons. These are the most intensively updated files,
593 so the disk speed is important here. If possible, it is better to spread
594 the RRD files across several physical disks.
596 Berkeley DB database is used to keep all the configuratiuon data
597 for your datasource trees, and it also keeps some live status information.
598 It's intensively updated during XML compilation only.
599 During normal Torrus working cycle, there are only few updates, not
600 very critical in time. The database is read quite intensively during
601 collector initialization, but usually it's the CPU speed that causes
604 For a typical Torrus installation with standard RRD creation parameters,
605 the rough estimation is as follows: the Berkeley DB database occupies
606 from 10 to 13 KB per collector datasource, and the RRD storage takes
607 approximately 80 to 85 KB per datasource.
609 For a medium-sized system, few hundred megabytes for the Berkeley DB database
610 and several gigabytes for RRD storage would be sufficient. Larger systems
611 require a thorough design and staging work. See I<Torrus Scalability Guide>
614 =head2 Network performance tuning
616 In large installations, the SNMP collector experiences quite intensive
617 input traffic bursts. Thus the UDP socket receive buffers should
618 be adapted to sustain the load. By default, Torrus sets the UDP receiving
619 buffer size, SO_RCVBUF, to 131071 bytes. This should fit most of
620 installations. However, it's useful to check the network statistics
621 if there are any UDP buffer overflows. On most systems, the commands
622 C<netstat -s -p udp> or C<netstat -s> should show you these counters.
623 The maximum buffer size is usually limited by a system kernel variable,
624 and can be increased if needed. See C<$Torrus::Collector::SNMP::RxBuffer>
625 and its comments in F<torrus-config.pl> for more details.
630 Copyright (c) 2002-2007 Stanislav Sinyagin E<lt>ssinyagin@yahoo.comE<gt>