From: <ga...@fr...> - 2006-10-09 13:25:49
|
Hello all, First of all, thanks to all contributors to this project, I discovered it today, downloaded the latest version (0.2.2) and started some templates for our SonicWALL appliances, this is really nice piece software and very well documented. After a few hours of work, I already got very convincing results. This looks really promising. While I was creating a template, I discovered that it was not possible to apply a REGSUB on a leaf. In other words, if you have something like this in "oids" : -<start file>----------------------------- sysDesc : .1.3.6.1.2.1.1.1.0 : leaf -<end file>------------------------------- And the following in "transforms" : -<start file>----------------------------- ModelTxt : REGSUB : {sysDesc} /SonicWALL (.*) \(SonicOS.*\)/$1/ SonicOSTxt : REGSUB : {sysDesc} /SonicWALL .* \(SonicOS (.*)\)/$1/ -<end file>------------------------------- It does not work as expected. (I wanted to split the "description" into two separated strings) I fixed the problem doing the following changes in dm_tests.pm : -<start file>----------------------------- 1945,1947c1945 < my $exp_val =3D $oids->{$primary_oid}{'val'}; < my $eval_cmd =3D "\$exp_val =3D~ s$expression"; < my $result =3D eval($eval_cmd); --- > my $result =3D eval($expression); 1949c1947 < do_log("Failed eval for REGSUB transform on $oid on $device ($@)", 0); --- > do_log("Failed eval for MATH transform on $oid on $device ($@)"= , 0); 1955c1953 < $oids->{$oid}{'val'} =3D $exp_val; --- > $oids->{$oid}{'val'} =3D $result; -<end file>------------------------------- I don't know if this was the best way to do. Maybe this is already fixed in a newer non-released version ? In any case, comments are welcome. Have a good day. --=20 Ga=EBtan Frenoy (gaetan [=E0] frenoy.net) - GnuPG key 0xDCD1A235 |