I have seen an issue with long community strings(>32 chars) causing snimpy to puke with an error like this(I replaced community string with X's):
“ConstraintsIntersection(ConstraintsIntersection(ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(0, 65535)), ValueSizeConstraint(0, 255)), ValueSizeConstraint(1, 32)) failed at: ValueConstraintError("ValueSizeConstraint(1, 32) failed at: ValueConstraintError('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',)",) at SnmpAdminString”
This is caused by the assumption in snimpy to use the same community string as both the community data and the community index into pysnmp in the CommunityData constructor. The Community Index must be less than 32 characters. My workaround is to slice the string to less than 32 characters in the Community Index.
In the existing snmp module, this is the offending code:
Put authentication stuff in self._auth
if version in [1, 2]:
self._auth = cmdgen.CommunityData(
community, community, version - 1)
What I have done for a workaround is:
Put authentication stuff in self._auth
if version in [1, 2]:
self._auth = cmdgen.CommunityData(
community[0:31], community, version - 1)
Does this seem like a reasonable fix that I could do a PR for or would something else be better ?
I have seen an issue with long community strings(>32 chars) causing snimpy to puke with an error like this(I replaced community string with X's): “ConstraintsIntersection(ConstraintsIntersection(ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(0, 65535)), ValueSizeConstraint(0, 255)), ValueSizeConstraint(1, 32)) failed at: ValueConstraintError("ValueSizeConstraint(1, 32) failed at: ValueConstraintError('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',)",) at SnmpAdminString”
This is caused by the assumption in snimpy to use the same community string as both the community data and the community index into pysnmp in the CommunityData constructor. The Community Index must be less than 32 characters. My workaround is to slice the string to less than 32 characters in the Community Index.
In the existing snmp module, this is the offending code:
Put authentication stuff in self._auth
What I have done for a workaround is:
Put authentication stuff in self._auth
Does this seem like a reasonable fix that I could do a PR for or would something else be better ?
Thanks, Sergio