Skip to content

Commit b7449c1

Browse files
committed
[roc-status] Report ONU sticky bit as int for monitoring
1 parent 18d8689 commit b7449c1

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ metric format for the CRORC and the CRU is different, as different parameters ar
553553
554554
| Value name | Value | Type |
555555
| -------------------| --------------------------- | ------ |
556-
| `"onuStickyStatus"`| 0/1/2 (DOWN/UP/UP was DOWN) | int |
556+
| `"onuStickyStatus"`| 0/1 (DOWN/UP) | int |
557557
| `"onuAddress"` | ONU Address | string |
558558
| `"rx40Locked"` | 0/1 (False/True) | int |
559559
| `"phaseGood"` | 0/1 (False/True) | int |

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,13 @@ class ProgramStatus : public Program
227227
/* ONU PARAMETERS */
228228
if (mOptions.onu) {
229229
Cru::OnuStatus onuStatus = cruBar2->reportOnuStatus();
230-
std::string onuStickyStatus;
230+
int onuStickyStatus = 0;
231231

232-
if (onuStatus.stickyBit == Cru::LinkStatus::Up) {
233-
onuStickyStatus = "UP";
234-
} else if (onuStatus.stickyBit == Cru::LinkStatus::UpWasDown) {
235-
onuStickyStatus = "UP (was DOWN)";
232+
if (onuStatus.stickyBit == Cru::LinkStatus::Up || onuStatus.stickyBit == Cru::LinkStatus::UpWasDown) {
233+
// force status = 1 (vs = 2) when UP(was DOWN) for monitoring
234+
onuStickyStatus = 1;
236235
} else if (onuStatus.stickyBit == Cru::LinkStatus::Down) {
237-
onuStickyStatus = "DOWN";
236+
onuStickyStatus = 0;
238237
}
239238

240239
if (mOptions.monitoring) {

0 commit comments

Comments
 (0)