rendered paste body#!/usr/local/bin/perl -w
use strict;
use warnings;
my $tmpl = <<EOF
<item type="4" key="--DESCR--" value_type="--TYPE--">
<description>--DESCR--</description>
<delay>60</delay>
<history>7</history>
<trends>365</trends>
<status>1</status>
<snmp_community>public</snmp_community>
<snmp_oid>--OID--</snmp_oid>
<snmp_port>161</snmp_port>
</item>
EOF
while(<>) {
die "Bad strings '$_'\n"
unless /^.*([^.]\.\d)\t([\d.]+)\t([^\t]+)\t?([\d]*);
my %hash = ('descr' => $1, 'oid' => $2, 'type' => $4);
$s =~ s/--DESCR--/$hash{$1}/g;
$s =~ s/--OID--/$hash{$2}/g;
$s =~ s/--TYPE--/$hash{$3}/g;
print $s, "\n";
}