1 # xmlconfig.pod - Torrus configuration guide
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: xmlconfig.pod.in,v 1.1 2010-12-27 00:04:34 ivan Exp $
19 # Stanislav Sinyagin <ssinyagin@yahoo.com>
23 =head1 Torrus XML Configuration Guide
27 The Torrus configuration consists of several XML files.
28 Once the XML configuration is changed, it must
29 be compiled into the database by executing C<torrus compilexml>.
30 In addition, when I<Renderer>, I<Collector> and I<Monitor> processes
31 notice the configuration changes, they refresh their information automatically.
33 The top-level XML element is always C<E<lt>configurationE<gt>>, with
34 sub-elements defining various sections, like datasources or views:
38 <!-- Optional inclusion of other XML files -->
39 <include filename="myconfig.xml"/>
42 <!-- Data sources tree definition -->
46 <!-- View definitions -->
50 <!-- Token sets definitions ->
54 <!-- Monitor definitions ->
59 Multiple XML files are interpreted in additive matter, i.e.
60 C<E<lt>datasourcesE<gt>> section from one file is concatenated with
61 the corresponding sections of previous files. If the same
62 parameter is defined for the same subtree in several input files,
63 the last processed value gets into the configuration.
65 Additional XML files may be added to the compilation list by means of
66 C<E<lt>includeE<gt>> statement. They will be processed recursively
67 before the content of the XML file they are referenced from.
68 The argument C<filename> determines the
69 name of the file in standard XML files directory.
70 It is safe to include the same file several times,
71 Torrus compiler guarantees that files are only processed once.
73 Some kinds of sections, like C<E<lt>datasourcesE<gt>>, allow to
74 define the same elements two or more times. In this case,
75 the previous parameter values are overridden by the new values.
77 Each component of the configuration is defined by the set of I<parameters>.
78 They are specified in a common manner, differentiating in parameter names only:
80 <view name="default-rrd-html">
81 <param name="view-type" value="html" />
82 <param name="expires" value="300" />
83 <param name="html-template" value="default-rrd.html" />
86 The parameter value can be specified either by C<value> XML attribute,
87 or by the text contents of the C<E<lt>paramE<gt>> element.
89 Some parameter values require other parameters to be defined, like in the
90 above example: a view of type C<html> cannot exist without a template.
92 After I<all> XML files are compiled, the parameters are checked for validity
97 By default, all XML input is treated as UTF-8 (unicode). This is important
98 because all the HTML output generated by Torrus is encoded UTF-8.
100 However, you may use Latin1 (ISO-8859-1) encoding in your XML files.
101 In order to ensure correct displaying of non-ASCII characters,
102 the encoding must be specified in your XML files:
104 <?xml version="1.0" encoding="ISO-8859-1"?>
106 You need this only in those files containing non-ASCII characters
109 In addition, version C<1.54_3> or higher of C<XML::LibXML> is required, and
110 Torrus version 0.0.16 or above.
115 In the top level of the configuration tree, a number of macros may be defined.
116 Currently they are used in C<snmp-object> parameter only.
117 Macros are specified with C<E<lt>defE<gt>> elements, being the direct
118 children of C<E<lt>definitionsE<gt>> element:
122 <!-- IF-MIB:ifTable -->
123 <def name="ifDescr" value="1.3.6.1.2.1.2.2.1.2" />
124 <def name="ifPhysAddress" value="1.3.6.1.2.1.2.2.1.6" />
125 <def name="ifInOctets" value="1.3.6.1.2.1.2.2.1.10" />
126 <def name="ifInUcastPkts" value="1.3.6.1.2.1.2.2.1.11" />
127 <def name="ifInErrors" value="1.3.6.1.2.1.2.2.1.14" />
128 <def name="ifOutOctets" value="1.3.6.1.2.1.2.2.1.16" />
129 <def name="ifOutUcastPkts" value="1.3.6.1.2.1.2.2.1.17" />
130 <def name="ifOutErrors" value="1.3.6.1.2.1.2.2.1.20" />
132 <!-- Default Interface index lookup -->
133 <def name="IFIDX" value="M($ifDescr, %interface-name%)" />
137 These definitions are global across all XML configuration files,
138 and are referenced with dollar sign and the definition name, e.g.:
140 <leaf name="ifInErrors">
141 <param name="snmp-object" value="$ifInErrors.$IFIDX" />
145 =head2 Parameter properties
147 Some parameters require special handling during the compilation or
148 at the runtime. The parameter properties define such behaviour in the
151 Currently two properties are recognized: "remspace" and "expand".
155 <!-- Parameters where space is removed from values -->
156 <prop param="action" prop="remspace" value="1"/>
157 <prop param="display-rpn-expr" prop="remspace" value="1"/>
158 <prop param="ds-names" prop="remspace" value="1"/>
164 =head2 Datasource definitions
166 Datasources are organized into a tree hierarchy. All parameters are inherited
167 by the subtrees and leafs from their parents, and can be overridden on
170 The datasources tree consists of two key types of components:
171 I<subtree> and I<leaf>. A subtree can have child subtrees or leaves.
172 A leaf can never have children. A subtree represents logical aggregation,
173 while the leaf always represends the actual datasource.
175 In XML configuration, a child subtree or leaf belongs to the parent
176 element, like the following:
179 <!-- This is the first child of the tree root -->
180 <subtree name="Netflow">
181 <param name="ds-type" value="rrd-file" />
182 <param name="comment"
183 value="Netfow data collected by FlowScan with CarrierIn.pm" />
184 <!-- All Flowscan-generated files reside here -->
185 <param name="data-dir" value="/var/local/flowscan/graphs" />
186 <subtree name="Exporters">
187 <param name="comment" value="Netflow exporting devices" />
189 <!-- all exporters defined here -->
192 <subtree name="Total">
193 <param name="data-file" value="total.rrd" />
195 <param name="comment" value="Bits per second" />
196 <param name="leaf-type" value="rrd-def" />
197 <param name="rrd-ds" value="bits" />
198 <param name="rrd-cf" value="AVERAGE" />
201 <param name="comment" value="Packets per second" />
202 <param name="leaf-type" value="rrd-def" />
203 <param name="rrd-ds" value="pkts" />
204 <param name="rrd-cf" value="AVERAGE" />
206 <leaf name="packlen">
207 <param name="comment" value="Average packet length in bytes" />
208 <param name="leaf-type" value="rrd-cdef" />
209 <param name="rpn-expr" value="{bps},8,/,{pps},/" />
216 Each subtree or a leaf is identified by a I<path>, the symbolic
217 notation similar to filesystem paths. In any path notation,
218 subtree names always end with slash (/), and this trailing slash is
219 the part of the name. In this case, any subtree is identified by a path
220 ending with slash, while leaf paths always end with a word symbol.
221 The top-level subtree is identified by a single slash.
223 The other components of the datasouce definition are I<templates> and
228 A template is used when it's needed to define multiple different pieces of
229 the configuration in the same way. For instance, the definition for
230 input/output octets and bits can be specified once in a template,
231 and then applied where appropriate.
233 The piece of XML configuration inside the C<E<lt>templateE<gt>>
234 element is memorized under the template name, and reproduced
235 in every occurrence of C<E<lt>apply-templateE<gt>> with the corresponding
236 template name. The template definition must be the direct child
237 element of C<E<lt>configurationE<gt>> XML element:
240 <!-- Default views must be defined -->
241 <param name="default-subtree-view" value="default-dir-html" />
242 <param name="default-leaf-view" value="default-rrd-html" />
244 <!-- Many of our RRDs have the field "bits" - let's define it here -->
245 <template name="bps">
247 <param name="comment" value="Bits per second" />
248 <param name="leaf-type" value="rrd-def" />
249 <param name="rrd-ds" value="bits" />
250 <param name="rrd-cf" value="AVERAGE" />
254 <subtree name="Total">
255 <param name="data-file" value="total.rrd" />
256 <apply-template name="bps" />
258 <param name="comment" value="Packets per second" />
259 <param name="leaf-type" value="rrd-def" />
260 <param name="rrd-ds" value="pkts" />
261 <param name="rrd-cf" value="AVERAGE" />
263 <leaf name="packlen">
264 <param name="comment" value="Average packet length in bytes" />
265 <param name="leaf-type" value="rrd-cdef" />
266 <param name="rpn-expr" value="bps,8,/,pps,/" />
273 Alias is the alternative symbolic name for a subtree or a leaf.
274 It can be even a name from a different subtree hierarchy.
275 If that alternative hierarchy does not exist, the corresponding
276 subtrees are created:
278 <subtree name="62.3.44.55">
279 <alias>/Netflow/ExportersByName/rtrTelehouse1/</alias>
282 =head3 Compile-time variables
284 Compile-time variables are those defined somewhere in datasource hierarchy,
285 and valid within a given subtree and its children. It is possible to define
286 pieces of XML configuration which are or are not compiled, depending on the
287 value of corresponding variable.
289 Variables are set by C<setvar> XML element, with mandatory attributes
290 C<name> and C<value>.
292 Variable values are used in C<iftrue> and C<iffalse> XML elements.
293 Mandatory parameter C<var> specifies the variable name. The child XML elements
294 are compiled if the variable value is true or false, correspondingly.
295 A true value is C<true> or a nonzero number. Undefined variable is identified
300 <template name="cisco-cbqos-classmap-meters">
302 <iftrue var="CiscoIOS_cbQoS::CMNoBufDrop">
303 <leaf name="Dropped_No_Buffer">
309 <subtree name="QoS_Stats">
310 <setvar name="CiscoIOS_cbQoS::CMNoBufDrop" value="true"/>
315 =head3 Parameter value substitution
317 For any given leaf, some parameters may reference the other parameter values,
318 by embracing the parameter name with percent signs:
320 <param name="data-file" value="%snmp-host%_hostaverages.rrd" />
322 The parameter substitution is performed at runtime. The substitution formula
323 may be defined at a higher subtree level, and the substitution itself will
326 The parameter substitution is performed only to those paraneters
327 which are defined with the property "expand".
329 =head3 Common parameters
335 Mandatory parameter for every datasource leaf. Currently, the following values
342 The datasource is an RRD file generated by some external collector.
343 Implies mandatory parameters: C<data-dir>, C<data-file>, C<leaf-type>.
347 The datasource is generated by Torrus Collector.
348 Implies mandatory parameters: C<collector-type>, C<storage-type>,
349 C<collector-period>, C<collector-timeoffset>.
351 =item * C<rrd-multigraph>
353 This leaf is dedicated to displaying of multiple
354 other datasources in one graph. It cannot be referenced for any
355 other purpose, because there's no numeric value associated with it.
361 Optional. If defined, it should contain a unique string identifying
362 this particular leaf or subtree.
365 =item * C<node-display-name>
367 Optional. If defined, it overrides the subtree or leaf name for displaying.
368 The subtree and leaf names are not allowed to have spaces and special
369 characters, and this parameter helps to display strings as they are, such as
370 router interface names.
375 Optional. This is a string of text which is displayed when browsing through
380 Optional. This parameter is not inherited by child nodes. If defined,
381 the user is offered a I<Help> shortcut in the given subtree or view.
382 It allows to open a new window with the help text displayed, together with
383 the current path. Some simple markup is allowed in the text, in a format
384 of Template-Toolkit tool:
385 C<[%em('some text')%]> would be displayed in italics, and
386 C<[%strong('some text')%]> would be bold.
390 Optional. Comma-separated list of monitor names (spaces are allowed) that
391 must be run upon periodic runs of monitor module (see I<Monitor definitions>
392 section of this manual). Monitor schedule parameters must be defined
393 for the monitor to run properly: C<monitor-period> and C<monitor-timeoffset>.
395 =item * C<monitor-period>, C<monitor-timeoffset>
397 Mandatory parameters for leaves that have C<monitor> defined.
398 They define the monitor schedule for each individual datasource.
399 The time for execution is determined by formula:
401 time + period - (time mod period) + timeoffset
403 =item * C<monitor-vars>
405 Required if one or more monitors requires the variables. In monitor's
406 RPN expressions, the variables are referenced as C<#varname>. These
407 variables are looked up in the leaf's C<monitor-vars> parameter.
408 The syntax of this parameter is semicolon-delimited C<name=value> pairs:
410 <param name="monitor-vars" value="min=300000;max=1000000"/>
412 =item * C<monitor-action-target>
414 Optional. Specifies a reference to an alternative leaf which will be used
415 for the monitor action. For example, you might need to see a multigraph
416 leaf in the tokenset instead of one single datasource.
418 =item * C<precedence>
420 Optional. Default value: C<0>. When rendering, the subtree listing is
421 sorted according to precedence and alphabetic order of names.
422 The higher the precedence, the closer to the top of the list
423 the child node is displayed.
427 Optional. If given, produces a short listing at the top of the HTML output,
428 with tabulated values. Format: C<Category1:Value1; Category2:Value2...>.
429 Spaces around the delimiters are ignored.
433 <subtree name="rtrZurich1">
434 <param name="legend">
437 Telephone: 01 9911299
440 =item * C<graph-title>
442 A horizontal string at the top of the graph.
444 =item * C<graph-legend>
446 Optional. This legend text is printed inside the graph explaining
449 =item * C<vertical-label>
451 Optional. Text to print along Y axsis on the graph.
453 =item * C<graph-lower-limit>, C<graph-upper-limit>
455 Optional. Fix the upper and lower boundaries of the graph.
457 =item * C<graph-rigid-boundaries>
459 Optional. When set to "yes", the graph will not expand if the value is outside
460 the lower or upper limit.
462 =item * C<rrd-scaling-base>
464 Optional. Valid values are: "1000" and "1024". Default: "1000".
465 Determines the base for kilo-, mega-, and giga- scaling factor.
466 Normally it should be 1000 for traffic counters, and 1024 for memory
469 =item * C<graph-logarithmic>
471 Optional. When set to "yes", the graph is drawn in logarithmic y-axis scale.
473 =item * C<line-style>, C<line-color>
475 These optional parameters override the corresponding ones from the view
478 =item * C<default-subtree-view>, C<default-leaf-view>
480 Mandatory. Determine the default view for a leaf or subtree, correspondingly.
481 See I<View definitions> section of this manual.
483 =item * C<rrgraph-views>
485 Mandatory. Defines 5 views to display the graphs. Must contain 5
486 comma-delimited view names for short-period, daily, weekly, monthly,
489 =item * C<tokenset-member>
491 Optional. Adds this leaf or this subtree child leaves to the specified
492 token sets. Tokenset names are comma-separated, and must be defined in
493 C<E<lt>token-setsE<gt>> part of configuration.
495 =item * C<descriptive-nickname>
497 Optional. If defined, it is used in tokenset members listing as a member
498 identifier, instead of the leaf path.
502 Optional. Valid values: C<yes>, C<no>.
503 When set to C<yes>, the leaf or subtree is not
504 displayed in the subtree listing,
505 unless C<SHOWHIDDEN> option is true. When C<SHOWHIDDEN> is enabled,
506 the node name and comment are shown in italics.
508 =item * C<has-overview-shortcuts>, C<overview-shortcuts>,
509 C<overview-subleave-name-X>, C<overview-shortcut-text-X>,
510 C<overview-shortcut-title-X>, C<overview-page-title-X>,
511 C<overview-direct-link-X>, C<overview-direct-link-view-X>
513 When C<has-overview-shortcuts> is set to C<yes> on a subtree level,
514 default HTML templates expect the five parameters to be set.
515 C<overview-shortcuts> is a comma-separated list of shortcut names,
516 and for each name "X", C<overview-subleave-name-X> defines the
517 current subtree's grandchild leaves name which would compose the overview page.
518 When C<overview-direct-link-X> is set to C<yes>, the URL under the
519 graph will point to the direct child subtree, and
520 C<overview-direct-link-view-X> will define the view for that subtree.
521 Usually this view would be C<expanded-dir-html>.
523 =item * C<ignore-lower-limit>, C<ignore-upper-limit>, C<ignore-limits>
525 Optional. When set to C<yes>, they make the renderer ignore
526 C<graph-lower-limit>, C<graph-upper-limit>, or both, accordingly.
527 In addition, C<ignore-limits> disables the C<graph-rigid-boundaries>
530 =item * C<graph-ignore-decorations>
532 Optional. When set to C<yes>, the view C<decorations> are ignored.
534 =item * C<graph-disable-gprint>
536 Optional. When set to C<yes>, the view parameter C<gprint-values> and other
537 GPRINT-related parameters are ignored.
539 =item * C<hrule-legend-I<name>>
541 Optional. If a horizontal rule with the given name is defined, this parameter
542 specifies the legend to be printed.
544 =item * C<searchable>
546 Optional. If set to C<yes>, the corresponding subtree or leaf is included
547 in the search database.
552 =head3 RRD-related parameters
558 Mandatory. Specifies the filesystem directory
559 path where the data files are resided.
563 Mandatory. Name of the data file.
567 Mandatory. Determines the type of RRD access. Recognized values are:
573 Corresponds to DEF specification in RRDgraph query. Implies two mandatory
574 parameters: C<rrd-ds> and C<rrd-cf>, giving the DS name and consolidation
575 function, correspondingly.
579 Mandatory when a leaf refers to an RRD file (C<storage-type=rrd> in
580 C<collector> leaves or C<leaf-type=rrd-def> in C<rrd-file> leaves). The
581 parameter Specifies the RRD datasource name within a file.
585 Mandatory when a leaf refers to an RRD file (C<storage-type=rrd> in
586 C<collector> leaves or C<leaf-type=rrd-def> in C<rrd-file> leaves). The
587 parameter Specifies the RRD datasource name within a file.
591 Mandatory under the same conditios as C<rrd-ds>. Defines the default
592 consolidation function which is used when retrieving the RRD data.
596 Supported for C<ds-type=rrd-file> only.
597 Corresponds to CDEF specification in RRDgraph query. Implies one
598 mandatory parameter: C<rpn-expr>, which gives the RPN expression.
599 Other leaves' value references are specified in curly braces. These leaves
600 can be specified as relative or absolute paths in the configuration tree.
601 See I<RPN expressions in Torrus> manual for more details.
605 =item * C<rrd-hwpredict>
607 Optional. If equals to C<enabled>, then this RRD datasource
608 is expected to have HWPREDICT and all the suite of
609 Holt-Winters consolidation functions.
610 In case of C<ds-type=collector>, C<rrd-hwpredict=enabled> indicates
611 that the RRD file must be created with use of Holt-Winters RRAs.
613 =item * C<rrd-create-dstype>
615 Mandatory when C<ds-type=collector> and C<storage-type=rrd>.
616 Specifies the datasource type for RRD creation. Valid values are:
617 C<GAUGE>, C<COUNTER>, C<DERIVE>, C<ABSOLUTE>.
619 =item * C<rrd-create-rra>
621 Mandatory when C<ds-type=collector> and C<storage-type=rrd>.
622 Space-separated list of RRA definitions for RRD creation, as they
623 are passed to RRD Create command.
626 <!-- Round-robin arrays to be created, separated by space.
627 In this example, we keep 5-minute details for 2 weeks,
628 30-minute average and maximum details for 6 weeks,
629 and 1-day aggregated stats for 2 years -->
630 <param name="rrd-create-rra">
631 RRA:AVERAGE:0.5:1:4032
632 RRA:AVERAGE:0.5:6:2016 RRA:MAX:0.5:6:2016
633 RRA:AVERAGE:0.5:288:732 RRA:MAX:0.5:288:732
636 =item * C<rrd-create-heartbeat>
638 Mandatory when C<ds-type=collector> and C<storage-type=rrd>.
639 Heartbeat parameter as defined in RRD Create manual page.
641 =item * C<rrd-create-min>, C<rrd-create-max>
643 Optional minimum and maximum parameters for RRD datasource.
645 =item * C<rrd-create-hw-rralen>
647 Mandatory when C<ds-type=collector> and C<storage-type=rrd>
648 and C<rrd-hwpredict=enabled>. Specifies the RRA length for
649 Holt-Winters archives. Recommended same length as main 5-minutes RRA.
651 =item * C<rrd-create-hw-season>, C<rrd-create-hw-alpha>,
652 C<rrd-create-hw-beta>, C<rrd-create-hw-gamma>,
653 C<rrd-create-hw-winlen>, C<rrd-create-hw-failth>
655 Optional Holt-Winters parameters. Default values are:
658 alpha=0.1, beta=0.0035, gamma=0.1,
659 window_length=9, failure_threshold=6
663 =head3 Collector-related parameters
667 =item * C<collector-type>
669 Mandatory parameter for datasource type C<collector>. Currently supported
670 values are: C<snmp> and C<cdef>. Other valid values may be added with plugins.
672 =item * C<storage-type>
674 Mandatory parameter for datasource type C<collector>. Comma-separated list
675 of storage types. The collected value is duplicated on every storage listed.
676 Supported values are: C<rrd>, C<ext>. For C<ext> (external storage),
677 see the I<Reporting Setup Guide>.
679 =item * C<collector-period>, C<collector-timeoffset>
681 Mandatory parameters for datasource type C<collector>.
682 They define the collector schedule for each individual datasource.
683 The time for execution is determined by formula:
685 time + period - (time mod period) + timeoffset
687 =item * C<collector-dispersed-timeoffset>
689 Optional. When set to C<yes>, C<compilexml> spreads the collector offsets
690 among values determined from C<collector-timeoffset-min>,
691 C<collector-timeoffset-max>, C<collector-timeoffset-step>,
692 and C<collector-timeoffset-hashstring>.
694 =item * C<collector-timeoffset-min>,
695 C<collector-timeoffset-max>, C<collector-timeoffset-step>
697 Mandatory when C<collector-dispersed-timeoffset> is set to C<yes>.
698 They define the limits and the step for collector timeoffset dispersion.
700 =item * C<collector-timeoffset-hashstring>
702 Mandatory when C<collector-dispersed-timeoffset> is set to C<yes>.
703 Defines the string that is used as a hash for timeoffset dispersion.
705 =item * C<collector-instance-hashstring>
708 Defines the string that is used as a hash to calculate the collector
709 instance number for a particular leaf.
710 By default it is defined as C<%system-id%>, so that
711 the same collector instance deals with every remote system.
713 =item * C<collector-instance>
715 Mandatiry. The parameter defines the collector instance number.
716 This parameter is automatically calculated by the configuration compiler.
718 =item * C<transform-value>
720 Optional. Defines a piece of Perl code that will be used for value
721 transformation. The keyword C<DOLLAR> is replaced with the dollar sign ($),
722 and C<MOD> is replaced with the percent sign (%).
723 The initial value is supplied in C<$_>, which should be referenced as
724 C<DOLLAR_> in your Perl code.
725 The code should return a numeric value or C<U> for an undefined
726 value. The returned value is then passed to the storage.
727 The parameter substititions are performed on the value of the
728 parameter, therefore it should not contain the percent(%) and dollar ($) signs.
732 Optional. Collector may return values which need translation into
733 numbers. This parameter defines the mapping for such values. The
734 parameter value is a comma-separated list of C<value:number> pairs.
737 =item * C<collector-scale>
739 Optional. Specifies the translation RPN formula for the data before
740 being passed to RRD database. Implicitly the datasource value is appended
741 to the left of the given RPN. I<Warning:> the translation works I<before>
742 the RRDtool processes the data, so it makes sence to scale only non-COUNTER
745 =item * C<snmp-ipversion>
747 Mandatory for C<collector-type=snmp>. Valid values are C<4> and C<6>. The
748 parameter defines the IP protocol version. If C<snmp-host> contains a DNS
749 name, the IP address is determined by looking up A or AAAA DNS records,
750 according to IP version.
752 =item * C<snmp-transport>
754 Mandatory for C<collector-type=snmp>. Valid values are C<tcp> and C<udp>.
759 Mandatory when C<collector-type=snmp>. Specifies the hostname or IP address
764 Mandatory when C<collector-type=snmp>. Specifies the UDP port of the
767 =item * C<domain-name>
769 Optional DNS domain name. If given, and if C<snmp-host> does not contain
770 dot symbol (.), this domain name is appended to C<snmp-host>.
772 =item * C<snmp-localaddr> and C<snmp-localport>
774 Optional parameters specifying the local socket binding address and port.
776 =item * C<snmp-version>
778 Mandatory when C<collector-type=snmp>. Specifies the SNMP version for the
779 given device. Valid values are: C<1>, C<2c>, C<3>.
781 =item * C<snmp-community>
783 Mandatory when C<collector-type=snmp> and SNMP version is
784 C<1> or C<2c>. Specifies the SNMP community for the given device.
786 =item * C<snmp-username>
788 Mandatory when C<collector-type=snmp> and SNMP version is C<3>.
790 =item * C<snmp-authkey>
792 Optional authentication key for SNMPv3. If not defined, the authentication
793 level is set to C<noAuthNoPriv>. If only C<snmp-authkey> or
794 C<snmp-authpassword> are specified, the security level is set to
795 C<authNoPriv>. The security level is set to C<authPriv> if either
796 of C<snmp-privkey> or C<snmp-privpassword> is defined.
798 =item * C<snmp-authpassword>
800 Optional authentication password for SNMPv3. See notes for C<snmp-authkey>
803 =item * C<snmp-authprotocol>
805 Optional authentication protocol for SNMPv3. Valid values: C<md5> or C<sha>.
808 =item * C<snmp-privkey>
810 Optional privacy key for SNMPv3. If defined, C<snmp-authkey> or
811 C<snmp-authpassword> must be defined too.
813 =item * C<snmp-privpassword>
815 Optional privacy password for SNMPv3. If defined, C<snmp-authkey> or
816 C<snmp-authpassword> must be defined too.
818 =item * C<snmp-privprotocol>
820 Optional privacy protocol for SNMPv3. Valid values: C<des>, C<aes128cfb>,
821 or C<3desede>. Default is C<des>.
823 =item * C<snmp-timeout>
825 Mandatory when C<collector-type=snmp>. Specifies the SNMP session timeout
828 =item * C<snmp-retries>
830 Mandatory when C<collector-type=snmp>. Specifies the SNMP session retry count.
832 =item * C<snmp-oids-per-pdu>
834 Mandatory when C<collector-type=snmp>. Specifies the number of SNMP OIDs per
837 =item * C<snmp-object>
839 Mandatory when C<collector-type=snmp>. Specifies the SNMP OID to be polled
840 from the agent. The object must return a single numeric value.
842 In order to reference the dynamic instances, i.e. interface counters,
843 two mapping types are supported: reverse mapping and variable value
846 Reverse mapping has syntax as follows:
850 The result of reverse mapping is the tail of the OID which has the head
851 C<baseoid> and whose value equals the string.
853 Variable value substitution is defined by syntax:
857 The returned value must be a numeric value which is substituted in place
860 =item * C<snmp-object-type>
862 Optional. Supported values: C<COUNTER64>, C<OTHER>. When set to C<COUNTER64>,
863 the SNMP variable value is treated as 64-bit integer. Not using this
864 parameter may lead to loss of precision.
866 =item * C<snmp-check-sysuptime>
868 Optional. Default value: C<yes>. When set to C<no>, the collector does not
869 query C<SNMPv2-MIB::sysUpTime> (C<1.3.6.1.2.1.1.3.0>). By default,
870 the uptime counter is used to detect if the agent was rebooted between
871 the collector cycles. In this case the dynamic maps for the given host
872 are automatically rebuilt. This parameter is needed for compatibility
873 with some non-standard agents which don't implement this OID.
875 =item * C<snmp-max-msg-size>
877 Optional. If defined, it sets the SNMP maximum message size different from
878 default 1472 octets (true for UDP/IPv4, see Net::SNMP documentation for more
881 =item * C<snmp-ignore-mib-errors>
883 Optional. If set to C<yes>, the SNMP errors C<noSuchObject>, C<noSuchInstance>,
884 C<endOfMibView> are ignored, and no action is performed when such errors
889 Mandatory for every collector type.
890 Default value for SNMP collector: C<%snmp-host%>.
891 Unique identifier of the host.
892 This parameter is used in various template definitions for
893 C<data-file>, C<descriptive-nickname> and C<collector-timeoffset-hashstring>.
897 Mandatory when C<collector-type=cdef>. The RPN defines an arithmetic expression
898 that is used to create a new datasource from several other ones. For example,
899 it may define the sum of traffic on several different interfaces.
901 =item * C<cdef-collector-delay>
903 Mandatory when C<collector-type=cdef>. Defines the delay time in collector
904 periods. The collector will read the data from the RPN datasources with the
905 specified delay from the current time. F<cdef-collector-defs.xml> sets
906 the default value to 0.
908 =item * C<cdef-collector-tolerance>
910 Mandatory when C<collector-type=cdef>. Delay time in collector periods that
911 the collector accepts when no recent data is available.
912 F<cdef-collector-defs.xml> sets the default value to 2.
917 =head3 RRD-Multigraph leaves
919 The leaves with C<ds-type=rrd-multigraph> are dedicated for
920 displaying of several datasource values in one graph.
921 Such leaves cannot be referenced for a numerical value, hence
926 <subtree name="SampleMulti">
927 <leaf name="sample1">
928 <param name="ds-type" value="rrd-multigraph" />
929 <param name="ds-names" value="in,out" />
930 <param name="foobarpath"
931 value="/SNMP/Routers/213.230.38.4/FastEthernet0_0" />
933 <!-- parameter name tail is formed by the DS name -->
935 <param name="ds-expr-in" value="{%foobarpath%/locIfInBitsSec}" />
936 <param name="graph-legend-in" value="Bits per second in" />
937 <param name="line-style-in" value="AREA" />
938 <param name="line-color-in" value="#00FF00" />
939 <param name="line-order-in" value="1" />
941 <param name="ds-expr-out" value="{%foobarpath%/locIfOutBitsSec}" />
942 <param name="graph-legend-out" value="Bits per second out" />
943 <param name="line-style-out" value="LINE2" />
944 <param name="line-color-out" value="#0000FF" />
945 <param name="line-order-out" value="2" />
956 Comma-separated list of symbolic DS names. These names are
957 used for other DS-specific parameter names formation.
958 In the parameter descriptions below, C<X> stands for the DS name.
962 Datasource leaf RPN expression.
963 Any other parameter values may be substituted as C<%parameter_name%>.
965 =item * C<graph-legend-X>
967 Short description text used as the graph legend.
969 =item * C<line-style-X>
971 Line specification in RRD graph. May be I<C<LINE1>>, I<C<LINE2>> etc.
972 Two hashes in the beginning and a name refer to the line style from
973 the styling profile, e.g. C<##BpsIn>.
975 =item * C<line-color-X>
977 Line color. Must have the hash symbol in the beginning, like I<C<#0000FF>>.
978 Two hashes in the beginning and a name refer to the color from
979 the styling profile, e.g. C<##BpsIn>.
981 =item * C<line-order-X>
983 Numerical order of line drawing. The lines are drawn in accending order.
984 If omitted, the XML compiler issues warning, and Renderer conciders
987 =item * C<line-stack-X>
989 Optional. When set to C<yes>, the line is stacked on top of a previous line.
990 Both areas and lines are stackable.
992 =item * C<line-alpha-X>
994 Optional. If specified, must be two hexademical, uppercase digits. This
995 parameter defines the line (or area) transparency. Value C<FF> is
996 equivalent to solid colour. Value C<7F> gives 50% transparency which should
997 be suitable for most applications.
999 =item * C<ignore-views-X>
1001 Optional comma-separated list of view names. The graph for this DS name
1002 will not be drawn in the views specified. The validator does not check
1003 it, so it's up to you to guarantee that at least one DS is always displayed
1006 =item * C<disable-gprint-X>
1008 Optional. When set to C<yes>, this datasource is not included in GPRINT output.
1012 =head2 View definitions
1014 In our context, I<view> means any kind of object representation.
1015 The same subtree or view can be displayed in different ways and in
1016 different formats: HTML, graph image, plain text, etc.
1018 I<Renderer> module handles these view definitions. For any subtree
1019 or leaf, it renders the specified view, and keeps the cache of rendered
1022 Each subtree or leaf must have a default view. This is controlled by
1023 two parameters that may be defined in the root subtree:
1024 C<default-subtree-view> and C<default-leaf-view>.
1026 The set of views is flat, though they can inherit the parameters
1027 one from another. Each view is referenced by its name, and is
1028 defined by the set of parameters. Same way as with datasources,
1029 certain parameter values imply the neccessaty to define certain other
1033 <view name="default-rrgraph">
1034 <param name="view-type" value="rrgraph" />
1035 <param name="expires" value="300" />
1036 <param name="width" value="500" />
1037 <param name="height" value="250" />
1038 <param name="width-hint" value="580" />
1039 <param name="line-style" value="##SingleGraph" />
1040 <param name="line-color" value="##SingleGraph" />
1042 <!-- Daily graph, inherits parameters from the above -->
1043 <view name="last24h">
1044 <param name="start" value="-24h" />
1047 <!-- Weekly graph -->
1048 <view name="lastweek">
1049 <param name="start" value="-7d" />
1054 Currently the view is defined by the configuration only.
1055 Probably, in the future additional parameters will be supplied dynamically.
1058 =head3 View parameters
1060 For every view, the mandatory parameters are:
1064 =item * C<view-type>
1066 Determines the processing procedure which interprets the other parameters.
1070 Gives the expiration time in seconds for the I<Renderer> cache.
1074 The following values of C<view-type> are recognized:
1080 Defines the HTML representation of subtree or a leaf.
1081 One additional parameter is required: C<html-template> must contain a file
1082 name of the HTML template. Those templates are copied from F<templates>
1083 subdirectory of the installation package. We use Template-Toolkit
1084 E<lt>http://www.template-toolkit.orgE<gt> for HTML processing.
1085 The template file name is defined with the parameter C<html-template>.
1088 variables and functions are defined when the template is processed:
1094 Returns the current node token.
1098 Returns the name of the current view.
1100 =item * C<path(token)>
1102 Returns the full path name of the given node token.
1104 =item * C<pathToken(path)>
1106 Returns the token for the specified path.
1108 =item * C<nodeExists(path)>
1110 Returns true if the specified path points to a node.
1112 =item * C<children(path)>
1114 Returns the list of children for the given path.
1116 =item * C<isLeaf(token)>
1118 Returns true if the token is pointing to a leaf node.
1120 =item * C<sortTokens(array)>
1122 Returns the array of tokens, sorted according to C<precedence> parameter.
1124 =item * C<nodeName(token)>
1126 Returns the node name part of the node path.
1128 =item * C<parent(token)>
1130 Returns the parent's token for the specified node.
1132 =item * C<nodeParam(token, param_name)>
1134 Returns the value of the parameter for the given node.
1136 =item * C<param(entity_name, param_name)>
1138 Returns the value of the parameter for the given view, monitor, or action.
1140 =item * C<url(token, [view])>
1142 Returns the URL which displays the given node using the given view.
1143 If the view is omitted, use the default view.
1145 =item * C<persistentUrl(token, [view])>
1147 Same as above, but the URL is built from persistent information: nodeid
1148 (if available) or full path in the tree.
1150 =item * C<splitUrls(token, [view])>
1152 Returns a piece of HTML code representing the path with clickable
1153 node names, each referencing the corresponding view.
1155 =item * C<rrprint(token, view)>
1157 The specified view must be of type C<rrprint>. Returned is the text
1158 output produced by this view.
1160 =item * C<scale(text)>
1162 Interprets the given text as a floating-point number and returns
1163 its representation in the "metric" scale: 1000 is translated into "k",
1164 million into "M" etc. It may be used together with C<rrprint>
1165 for better formatting.
1167 =item * C<tsetMembers(tset)>
1169 Returns the array of the tokenset member tokens.
1173 Returns the array of the tokenset names.
1175 =item * C<stylesheet>
1177 Returns the relative URI to the default CSS stylesheet,
1178 as defined in C<$Torrus::Renderer::stylesheet>.
1182 Returns current Torrus package version.
1188 Generates the RRD Graph representation of the given I<leaf> (remember,
1189 subtrees are only logical grouping of the real data).
1191 The following parameters are mandatory for this kind of view:
1195 =item * C<width>, C<height>, C<start>
1197 Correspond to same parameters in RRD Graph command.
1198 C<end> can also be given, it defaults to I<C<now>>.
1200 =item * C<line-style>
1202 Line specification in RRD graph. May be I<C<LINE1>>, I<C<LINE2>> etc.
1203 Two hashes in the beginning and a name refer to the line style from
1204 the styling profile, e.g. C<##SingleGraph>.
1206 =item * C<line-color>
1208 Line color. Must have the hash symbol in the beginning, like I<C<#0000FF>>.
1209 Two hashes in the beginning and a name refer to the color from
1210 the styling profile, e.g. C<##SingleGraph>.
1212 =item * C<rrd-hwpredict>
1214 If equals to C<disabled>, HWPREDICT display is disabled for this view.
1215 Note that if the datasource has C<rrd-hwpredict> parameter set to C<enabled>,
1216 this emplies that the view would contain Holt-Winters boundaries and failures
1219 =item * C<hw-bndr-style>
1221 Optional parameter, defaults to C<LINE1>. Specifies the line style for
1222 Holt-Winters boundaries.
1224 =item * C<hw-bndr-color>
1226 Optional parameter, defaults to C<#FF0000>. Specifies the color for
1227 Holt-Winters boundaries.
1229 =item * C<hw-fail-color>
1231 Optional parameter, defaults to C<#FFFFA0>. Specifies the color for
1232 Holt-Winters failure ticks.
1234 =item * C<hrules>, C<hrule-value-I<name>>, C<hrule-color-I<name>>
1236 Optional parameter C<hrules> contains a comma-separated list of
1237 horizontal rule names. For each name, mandatory parameter
1238 C<hrule-value-I<name>> defines a name of the leaf parameter that will be
1239 used as the horizontal rule value. The rule is not drawn if such parameter
1240 is not defined for the leaf. Mandatory parameter C<hrule-color-I<name>>
1241 defines the color for the rule, of the form C<#DDDDDD>, where C<D> corresponds
1242 to a hexademical digit. Two hashes in the beginning and a name refer to
1243 the color from the styling profile, e.g. C<##HruleMin>.
1244 Optional parameter C<hrule-legend-I<name>>
1245 defines the legend text to be displayed on the graph. The following horizontal
1246 rules are defined in F<defaults.xml> for all rrgraph views:
1248 <param name="hrules" value="min,norm,max"/>
1249 <param name="hrule-color-min" value="##HruleMin"/>
1250 <param name="hrule-value-min" value="lower-limit"/>
1251 <param name="hrule-color-norm" value="##HruleNormal"/>
1252 <param name="hrule-value-norm" value="normal-level"/>
1253 <param name="hrule-color-max" value="##HruleMax"/>
1254 <param name="hrule-value-max" value="upper-limit"/>
1257 =item * C<decorations>
1259 Optional. Comma-separated list of decoration names. Decoration is an RRD
1260 pseudo-line that does not depend on any datasource. For each decoration
1261 name, the following parameters must be supplied: C<dec-order-E<lt>nameE<gt>>
1262 determines the order of drawing. Negative order numbers correspond to
1263 the lines or areas behind the data line. C<dec-expr-E<lt>nameE<gt>>
1264 gives the RPN expression that defines the line or area.
1265 C<dec-style-E<lt>nameE<gt>> and C<dec-color-E<lt>nameE<gt>> define
1266 the style (AREA or LINE1..3) and the color of the drawing.
1267 Node parameter C<graph-ignore-decorations> disables the decorations.
1269 =item * C<gprint-values>, C<gprint-header>, C<gprint-format-*>
1271 Optional. These parameters define the printing of values together with legends
1272 below the graph. C<gprint-values> is a comma-separated list of format names,
1273 and for each format name, there should be a corresponding C<gprint-format-*>
1274 parameter. C<gprint-header> defines a string that will be printed on top of
1275 all orther lines. Example:
1277 <param name="gprint-values" value="current,average,max,min"/>
1278 <param name="gprint-header"
1279 value="Current Average Maximum Minimum"/>
1280 <param name="gprint-format-current" value="LAST:%8.2lf%s"/>
1281 <param name="gprint-format-average" value="AVERAGE:%8.2lf%s"/>
1282 <param name="gprint-format-max" value="MAX:%8.2lf%s"/>
1283 <param name="gprint-format-min" value="MIN:%8.2lf%s"/>
1285 =item * C<description>
1287 Optional. Defines the text description of the graph. This description is
1288 usually placed as ALT HTML attribute in the generated HTML pages.
1290 =item * C<rrd-params>
1292 Optional. Supplies additional RRDtool graph comand-line options, as one
1293 string separated by spaces.
1299 This view produces the text output from PRINT statement in
1300 RRD graph command. The required parameters are C<start> and C<print-cf>.
1301 The first one defines the starting time. C<end> may be also optionally
1304 C<print-cf> specifies oe or more consolidation functions, separated by comma.
1305 The result of the rendering is the text line with the output values
1306 separated by colon (:).
1310 =item * C<disable-legend>, C<disable-title>, C<disable-vertical-label>
1312 When set to C<yes>, the corresponding elements of the graph are not displayed.
1316 =head3 Styling Profiles
1318 Styling profiles allow symbolic names to be used for line type
1321 Two hashes in the beginning and a name refer to the line style from
1322 the styling profile, e.g. C<##BpsIn>, C<##green>, C<##one>, C<##two>.
1324 <leaf name="InOutBytes">
1325 <param name="comment" value="Input and Output bits per second graphs"/>
1326 <param name="ds-type" value="rrd-multigraph"/>
1327 <param name="ds-names" value="in,out"/>
1329 <param name="ds-expr-in" value="{ifInOctets}"/>
1330 <param name="graph-legend-in" value="Bytes per second in"/>
1331 <param name="line-style-in" value="##BpsIn"/>
1332 <param name="line-color-in" value="##BpsIn"/>
1333 <param name="line-order-in" value="1"/>
1335 <param name="ds-expr-out" value="{ifOutOctets}"/>
1336 <param name="graph-legend-out" value="Bytes per second out"/>
1337 <param name="line-style-out" value="##BpsOut"/>
1338 <param name="line-color-out" value="##BpsOut"/>
1339 <param name="line-order-out" value="2"/>
1342 When processed the example above effectivly becomes:
1344 <leaf name="InOutBytes">
1345 <param name="comment" value="Input and Output bits per second graphs"/>
1346 <param name="ds-type" value="rrd-multigraph"/>
1347 <param name="ds-names" value="in,out"/>
1349 <param name="ds-expr-in" value="{ifInOctets}"/>
1350 <param name="graph-legend-in" value="Bytes per second in"/>
1351 <param name="line-style-in" value="AREA"/>
1352 <param name="line-color-in" value="#00FF00"/>
1353 <param name="line-order-in" value="1"/>
1355 <param name="ds-expr-out" value="{ifOutOctets}"/>
1356 <param name="graph-legend-out" value="Bytes per second out"/>
1357 <param name="line-style-out" value="LINE2"/>
1358 <param name="line-color-out" value="#0000FF"/>
1359 <param name="line-order-out" value="2"/>
1362 Schema definitions can be modified in two ways
1363 (see the I<Torrus Styling Profile Guide> manual for available styles
1364 and override details)
1368 =item * Create an overlay schema:
1370 Specify the overlay schema in torrus-siteconfig.pl using the
1371 $Torrus::Renderer::stylingProfileOverlay variable.
1373 =item * Create a replacement schema:
1375 Specify the replacement schema in torrus-siteconfig using the
1376 $Torrus::Renderer::stylingProfile variable.
1381 =head2 Token sets definitions
1383 I<Token> is a symbolic identifier for each subtree or a leaf.
1385 A I<tokenset> is a named list of tokens. Its contents can be
1386 rendered, and its members can be added or removed at any time.
1388 Each tokenset can have a number of parameters defined. It also
1389 inherits the parameter defined in the top C<E<lt>token-setsE<gt>>
1394 <param name="default-tset-view" value="default-tset-html" />
1395 <param name="default-tsetlist-view" value="tset-list-html" />
1397 <token-set name="jumps">
1398 <param name="comment" value="Traffic rate jumps" />
1401 <token-set name="hw-failures">
1402 <param name="comment" value="Holt-Winters prediction failures" />
1407 Parameter C<default-tsetlist-view> is mandatory for tokenset list.
1408 It defines the default view when displaying the list of tokensets.
1410 The following parameters are mandatory for tokensets:
1414 =item * C<default-tset-view>
1416 Determines the view for displaying the tokenset contents.
1420 The text that describes this tokenset.
1424 =head2 Monitor definitions
1426 I<Monitor> is a named set of parameters that defines the behaviour
1427 of monitor module. Each leaf can be given a number of monitors
1428 via C<monitor> parameter.
1430 Upon monitor module run, an I<action> is launched if the alarm conditions
1431 of a given monitor are satisfied.
1434 <!-- First define the actions -->
1436 <!-- This action will put the graphs of alarmed datasources in
1437 a single alarm report page -->
1438 <action name="graph-hw-failures">
1439 <param name="action-type" value="tset" />
1440 <param name="set-name" value="hw-failures" />
1443 <action name="graph-jumps">
1444 <param name="action-type" value="tset" />
1445 <param name="set-name" value="jumps" />
1448 <monitor name="hw-failures">
1449 <param name="monitor-type" value="failures" />
1450 <param name="action" value="graph-hw-failures" />
1451 <param name="expires" value="3600" />
1454 <!-- alarm if 5 minutes away it was 10 times lower -->
1455 <monitor name="high-jumps">
1456 <param name="monitor-type" value="expression" />
1457 <param name="rpn-expr" value="{(-300)},10,*,GT,{},{(-300)},10,/,LT,OR" />
1458 <param name="action" value="graph-jumps" />
1459 <param name="expires" value="3600" />
1460 <param name="comment"
1461 value="Value jumped more than 10-fold in 5 minutes" />
1464 <monitor name="hundred-megs">
1465 <param name="monitor-type" value="expression" />
1466 <param name="rpn-expr" value="100,1024,1024,*,*,GT" />
1467 <param name="action" value="graph-jumps" />
1468 <param name="expires" value="3600" />
1469 <param name="comment"
1470 value="Traffic is higher than 10 mbps" />
1476 Should the alarm condition occur, a series of events is happening
1477 in sequentional order:
1483 This event type occurs the first time the alarm condition is met.
1487 This event type means that the alarm condition still persists
1488 after the previous run of Monitor.
1492 Event of this type happens when the alarm condition stops.
1496 Once the alarm is cleared, this event happens after the expiration
1497 time of the monitor.
1501 =head3 Monitor parameters
1505 =item * C<monitor-type>
1507 Mandatory parameter. Specifies the monitor type. The following monitor
1508 types are recognized:
1514 Triggers the action when Holt-Winters FAILURES function gives value of 1.
1515 This requires RRDtool verion 1.1.x and aberrant behaviour parameters
1516 defined for te given RRD file.
1518 =item * C<expression>
1520 Triggers the action when given RPN expression returns nonzero.
1521 See I<RPN expressions in Torrus> manual for more details.
1522 This monitor type implies that the RPN expression is specified in
1523 C<rpn-expr> parameter. The current leaf value is prepended to the given RPN.
1529 Mandatory for monitor type C<expression>. Defines the RPN expression to
1530 evaluate. The current leaf value is prepended to the given RPN.
1531 The expresion may reference leaf-dependent variables: the
1532 constructs of the form C<#varname> are replaced with the variable
1533 value specified in the leaf's C<monitor-vars> parameter.
1537 Mandatory parameter, comma-separated list of action names (spaces
1538 are allowed). Each action is triggered when the alarm condition is met.
1542 Mandatory parameter, the number of seconds of expiration period.
1543 After the alarm condition becomes false, this parameter determines
1544 the time of memorizing the event in monitor status reports.
1548 Optional but recommended parameter, specifies the string identifying
1549 the event that this monitor watches.
1553 Optional severity level. Used for the action type C<exec>.
1555 =item * C<display-rpn-expr>
1557 Optional RPN expression for transforming the datasource value.
1558 If defined, it will be applied to the value before setting
1559 C<TORRUS_VALUE> and C<TORRUS_DISPLAY_VALUE> environment variables.
1561 =item * C<display-format>
1563 Optional I<sprintf> format for displaying the value in
1564 C<TORRUS_DISPLAY_VALUE> environment variable. Default is C<%.2f>.
1569 =head3 Action parameters
1573 =item * C<action-type>
1575 Mandatory parameter, defines the type of action. Recognized
1582 When this type of action is triggered, the leaf is added to the specified
1583 tokenset (see I<Token sets definitions> section in this manual).
1584 The leaf persists in the tokenset until the event of type C<forget>.
1585 This action type implies the parameter C<tset-name>.
1589 This action type defines an external program to launch. Two other parameters
1590 determinate its behaviour: mandatory C<command> and optional C<launch-when>.
1594 =item * C<tset-name>
1596 Mandatory for action type C<tset>. Defines the tokenset name
1597 where the leaf is added when the monitor condition is met.
1601 Mandatory for action type C<exec>. Defines the external program to launch.
1602 The following strings are substituted in the parameter value:
1606 =item * C<E<amp>gt;>
1608 Relaced with C<E<gt>>.
1610 =item * C<E<amp>lt;>
1612 Relaced with C<E<lt>>.
1616 The following environment variables are passed to the child process:
1620 =item * C<$TORRUS_HOME>
1622 C<prefix> where Torrus was installed.
1624 =item * C<$TORRUS_BIN>
1626 Directory containing Torrus executables.
1628 =item * C<$TORRUS_UPTIME>
1630 Number of seconds since Monitor has started.
1632 =item * C<$TORRUS_TREE>, C<$TORRUS_TOKEN>, C<$TORRUS_NODEPATH>
1634 Tree name, token and pathname of the leaf causing the alarm.
1636 =item * C<$TORRUS_NCOMMENT>, C<$TORRUS_NPCOMMENT>
1638 C<comment> parameter of the node and its parent.
1639 Empty if the parameter is not defined for the given leaf.
1641 =item * C<$TORRUS_EVENT>
1645 =item * C<$TORRUS_MONITOR>
1649 =item * C<$TORRUS_MCOMMENT>
1651 Monitor's C<comment> parameter value.
1653 =item * C<$TORRUS_TSTAMP>
1655 Timestamp (in seconds since Epoch) of the event.
1657 =item * C<$TORRUS_VALUE>
1659 For expression monitor type, this returns the last read value of the
1660 datasource, possibly transformed by C<display-rpn-expr> expression.
1662 =item * C<$TORRUS_DISPLAY_VALUE>
1664 For expression monitor type, it contains a human-readable form
1665 of the value, possibly transformed by C<display-rpn-expr> expression.
1667 =item * C<$TORRUS_SEVERITY>
1669 If the C<severity> parameter is defined in the monitor, its value
1670 is passed with this variable.
1674 =item * C<launch-when>
1676 Optional for action type C<exec>. The comma-separated list of event
1677 types when the given action should be launched. If not defined,
1678 the event type C<set> is used by default.
1680 =item * C<setenv-params>
1682 Optional for action type C<exec>. The comma-separated list of leaf parameters
1683 which would be passed as environment variables to the child process.
1684 The environment variables are of the form C<$TORRUS_P_paramname>. Hyphens ('-')
1685 are replaced with underscores ('_') in the parameter names.
1687 =item * C<setenv-dataexpr>
1689 Optional for action type C<exec>. Comma-separated list of C<ENV=paramname>
1690 pairs. C<ENV> defines the environment variable name: it is prefixed with
1691 C<Torrus_>. C<paramname> defines the action parameter name. This parameter
1692 is interpreted as RPN expression applied to the current leaf being monitored.
1693 The result of this RPN expression is passed to the action script
1694 in the environment variable.
1698 <action name="report-temperature">
1699 <param name="action-type" value="exec" />
1701 <!-- This is our proprietary reporting script -->
1702 <param name="command">
1703 /usr/local/bin/report_temperature
1705 <param name="launch-when" value="set" />
1707 <!-- We want to tell the action script the actual values
1708 of the "temperature" and "humidity" leaves in the current
1710 <param name="setenv-dataexpr" value="TEMP=expr-temp, HMD=expr-hmd" />
1711 <param name="expr-temp" value="{temperature(LAST)}" />
1712 <param name="expr-hmd" value="{humidity(LAST)}" />
1714 <!-- We also want to tell the action script the parameter "monitor-vars"
1715 which was configured for the current leaf. -->
1716 <param name="setenv-params" value="monitor-vars" />
1725 Copyright (c) 2002-2005 Stanislav Sinyagin E<lt>ssinyagin@yahoo.comE<gt>