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/.
Max gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/4009
Show OML link uptime in vty
Save the time when OML link to BTS was established and show it in
vty. That's useful when troubleshooting issues like periodic/sporadic
BTS restart.
Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600
---
M include/osmocom/bsc/gsm_data_shared.h
M src/libbsc/bsc_vty.c
M src/libbsc/bts_ipaccess_nanobts.c
M src/libbsc/e1_config.c
4 files changed, 16 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4009/1
diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h
index 6ce571e..f41bac4 100644
--- a/include/osmocom/bsc/gsm_data_shared.h
+++ b/include/osmocom/bsc/gsm_data_shared.h
@@ -722,6 +722,8 @@
struct gsm_e1_subslot oml_e1_link;
uint8_t oml_tei;
struct e1inp_sign_link *oml_link;
+ /* when OML link was established */
+ time_t uptime;
/* Abis network management O&M handle */
struct abis_nm_h *nmh;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 3a80f06..512f476 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
+#include <time.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/buffer.h>
@@ -304,8 +305,14 @@
paging_pending_requests_nr(bts),
bts->paging.available_slots, VTY_NEWLINE);
if (is_ipaccess_bts(bts)) {
- vty_out(vty, " OML Link state: %s.%s",
- bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE);
+ vty_out(vty, " OML Link state: ");
+ if (bts->oml_link) {
+ vty_out(vty, "connected");
+ if (bts->uptime)
+ vty_out(vty, " since %s", ctime(&(bts->uptime)));
+ vty_out(vty, "%s", VTY_NEWLINE);
+ } else
+ vty_out(vty, "disconnected.%s", VTY_NEWLINE);
} else {
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
e1isl_dump_vty(vty, bts->oml_link);
diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c
index 1f203f5..4643eac 100644
--- a/src/libbsc/bts_ipaccess_nanobts.c
+++ b/src/libbsc/bts_ipaccess_nanobts.c
@@ -20,6 +20,7 @@
*/
#include <arpa/inet.h>
+#include <time.h>
#include <osmocom/gsm/tlv.h>
@@ -364,6 +365,7 @@
e1inp_sign_link_destroy(bts->oml_link);
bts->oml_link = NULL;
+ bts->uptime = 0;
/* we have issues reconnecting RSL, drop everything. */
llist_for_each_entry(trx, &bts->trx_list, list)
@@ -423,6 +425,7 @@
e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1],
E1INP_SIGN_OML, bts->c0,
bts->oml_tei, 0);
+ bts->uptime = time(NULL);
break;
case E1INP_SIGN_RSL: {
struct e1inp_ts *ts;
diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c
index 1923efd..9ef195f 100644
--- a/src/libbsc/e1_config.c
+++ b/src/libbsc/e1_config.c
@@ -20,7 +20,7 @@
#include <string.h>
#include <errno.h>
-
+#include <time.h>
#include <netinet/in.h>
#include <osmocom/bsc/gsm_data.h>
@@ -201,6 +201,7 @@
if (bts->oml_link)
e1inp_sign_link_destroy(bts->oml_link);
bts->oml_link = oml_link;
+ bts->uptime = time(NULL);
llist_for_each_entry(trx, &bts->trx_list, list)
e1_reconfig_trx(trx);
--
To view, visit https://gerrit.osmocom.org/4009
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>