head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2000.06.13.22.30.44; author horton; state Exp; branches; next ; desc @ mibs named as their internal DEFINITION name @ 1.1 log @Initial revision @ text @
Object_Id : 273 Title : mibs named as their internal DEFINITION name Format : Source Address : Keywords : Abstract : Some SNMP tools assume that the names of MIB is the same as the filename. This is mainly for IMPORTs. Notably Lumos and libsmi. Attached is a unix shell script to create a subdirectory of links to the conventionally named files, and a tar file with the named according to their MIB name. This is primitive in that it assumes that the DEFINITIONS keyword is on the same line as the MIB name. (Most of the carrieraccess MIBs aren't). The tool has a side effect in that it identifies MIBs with conflicting names, typically caused by having obsoleted versions of files. (Not always though, e.g. DS1-MIB has changed its name!) Example usage: [dhorton@@Breitling fred]$ ls rfc1406-DS1.asn rfc2494-DS0BUNDLE-MIB.asnv2 rfc1407-DS3.asn rfc2495-DS1-MIB.asnv2 rfc2494-DS0-MIB.asnv2 rfc2496-DS3-MIB.asnv2 [dhorton@@Breitling fred]$ link_MIBs.sh ../ RFC1406-MIB RFC1407-MIB DS0-MIB DS0BUNDLE-MIB DS1-MIB DS3-MIB [dhorton@@Breitling fred]$ [dhorton@@Breitling fred]$ ls links DS0-MIB DS1-MIB RFC1406-MIB DS0BUNDLE-MIB DS3-MIB RFC1407-MIB [dhorton@@Breitling fred]$ ls links rfc2494-DS0-MIB.asnv2 links.tar rfc2494-DS0BUNDLE-MIB.asnv2 rfc1406-DS1.asn rfc2495-DS1-MIB.asnv2 rfc1407-DS3.asn rfc2496-DS3-MIB.asnv2 . cat link_MIBs.sh #set -x rm -rf links links.tar* mkdir links cd links for m in ../* do if [ -f $m ] then n=`awk '/DEFINITIONS/ { print $1; exit; }' $m` if [ -n "$n" ] then if ln -s $m $n then : ls -l $n else echo ===== cant ln -s $m $n ls -l $n sleep 10 fi fi fi done tar cohvf ../links.tar . Date_Entry_Last_Modified: $Date$ Entry_Last_Modified_By : $Author$ Asset_Qualification : Other_Opinions : Contact_Person : IP_or_Copyright_Owner : Support_re_Ownership : Date_Item_Created : Thu, 11 May 2000 15:00:49 -0600 Usage_Conditions : Support_re_Usage_Condns : Authors_and_Contributors: David Horton Projects_Used_In : CA953 (Carrier access) Obtained_From : new Derived_From : Related_Items : Code_Type : simple tool Programming_Language : Unix utilities and shell Portations : Linux Dependencies : Source_Location : See above Binaries_Location : Library_Location : Issues_Bug_etc_List_Locn: Additional_Info :@