diff options
author | Oliver Smith <osmith@sysmocom.de> | 2020-03-18 12:39:30 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2020-03-27 09:55:30 +0100 |
commit | ba0a12233fca0187864cd2af6a428e3f40fd85fa (patch) | |
tree | 202614f06e511791aae5d3240c745224263a6f28 /src/osmo-bsc/abis_nm.c | |
parent | cd1df9975c68ca4dcf227d8206b95b4fc782b5f4 (diff) |
VTY: add show bts failure report
Save OML failure reports from each BTS. Add a VTY command to display them
conveniently and optionally clear the list.
OsmoBSC> show bts 0 fail-rep
[2020-03-23 14:51:22] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY
[2020-03-23 14:51:19] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY
Related: OS#1605
Change-Id: I18aa17a721cd5eb1c98926dc2367229c0a50bc78
Diffstat (limited to 'src/osmo-bsc/abis_nm.c')
-rw-r--r-- | src/osmo-bsc/abis_nm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 07effd38a..32e9a8faf 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -412,6 +412,21 @@ static int rx_fail_evt_rep(struct msgb *mb, struct gsm_bts *bts) int rc = 0; const uint8_t *p_val; const char *e_type, *severity, *p_text; + struct bts_oml_fail_rep *entry; + + /* Store copy in bts->oml_fail_rep */ + entry = talloc_zero(bts, struct bts_oml_fail_rep); + OSMO_ASSERT(entry); + entry->time = time(NULL); + entry->mb = msgb_copy_c(entry, mb, "OML failure report"); + llist_add(&entry->list, &bts->oml_fail_rep); + + /* Limit list size */ + if (llist_count(&bts->oml_fail_rep) > 50) { + struct bts_oml_fail_rep *old = llist_last_entry(&bts->oml_fail_rep, struct bts_oml_fail_rep, list); + llist_del(&old->list); + talloc_free(old); + } sd = abis_nm_fail_evt_rep_parse(mb, bts); if (!sd) { |