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);
}
----- Original Message -----
Fra: "Sverre Moe" <sve...@spacetec.no>
Til: net-snmp-users@lists.sourceforge.net
Sendt: 24. oktober 2012 12:09:23
Emne: A MIB file dilemma
This mailing list is for Net-SNMP, but I need some help with my MIB file that I
am trying to create.
The MIB file is being created programmatically and can consist of several
thousands of scalars.
Since the scalar name has to be unique and mnemonic I am faced with a dilemma.
The following scenario is very much like the actual structure I need for my MIB
file:
A MIB definition file for a file system: The files are scalars(OBJECT-TYPE) and
directories are groups(OBJECT IDENTIFIER).
The file system could have two or more directories with same name under
different paths and it could have several files with same name in different
directories. One directory structure might be duplicated between two top
directories.
To keep my scalars and groups unique I gave them the name of the full
path(illegal characters removed). For some of my scalars I have exceeded the 64
character length for the SMIv2 standard. One solution I can think of is to make
a separate MIB file for each directory, but then I could get tens and even
hundreds of MIB files which would become very unmanageable.
Any suggestions?
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
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