This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
osmith gerrit-no-reply at lists.osmocom.orgosmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/17571 ) Change subject: VTY: add show bts failure report ...................................................................... VTY: add show bts failure report Save OML failure reports from each BTS in a ring buffer. Add a VTY command to display them conveniently. 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 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/osmo_bsc_main.c 4 files changed, 90 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/17571/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 5afc2cf..b7b6009 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1005,6 +1005,16 @@ uint8_t overflow; }; +struct bts_oml_fail_rep { + struct llist_head list; + time_t time; + char *event_type; + char *severity; + char *additional_text; + enum abis_nm_pcause_type pcause; + enum abis_mm_event_causes cause; +}; + /* One BTS */ struct gsm_bts { /* list header in net->bts_list */ @@ -1267,6 +1277,8 @@ struct bts_smscb_chan_state cbch_basic; struct bts_smscb_chan_state cbch_extended; struct osmo_timer_list etws_timer; /* when to stop ETWS PN */ + + struct llist_head oml_fail_rep; }; /* One rejected BTS */ diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 39adb21..94aa06c 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -559,6 +559,43 @@ return CMD_SUCCESS; } +DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts <0-255> fail-rep", + SHOW_STR "Display information about a BTS\n" + "BTS number" "OML failure reports") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct llist_head *list; + struct bts_oml_fail_rep *entry; + int bts_nr; + + bts_nr = atoi(argv[0]); + if (bts_nr >= net->num_bts) { + vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + list = &gsm_bts_num(net, bts_nr)->oml_fail_rep; + if (llist_empty(list)) { + vty_out(vty, "No failure reports received.%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + llist_for_each_entry(entry, list, list) { + char timestamp[20]; /* format like 2020-03-23 14:24:00 */ + strftime(timestamp, sizeof(timestamp), "%F %T", localtime(&entry->time)); + + vty_out(vty, "[%s] Type=%s, Severity=%s, ", timestamp, entry->event_type, entry->severity); + vty_out(vty, "Probable cause=%s: ", get_value_string(abis_nm_pcause_type_names, entry->pcause)); + if (entry->pcause == NM_PCAUSE_T_MANUF) + vty_out(vty, "%s, ", get_value_string(abis_mm_event_cause_names, entry->cause)); + else + vty_out(vty, "%04X, ", entry->cause); + vty_out(vty, "Additional text=%s%s", entry->additional_text, VTY_NEWLINE); + } + + return CMD_SUCCESS; +} + DEFUN(show_rejected_bts, show_rejected_bts_cmd, "show rejected-bts", SHOW_STR "Display recently rejected BTS devices\n") { @@ -5272,6 +5309,7 @@ install_element_ve(&bsc_show_net_cmd); install_element_ve(&show_bts_cmd); + install_element_ve(&show_bts_fail_rep_cmd); install_element_ve(&show_rejected_bts_cmd); install_element_ve(&show_trx_cmd); install_element_ve(&show_trx_con_cmd); diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index f12b032..fe421a4 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -881,6 +881,7 @@ INIT_LLIST_HEAD(&bts->abis_queue); INIT_LLIST_HEAD(&bts->loc_list); INIT_LLIST_HEAD(&bts->local_neighbors); + INIT_LLIST_HEAD(&bts->oml_fail_rep); /* Enable all codecs by default. These get reset to a more fine grained selection IF a * 'codec-support' config appears in the config file (see bsc_vty.c). */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index bf68c9b..a968c97 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -205,16 +205,55 @@ return 0; } +/* Callback function for FAIL REPORT on the OML NM: save to ringbuffer, so it can be read from VTY */ +static int oml_msg_fail_rep(struct nm_fail_rep_signal_data *fail_rep) +{ + struct llist_head *list; + struct bts_oml_fail_rep *entry; + + if (!fail_rep->bts) { + LOGP(DNM, LOGL_ERROR, "Unknown bts. Can not log failure report.\n"); + return 0; + } + + /* Allocate new list entry */ + entry = talloc_zero(fail_rep->bts, struct bts_oml_fail_rep); + entry->time = time(NULL); + entry->event_type = talloc_strdup(entry, fail_rep->parsed.event_type); + entry->severity = talloc_strdup(entry, fail_rep->parsed.severity); + entry->additional_text = talloc_strdup(entry, fail_rep->parsed.additional_text); + /* Split up probable_cause like in log_oml_fail_rep() */ + entry->pcause = fail_rep->parsed.probable_cause[0]; + entry->cause = osmo_load16be(fail_rep->parsed.probable_cause + 1); + + /* Attach to list */ + list = &fail_rep->bts->oml_fail_rep; + llist_add(&entry->list, list); + + /* Clear old entries */ + if (llist_count(list) > 50) { + struct bts_oml_fail_rep *old = llist_last_entry(list, struct bts_oml_fail_rep, list); + llist_del(&old->list); + talloc_free(old); + } + + return 0; +} + /* Callback function to be called every time we receive a signal from NM */ static int nm_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { struct nm_nack_signal_data *nack; + struct nm_fail_rep_signal_data *fail_rep; switch (signal) { case S_NM_NACK: nack = signal_data; return oml_msg_nack(nack); + case S_NM_FAIL_REP: + fail_rep = signal_data; + return oml_msg_fail_rep(fail_rep); default: break; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/17571 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I18aa17a721cd5eb1c98926dc2367229c0a50bc78 Gerrit-Change-Number: 17571 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200323/bac9cc06/attachment.htm>