The file system scenario was the closest example I could think of. The device I am creating a MIB file for has ALOT of parameters which is organized in a hierarchy must like a file system. Each node in the path can have a few scalars(parameters), but most of them are at the end of a path (a subsystem).
My application running against a test system created a MIB file with almost 5000 scalars and aprox 500 groups. According to the SMIv2 (RFC 2578) descriptor names must be unique and mnemonic. Using a hash is not exactly very mnemonic. /Sverre ----- Original Message ----- Fra: "Heiko Gerstung" <he...@am-anger-1.de> Til: net-snmp-users@lists.sourceforge.net Sendt: 24. oktober 2012 16:00:25 Emne: Re: A MIB file dilemma On 24.10.2012 14:07, Sverre Moe wrote: > > I have come up with the following hack for names over 64 characters. I'm not > sure if this hack is a very good solution. > > Truncate in the middle with the number of characters over 64 (+2) and replace > it with "-". > > > std::string tmp_string = name; > const int length = tmp_string.length(); > if (length > 64) { > > const int half = length / 2; //We truncate in the middle. > > const int numberOff = (length - 64) + 2; //The number of characters to > truncate. > const std::string dash = "-"; > tmp_string = tmp_string.replace(half, numberOff, dash); > } > > Sverre, the stuff you seem to want to do with a MIB scares the hell out of me ;-) ... Not sure what you want to achieve with that (creating an SNMP file system). However, maybe you should take the MD5 hash of the full path (echo $FILENAME | md5sum) and use it as the name of the object and (for better readability....) add a comment "-- this is file /etc/hosts --" or something similar that helps you to find out which object is which file ... Again: for all the possible things that I could come up with as a reason why you are doing this, I would see a better (non-MIB "abusing" :-)) alternative. But: what do I know :-) Regards, Heiko P.S.: ... > CONFIDENTIALITY > This e-mail and any attachment contain KONGSBERG information which may be > proprietary, confidential or subject to export regulations, and is only meant > for the intended recipient(s). Any disclosure, copying, distribution or use > is > prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in > error, please delete it immediately from your system and notify the sender > properly. [insert rant about privacy disclaimers in mailing list / newsletter posts here] ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users CONFIDENTIALITY This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users