|
NAMEttproclist - Process a template with a nodelistSYNOPSIStorrus ttproclist --tmpl=TFILE --out=OFILE --nodes=NFILE [options...]DESCRIPTIONThis 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:
OPTIONS
EXAMPLESThe 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. NOTESSee more documentation at Torrus home page: http://torrus.orgSEE ALSOTemplate-Toolkit documentation: http://template-toolkit.org/torrus(1), torrus_devdiscover(1) AUTHORStanislav Sinyagin <ssinyagin@k-open.com>
Visit the GSP FreeBSD Man Page Interface. |