Skip to content

Commit 79f3f60

Browse files
Fix sys uptime race condition on device restart + Moved merging table logic to separated trigger
Change-Id: I3200db002ac38224cdf91e42f02629577525de97
1 parent f05c85a commit 79f3f60

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

QAction_1257/QAction_1257.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class QAction
99
{
1010
private const int TriggerIfTable = 1000;
1111
private const int TriggerIfXTable = 1100;
12+
private const int TriggerInterfaceMerge = 1191;
1213

1314
/// <summary>
1415
/// The QAction entry point.
@@ -32,7 +33,6 @@ public static void Run(SLProtocol protocol)
3233
// Note: We poll the entire table so the bit rate calculation is triggered again using the correct values.
3334
// Polling just the cell or row could lead to wrong calculations.
3435
protocol.CheckTrigger(TriggerIfTable);
35-
protocol.CheckTrigger(TriggerIfXTable);
3636
break;
3737

3838
case Parameter.Write.interfacespromiscuousmode:
@@ -66,6 +66,8 @@ public static void Run(SLProtocol protocol)
6666
LogLevel.NoLogging);
6767
break;
6868
}
69+
70+
protocol.CheckTrigger(TriggerInterfaceMerge);
6971
}
7072
catch (Exception ex)
7173
{

protocol.xml

+46-8
Original file line numberDiff line numberDiff line change
@@ -6424,6 +6424,15 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
64246424
<Param>1000</Param>
64256425
</Content>
64266426
</Group>
6427+
<Group id="1001">
6428+
<Name>pollSysUptimeAndIfTable</Name>
6429+
<Description>SysUptime And 32-bit Interfaces Table</Description>
6430+
<Type>poll action</Type>
6431+
<Content>
6432+
<!--This group & action are making sure we always detect SNMP agent restarts before calculating counter rates-->
6433+
<Action>1000</Action>
6434+
</Content>
6435+
</Group>
64276436
<Group id="1100">
64286437
<Name>ifXTable</Name>
64296438
<Description>64-bit Interfaces Table</Description>
@@ -6432,6 +6441,23 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
64326441
<Param>1100</Param>
64336442
</Content>
64346443
</Group>
6444+
<Group id="1101">
6445+
<Name>pollSysUptimeAndIfXTable</Name>
6446+
<Description>SysUptime And 64-bit Interfaces Table</Description>
6447+
<Type>poll action</Type>
6448+
<Content>
6449+
<!--This group & action are making sure we always detect SNMP agent restarts before calculating counter rates-->
6450+
<Action>1100</Action>
6451+
</Content>
6452+
</Group>
6453+
<Group id="1191">
6454+
<Name>interfaceTableMergeAction</Name>
6455+
<Description>Merge Interface Tables</Description>
6456+
<Type>poll action</Type>
6457+
<Content>
6458+
<Action>1191</Action>
6459+
</Content>
6460+
</Group>
64356461
<Group id="1300">
64366462
<Name>dot3StatsTable</Name>
64376463
<Description>Ethernet Interfaces Table</Description>
@@ -6586,6 +6612,13 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
65866612
<Id>1100</Id>
65876613
</Content>
65886614
</Trigger>
6615+
<Trigger id="111">
6616+
<Name>MergeInterfaceTableCheckTrigger</Name>
6617+
<Type>action</Type>
6618+
<Content>
6619+
<Id>1190</Id>
6620+
</Content>
6621+
</Trigger>
65896622
</Triggers>
65906623

65916624
<Actions>
@@ -6641,7 +6674,7 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
66416674
</Action>
66426675
<Action id="1000">
66436676
<Name>IfTable Execute Next</Name>
6644-
<On id="1000">group</On>
6677+
<On id="1000;1">group</On>
66456678
<Type>execute next</Type>
66466679
</Action>
66476680

@@ -6666,13 +6699,16 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
66666699
<Type>run actions</Type>
66676700
</Action>
66686701
<Action id="1100">
6669-
<!--'execute' action is used instead of 'execute next' to make sure group 200 is polled after group 100.
6670-
this is needed since the aggregation of interface tables is done after group 200.-->
6671-
<Name>IfXTable Execute</Name>
6672-
<On id="1100">group</On>
6673-
<Type>execute</Type>
6702+
<Name>IfXTable Execute Next</Name>
6703+
<On id="1100;1">group</On>
6704+
<Type>execute next</Type>
66746705
</Action>
66756706

6707+
<Action id="1190">
6708+
<Name>Interface Table Merge Execute</Name>
6709+
<On id="1191">group</On>
6710+
<Type>execute</Type>
6711+
</Action>
66766712
<Action id="1191">
66776713
<Name>Interface Table Merge</Name>
66786714
<On id="1191">parameter</On>
@@ -6697,8 +6733,10 @@ This was felt to be sufficiently valuable to justify the redundancy.]]>
66976733
<Group>1300</Group>
66986734
<!--ifXTable needs to be polled prior to ifTable
66996735
so that ifXTableIfCounterDiscontinuityTime is available when calculating ifTable rates.-->
6700-
<Group>1100</Group>
6701-
<Group>1000</Group>
6736+
<Group>1101</Group>
6737+
<Group>1001</Group>
6738+
<Group>1191</Group>
6739+
67026740
</Content>
67036741
</Timer>
67046742
<Timer id="3">

0 commit comments

Comments
 (0)