Skip to content
  • Adam Wujek's avatar
    userspace/snmpd: fix update of wrsNetworkingStatusGroup · 6c42c982
    Adam Wujek authored
    
    
    There was a special case when there was no update of pstats, but status was
    recalculated. Since counters were not updated then deltas of counters were
    within limits. It could happen that counters are growing, but statuses are
    returning "ok".
    
    For example problem was in the case, when object wrsPstatsHCRXDropRTUFull.1 was
    increasing at every read:
    $ snmpget WR-SWITCH-MIB::wrsPortStatusSfpError.1 # this triggers a read of
    status ports
    $ sleep 2
    WR-SWITCH-MIB::wrsPortStatusSfpError.1 = INTEGER: sfpOk(1)
    $ snmpget WR-SWITCH-MIB::wrsRTUStatus.0 # triggers only read of pstats, values
    of status ports are cached (only 2 seconds elapsed)
    WR-SWITCH-MIB::wrsRTUStatus.0 = INTEGER: error(2)
    $ sleep 4
    $ snmpget WR-SWITCH-MIB::wrsRTUStatus.0 # pstats value are cached, but deltas
    are re-calculated and are equal to 0. This sould report error as well.
    WR-SWITCH-MIB::wrsRTUStatus.0 = INTEGER: ok(1)
    After the code is fixed the last one returns error(2)
    
    Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
    6c42c982