From: G. F. <ga...@fr...> - 2008-06-30 08:24:01
|
Hello, Sorry for the delay. Definitely not enough hours in one day. Le Fri, 6 Jun 2008 17:32:41 +0200, Buchan Milne écrivait: > > 2) UNPACK did not work > > > > In file modules/dm_tests.pm, function trans_unpack, line 782, changed : > > > > my @vars = unpack $type, $packed; > > > > to > > > > my @vars = unpack "$type*", $packed; > > > > (and the same at line 795) > > Hmm, it is working here, it is used in the compaq-server/log/transforms > template file, and I have a number of servers using this template, and the > values work correctly. Can you provide more detail on when/where/how it isn't > working? I am building physical address (MAC) the following way. Don't ask me why I did like this, I don't remember. Full template is attached to this email (see sonic-tz170.tar.bz2). (from transforms) # Build nice Physical address PhysAddrTxtFull : UNPACK : {ifPhysAddr} H PhysAddrTxt1 : SUBSTR : {PhysAddrTxtFull} 0 2 PhysAddrTxt2 : SUBSTR : {PhysAddrTxtFull} 2 2 PhysAddrTxt3 : SUBSTR : {PhysAddrTxtFull} 4 2 PhysAddrTxt4 : SUBSTR : {PhysAddrTxtFull} 6 2 PhysAddrTxt5 : SUBSTR : {PhysAddrTxtFull} 8 2 PhysAddrTxt6 : SUBSTR : {PhysAddrTxtFull} 10 2 (from oids) ifPhysAddr : .1.3.6.1.2.1.2.2.1.6 : branch The output from the device looks like : IF-MIB::ifPhysAddress.1 = STRING: 0:6:b1:1b:12:34 IF-MIB::ifPhysAddress.2 = STRING: IF-MIB::ifPhysAddress.3 = STRING: 0:6:b1:1b:12:35 IF-MIB::ifPhysAddress.4 = STRING: 0:6:b1:1b:12:36 > > 3) SUBSTR did not work > > ... in specific cases. > > (...) > > The fix looks fine. Could you send a diff instead? Sure. See "dm_tests.pm.substr.diff" file attached. Again, thanks for this great piece of software ! Have a great day. -- Gaëtan Frenoy <ga...@fr...> |