Robert Premuz <rpremuz@srce.hr> said:
Robert> Hello,
Robert> It seems to me that there are two more bugs in scotty-2.0.2
Robert> when working in agent mode.
Robert> First, when an instance is created for a not-accessible MIB
Robert> object, Scotty reports an empty error message.
Here is a fix for this problem.
*** snmpTcl.c-orig Fri Feb 23 16:39:36 1996
--- snmpTcl.c Fri Feb 23 16:40:04 1996
***************
*** 1727,1734 ****
code = SNMP_CreateInst (session->agentInterp, argv[2], argv[3],
(argc > 4) ? argv[4] : "");
if (code != TCL_OK) {
! Tcl_SetResult (interp, session->agentInterp->result, TCL_VOLATILE);
! Tcl_ResetResult (session->agentInterp);
return code;
}
return TCL_OK;
--- 1727,1737 ----
code = SNMP_CreateInst (session->agentInterp, argv[2], argv[3],
(argc > 4) ? argv[4] : "");
if (code != TCL_OK) {
! if (interp != session->agentInterp) {
! Tcl_SetResult (interp, session->agentInterp->result,
! TCL_VOLATILE);
! Tcl_ResetResult (session->agentInterp);
! }
return code;
}
return TCL_OK;
Robert> Second, an agent created in SNMPv2 mode should response to a
Robert> get request with exceptional values for variables which don't
Robert> have instances in the agent.
Robert> I was wrong. I didn't check the syntax (type) element of a
Robert> returned varbind which, in case an exception is returned for a
Robert> requested variable, holds the textual representation of the
Robert> exceptional value.
Robert> Here I would add the following sentence:
Robert> If there is an exceptional value in the response returned by
Robert> an SNMPv2 agent, then the type element of the varbind contains
Robert> the textual representation of the exceptional value (e.g.
Robert> noSuchInstance).
Yes, it is a bug in the documentation. I changed the man page as you
suggested. Thanks for your nice bug reports. (It is usually easy to
fix bugs if there are good examples. :-)
Juergen