>>> Robert Story <rst...@freesnmp.com> schrieb am 29.11.2016 um 04:15 in Nachricht <20161128221525.010ab...@freesnmp.com>: > On Tue, 22 Nov 2016 19:26:50 +0000 cai wrote: > CA> But I found, when I include some special letters like dash or > CA> underscore in user name, it will failed to show correct user > CA> in /var/net-snmp/snmpd.conf. For example, when user name is > CA> "testsnmp-1", then result is: > CA> > CA> usmUser 1 3 0x80001f8880bfcddd116a6a1358 0x736e6d702a31 > CA> 0x736e6d702a31 NULL .... > CA> > CA> Am I doing a wrong thing? or there is a strict for the user > CA> name in net-snmp? > > When the agent saves a string, it checks to see if it has any > non-printable characters. If there are non-printable characters, > the string is saved in hexadecimal format instead of ascii format. > > But it is odd that all the characters in the string are printable. > The 2a in the string indicates '*', not '-' (which would be 2d) as > you claimed. But that should be printable. The specs do say that > isprint() can vary by locale, so perhaps this could be the issue. > Either that, or the editor you are using is not using straight > ascii mode, and what looks like a hyphen ('-') is in fact a special > character of some sort. See > <https://www.cs.tut.fi/~jkorpela/dashes.html> for all the various > non-printable hyphens.
All hyphens are printable; otherwise they wouldn't be hyphens ;-) Maybe you are referring to what isprint() returns for US-ASCII Here a a few: --‐‐-⁃ Ulrich > > Regardless, as long as the agent and client(s) are generating the > same characters, the representation in snmpd.conf does not matter. > > Robert > > ------------------------------------------------------------------------------ > _______________________________________________ > Net-snmp-coders mailing list > Net-snmp-coders@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/net-snmp-coders ------------------------------------------------------------------------------ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders