Man page - torrus_ttproclist(8)
Packages contains this manual
- torrus_schedulerinfo(8)
- torrus_action_notify(7)
- torrus_compilexml(8)
- torrus_clearcache(8)
- torrus_monitor(8)
- torrus_collector(8)
- torrus_buildsearchdb(8)
- torrus_genlist(8)
- torrus_genreport(8)
- torrus_configinfo(8)
- torrus_install_plugin(7)
- torrus_snmpfailures(8)
- torrus_flushmonitors(8)
- torrus_action_snmptrap(7)
- torrus_srvderive(8)
- torrus_cleanup(8)
- torrus(8)
- torrus_action_printemail(7)
- torrus_nodeid(8)
- torrus_action_snmpv1trap(7)
- torrus_acledit(8)
- torrus_ttproclist(8)
- torrus_genddx(8)
- torrus_rrddir2xml(8)
- torrus_launcher(7)
- torrus_devdiscover(8)
- torrus_configsnapshot(8)
apt-get install torrus-common
Manual
TORRUS_TTPROCLIST
NAMESYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
NOTES
SEE ALSO
AUTHOR
NAME
ttproclist - Process a template with a nodelist
SYNOPSIS
torrus ttproclist --tmpl= TFILE --out= OFILE --nodes= NFILE [ options... ]
DESCRIPTION
This command takes a Template-Toolkit template and a list of nodes (usually SNMP devices) as input. The output file is a result of template substitution, according to the specified options. Command-line options --tmpl , --out and --nodes are mandatory.
This utility can be used to generate the discovery instructions XML out of a predefined template and a dynamically generated list of devices. Alternatively, it can produce Torrus XML configuration for a given list of objects, etc.
The following variables are predefined when the template is processed:
|
• |
"nodes" |
Hash array of nodes. Hash keys are the node names. Values are symbolic names. If symbolic names are not defined, values are the same as keys.
|
• |
"param" |
Hash array of command-line parameters given in --param option.
|
• |
"nodesfile", "creator" |
Informative variables. They can be used to produce the creation note in the resulting files. "nodesfile" returns the file name of nodes, and "creator" returns a detailed information how the file was generated, with timestamp and command line options.
OPTIONS
--tmpl = TFILE
The file name of the input template. Relative names are looked in the current directory and in /etc/torrus/templates . The file name may also be an absolute path.
--out = OFILE
Output file name. If no absolute path given, the file is written in the current directory.
--nodes = NFILE
The name of the nodes list. Nodes should be separated by space or tab character or newline. Additional information, referred to as symbolic name, can be supplied after a colon, of the form NODENAME:SYMBOLICNAME.
--param = NAME:VALUE,NAME:VALUE...
List of optional parameters that may be used in the template.
EXAMPLES
The following example gerenates "devdiscover" input file from a template. The template is as follows:
<?xml
version="1.0" encoding="UTF8"?>
<snmp-discovery>
>>> usual DDX parameters here, like SNMP community
and data-dir
<param name="snmp-community"
value="private"/>
<param...
>>> This loop generates per-host entries
[% FOREACH n = nodes.keys.sort %]
<host>
<param name="snmp-host" value="[% n
%]"/>
<param name="symbolic-name" value="[%
nodes.$n %]"/>
<param name="output-file" value="nodes/[%
n %].xml"/>
</host>
[% END %]
>>> Generate the bundle file, so that you need only
one
>>> entry in torrus-site-config.pl
<param name="output-bundle" value="[%
param.BUNDLE %].xml"/>
</snmp-discovery>
The following command would generate MY .ddx from template file MY .ddtmpl as described above. The file MY .nodes is a list of SNMP devices, one per line. Then "devdiscover" is launched with MY .ddx as input. Note also the short form of the command line wrapper.
torrus
ttproclist --tmpl=MY.ddtmpl \
--nodes=MY.nodes \
--out=/usr/local/etc/torrus/discovery/MY.ddx \
--param=BUNDLE:MYNODES
torrus dd --in=MY.ddx --verbose
In addition, you may put some common parameters in Template BLOCK statement in a separate file, and INCLUDE it in your templates. See the Template-Toolkit documentation for more detail.
NOTES
See more documentation at Torrus home page: http://torrus.org
SEE ALSO
Template-Toolkit documentation: http://template-toolkit.org/
torrus (8), torrus_devdiscover (8)
AUTHOR
Stanislav Sinyagin <ssinyagin@k-open.com>