EastTarget is a Torrus plugin designed for those users who need to add some specific SNMP OIDs to Torrus collector, without having to edit the complex XML files. EasyTarget is a quick way to add a few new objects without too much efforts.
Follow the Torrus installation guide for the main software installation.
Install two Perl modules from CPAN:
perl -MCPAN -e 'install Config::Tiny' perl -MCPAN -e 'install Config::Any'
Unpack the plugin distribution package in some directory:
gzip -dc tp-easytarget-1.X.tar.gz | tar xvf -
Then run the Torrus plugin installation utility, pointing to the unpacked plugin directory:
torrus install_plugin tp-easytarget-1.X
EasyTarget accepts input files in Windows-style INI format. It is important that the file extension is exactly ``.ini''. By default, the files are searched in the current directpoy and then in /easytarget.
The input file consists of sections, each representing a leaf or a subtree of Torrus datasource tree. You define the default parameters at the top of the file in global section, and then create a section for each tree element that you want to define. Here is a minimalistic example:
OUTXML = mydevices.xml
[/EasyTarget/dev1] snmp-host = 10.0.0.1 snmp-community = public snmp-object = 184.108.40.206.4.1.56220.127.116.11.18.104.22.168.1.1
[/EasyTarget/dev2] snmp-host = 10.0.0.2 snmp-community = public snmp-object = 22.214.171.124.4.1.56126.96.36.199.188.8.131.52.1.1
Here's a more complex example:
OUTXML = mydevices.xml
[/EasyTarget/Myrouter/] snmp-host = 10.0.0.1 snmp-community = public
[/EasyTarget/Myrouter/data1] snmp-object = 184.108.40.206.4.1.56220.127.116.11.18.104.22.168.1.1 [/EasyTarget/Myrouter/data2] snmp-object = 22.214.171.124.4.1.56126.96.36.199.188.8.131.52.2.1
Next step is to feed the input file to EasyTarget:
torrus et --in=mydevices.ini --verbose
Then you need to add the generated XML file to the tree by editing the torrus-siteconfig.pl file, and compile the resulting tree:
torrus compile --tree=main --verbose
Now you can start the collector and Apache server if they aren't yet running. If they were already running, you don't need to restart them.
The input file for the EasyTarget plugin is a two-level configuration file.
Currently Windows-style INI format is supported. Other formats implemented in
Config::Any Perl module should also work, but they were not tested.
The input file consists of two parts: the global parameters and per-section parameters. The section name defines the Torrus datasource subtree or leaf: if the name ends with the slash (/), it denotes a subtree and defines parameters for child leaves. Otherwise the section defines a leaf. The section name should always start with slash.
There are two types of parameters: the ones consisting of capitals ([A-Z]) are the parameters for the EasyTarget engine, and all others are the parameters passed to the generated Torrus config file.
There is no parameter inheritance. You can only define either a parameter
on the global level, or in each of the sections. That means, for example,
OUTXML is missing at the global level, it should be present
in each section, regardless of the generated tree hierarchy.
If a parameter exists both at the global level and in a section,
the value in the section overrides the global one.
EasyTarget understands the following parameters:
<inclde>statements for every
OUTXMLin every section. This is useful if the EasyTarget file is long enough (e.g. automatically generated by an external program) and contains multiple output file statements.
The following parameters are set implicitly to their default values:
defrrddir=DIRparameter of the Torrus configure script at its installation time. This is the directory where the collector will generate the RRD files.
rrd-ds: the same as the name of the leaf
By default, EasyTarget applies the template
snmp-defs.xml to each leaf.
The minimum set of parameters that should be defined in EasyTarget
input files are:
Copyright (c) 2007 Stanislav Sinyagin <firstname.lastname@example.org>