Re: [tkined] SNMP set error in tkined

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Tue, 23 Mar 1999 18:20:37 +0100

>>>>> Mike Loewen writes:

Mike> I have Scotty 2.1.9/Tkined 1.4.9 installed on a Sun system under
Mike> Solaris 2.5.1, with Tcl 8.05 and Tk 8.05. Under Tkined's SNMP
Mike> Browser tool, I set the community name to the appropriate value
Mike> for our managed hub, then bring up the MIB-2 "edit System"
Mike> dialog box. When I try and change any of sysContact, sysName or
Mike> sysLocation and hit "set scalars", I get an error from tkined:

Mike> Set on sysLocation.0 failed: unknown type "DisplayString"

Mike> for any of the text fields. I've found that I can set IP
Mike> address fields, but nothing else.

Mike> If I bring up Scotty, I can establish an SNMP session to the
Mike> same hub and successfully set DisplayString fields in the same
Mike> hub with the same write community name.

Mike> Any ideas on what causes this? I saw the same behavior with
Mike> Scotty 2.1.6/Tkined 1.4.6 and Tcl 7.6 and Tk 4.2, before I
Mike> upgraded to the current versions.

The problem here is that the browser script generates a varbind of the
form {sysLocation.0 DisplayString "some value"}. It does not use the
SMI base type (which is OCTET STRING in this case). I remember that I
changed the "mib syntax" command a while ago to return the type used
in the OBEJCT-TYPE definition rather than the underlying SMI base
type. The 2.1.X mib command does not really allow to retrieve the SMI
base type. Therefore, the only quick fix I could think of is to accept
{sysLocation.0 DisplayString "some value"} as a valid varbind and to
convert DisplayString to the underlying base type in the C code. Below
is the patch which implements this solution.
Juergen

--- /tmp/scotty-2.1.10/tnm/snmp/tnmSnmpSend.c Tue Sep 15 12:47:56 1998
+++ tnmSnmpSend.c Tue Mar 23 18:15:14 1999
@@ -801,6 +801,14 @@
asn1_type = ASN1_OTHER;
}
}
+
+ if (asn1_type == ASN1_OTHER) {
+ Tnm_MibTC *tcPtr;
+ tcPtr = Tnm_MibFindTC(vbv[1]);
+ if (tcPtr) {
+ asn1_type = tcPtr->syntax;
+ }
+ }
break;
}

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.