Hi,
I'm trying to understand the difference between using an "override" for setting
the IF-MIB::ifLinkUpDownTrapEnable.<x> object vs. a traditional set. I find
that when these columns are set for an ifXEntry via the override mechanism in
the agent's configuration file I do not ever see the corresponding effect (wrt
linkUp/linkDown traps being issued):
override -rw IF-MIB::ifLinkUpDownTrapEnable.4 integer 1
However, if I remove the override and instead set the MIB object via a
traditional set the corresponding effect (linkUp/linkDown traps being issued)
does indeed occur:
snmpset -v2c -c private -m ALL localhost IF-MIB::ifLinkUpDownTrapEnable.4 i 1
Indeed, when I step through the agent in the debugger I see the key conditional
where this behaviour changes. This is in _check_interface_entry_for_updates()
in ifTable_data_access.c:
...
if (oper_changed) {
rowreq_ctx->data.ifLastChange = netsnmp_get_agent_uptime();
#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
if (rowreq_ctx->data.ifLinkUpDownTrapEnable == 1) {
if (rowreq_ctx->data.ifOperStatus == IFOPERSTATUS_UP) {
...
The 'data.ifLinkUpDownTrapEnable' data member is always 0 in the override case,
however, it is always the correct value (1 in the 'snmpset' case above) when
'snmpset' is used. Oddly, in the override case I do see an associated get
('snmpget') return the proper override (enable) value:
snmpget -v2c -c private -m ALL localhost IF-MIB::ifLinkUpDownTrapEnable.4
IF-MIB::ifLinkUpDownTrapEnable.4 = INTEGER: enabled(1)
Moreover, whenever the override is used (note the use of the '-rw' token) I do
not see any of the normal table access methods in ifXTable.c get called (i.e.,
no breaks in ifLinkUpDownTrapEnable_{get|set}). Why is this? And why does this
have an effect on the ultimately relevant conditional in
_check_interface_entry_for_updates()?
My preference is to use the override mechanism so that I can persist (and
ultimately prevent sets by removing the '-rw' token) the enable/disable state.
Thanks for any insight anyone might be able to provide.
Regards,
-David
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders