From: Buchan M. <bg...@st...> - 2009-10-23 11:07:17
|
On Friday, 23 October 2009 11:06:28 Peter Welter wrote: > Hi Geoff & Buchan, > > A break through this morning, finally. Thanks to your encouraging mail, I > discovered that running devmon interactively and in verbose mode is very > infomative if things do no work out right. > > I do use the TABLE:-directive but it never showed up in Xymon. The table > output however, was made the way I wanted it. It showed however binary > values. Yoohoo! > > Alarming on (, 9�,��,, |,�, ) > Alarming on (|,x,l,�, , ) > Alarming on (,,,,@&,) > Alarming on () > <table border=1 cellpadding=5> > <tr><td>connUnitPortStatCountError</td><td>InvalidCRC</td></tr> > <tr><td></td><td></td></tr> > <tr><td> 9�</td><td></td></tr> > <tr><td>��</td><td></td></tr> > <tr><td></td><td></td></tr> > <tr><td> |</td><td></td></tr> > <tr><td>�</td><td></td></tr> > <tr><td> </td><td></td></tr> > <tr><td>|</td><td></td></tr> > <tr><td>x</td><td></td></tr> > <tr><td>l</td><td></td></tr> > <tr><td>�</td><td></td></tr> > <tr><td> </td><td></td></tr> > <tr><td> </td><td></td></tr> > <tr><td></td><td></td></tr> > <tr><td></td><td></td></tr> > <tr><td></td><td></td></tr> > <tr><td></td><td></td></tr> > <tr><td>@&</td><td> </td></tr> > <tr><td></td><td></td></tr> > <tr><td></td><td></td></tr> > </table> > > > Devmon version 0.3.1-beta1 running on xxxx > > So since the output is hexadecimal (I think that is what snmpwalk tells me, > below), I could simply convert this to integers using the CONVERT-transform > option. Now the table can be seen in Xymon, but unfortunately the output is > not correct. > > So I must be making another mistake here :-( > > the oids-file: > > connUnitPortStatCountInvalidCRC : .1.3.6.1.3.94.4.5.1.40 : branch > connUnitPortStatCountError : .1.3.6.1.3.94.4.5.1.3 : branch > > the transforms-file: > > IntconnUnitPortStatCountInvalidCRC : CONVERT: > {connUnitPortStatCountInvalidCRC} hex > IntconnUnitPortStatCountError : CONVERT: {connUnitPortStatCountError} > hex > > the message-file: > > TABLE: > connUnitPortStatCountError|InvalidCRC > {IntconnUnitPortStatCountError}|{IntconnUnitPortStatCountInvalidCRC} > > xymon$ ~/server/ext/devmon/devmon-0.3.1-beta1/templates/mds9000/if_err> > snmpwalk -v2c -c Communitystring fiberswitch-address > .1.3.6.1.3.94.4.5.1.40 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.1 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.2 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.3 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.4 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.5 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.6 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.7 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.8 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.9 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.10 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.11 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.12 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.13 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.14 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.15 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.16 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.17 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.18 = Hex-STRING: 00 00 00 00 00 00 00 01 <=== One CRC error! > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.19 = Hex-STRING: 00 00 00 00 00 00 00 00 > SNMPv2-SMI::experimental.94.4.5.1.40.16.0.0.13.236.25.211.23.0.0.0.0.0.0.0. >0.20 = Hex-STRING: 00 00 00 00 00 00 00 00 > > > Do you have any hints/suggestions? I am not sure if there is a more efficient way to do this, but I dealt with Hex- String values in a test I haven't yet made available (as it will probably cause the all-clear-tests issue on version of devmon without another local change I am testing on many routers). In the example here, I am converting the cipsStaticCryptomapPeerB OID, which looks like this: CISCO-SMI::ciscoExperiment.62.1.2.3.3.1.4.5.99.105.115.99.111.10 = Hex-STRING: 41 3D 88 04 to a printable string in the cipsStaticCryptomapPeer OID: $ cat /usr/share/devmon/templates/cisco-2811/vpn/oids cipsStaticCryptomapType : 1.3.6.1.4.1.9.10.62.1.2.3.3.1.2 : branch cipsStaticCryptomapDescr : 1.3.6.1.4.1.9.10.62.1.2.3.3.1.3 : branch cipsStaticCryptomapPeerB : 1.3.6.1.4.1.9.10.62.1.2.3.3.1.4 : branch cipsStaticCryptomapNumPeers : 1.3.6.1.4.1.9.10.62.1.2.3.3.1.5 : branch $ cat /usr/share/devmon/templates/cisco-2811/vpn/transforms cipsStaticCryptomapPeerp1B : SUBSTR :{cipsStaticCryptomapPeerB} 0 1 cipsStaticCryptomapPeerp2B : SUBSTR :{cipsStaticCryptomapPeerB} 1 1 cipsStaticCryptomapPeerp3B : SUBSTR :{cipsStaticCryptomapPeerB} 2 1 cipsStaticCryptomapPeerp4B : SUBSTR :{cipsStaticCryptomapPeerB} 3 1 cipsStaticCryptomapPeerp1H : UNPACK : {cipsStaticCryptomapPeerp1B} H2 cipsStaticCryptomapPeerp2H : UNPACK : {cipsStaticCryptomapPeerp2B} H2 cipsStaticCryptomapPeerp3H : UNPACK : {cipsStaticCryptomapPeerp3B} H2 cipsStaticCryptomapPeerp4H : UNPACK : {cipsStaticCryptomapPeerp4B} H2 cipsStaticCryptomapPeerp1 : CONVERT : {cipsStaticCryptomapPeerp1H} hex cipsStaticCryptomapPeerp2 : CONVERT : {cipsStaticCryptomapPeerp2H} hex cipsStaticCryptomapPeerp3 : CONVERT : {cipsStaticCryptomapPeerp3H} hex cipsStaticCryptomapPeerp4 : CONVERT : {cipsStaticCryptomapPeerp4H} hex cipsStaticCryptomapPeer : REGSUB : {cipsStaticCryptomapPeerB} /.*/{cipsStaticCryptomapPeerp1}.{cipsStaticCryptomapPeerp2}. {cipsStaticCryptomapPeerp3}.{cipsStaticCryptomapPeerp4}/ If you need all 8 hex pairs, you could need 8 SUBSTR, 8 UNPACK, and 8 CONVERT transforms. If you only need the last value, you could get away with just one of each. I plan on adding some better operators to automatically convert from common SNMP types (or, possibly some automatic conversion of types). Regards, Buchan |