jolly has uploaded this change for review.
VTY: Add command `show bts online`
This line shows all BTS an their OML states in a single line.
Additionally the uptime or downtime is displayed, if there was a connect
or disconnect of the OML link.
Related: OS#6018
Change-Id: I003fd32e589ddf53b7dd42089f904cfb598e3625
---
M include/osmocom/bsc/vty.h
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_vty.c
3 files changed, 47 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/35567/1
diff --git a/include/osmocom/bsc/vty.h b/include/osmocom/bsc/vty.h
index a54b18e..092bc20 100644
--- a/include/osmocom/bsc/vty.h
+++ b/include/osmocom/bsc/vty.h
@@ -51,6 +51,7 @@
int bts_vty_init(void);
void bts_dump_vty(struct vty *vty, struct gsm_bts *bts);
+void bts_dump_vty_oml_link_state(struct vty *vty, struct gsm_bts *bts);
void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx, bool print_rsl, bool show_connected);
void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts);
void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan);
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 925f21f..288a162 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -257,6 +257,22 @@
return CMD_SUCCESS;
}
+DEFUN(show_bts_online, show_bts_online_cmd, "show bts online",
+ SHOW_STR "Display information about a BTS\n"
+ "Display availability status of all BTS\n")
+{
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ int bts_nr;
+
+ /* Print OML state of BTSs. */
+ for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) {
+ vty_out(vty, "BTS %d:", bts_nr);
+ bts_dump_vty_oml_link_state(vty, gsm_bts_num(net, bts_nr));
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts <0-255> fail-rep [reset]",
SHOW_STR "Display information about a BTS\n"
"BTS number\n" "OML failure reports\n"
@@ -3628,6 +3644,7 @@
install_element_ve(&bsc_show_net_cmd);
install_element_ve(&show_bts_cmd);
+ install_element_ve(&show_bts_online_cmd);
install_element_ve(&show_bts_fail_rep_cmd);
install_element_ve(&show_rejected_bts_cmd);
install_element_ve(&show_trx_cmd);
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index 8aa1f89..e38ec94 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -3992,7 +3992,6 @@
void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
{
struct pchan_load pl;
- unsigned long long sec;
struct gsm_bts_trx *trx;
int ts_hopping_total;
int ts_non_hopping_total;
@@ -4124,14 +4123,7 @@
if (is_ipa_abisip_bts(bts)) {
vty_out(vty, " OML Link: ");
e1isl_dump_vty_tcp(vty, bts->oml_link);
- vty_out(vty, " OML Link state: %s", get_model_oml_status(bts));
- if (bts_setup_ramp_active(bts->network))
- vty_out(vty, " BTS Ramping: %s", bts_setup_ramp_get_state_str(bts));
- sec = bts_updowntime(bts);
- if (sec)
- vty_out(vty, " %llu days %llu hours %llu min. %llu sec.",
- OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60);
- vty_out(vty, "%s", VTY_NEWLINE);
+ bts_dump_vty_oml_link_state(vty, bts);
} else {
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
e1isl_dump_vty(vty, bts->oml_link);
@@ -4209,6 +4201,20 @@
bts_dump_vty_features(vty, bts);
}
+void bts_dump_vty_oml_link_state(struct vty *vty, struct gsm_bts *bts)
+{
+ unsigned long long sec;
+
+ vty_out(vty, " OML Link state: %s", get_model_oml_status(bts));
+ if (bts_setup_ramp_active(bts->network))
+ vty_out(vty, " BTS Ramping: %s", bts_setup_ramp_get_state_str(bts));
+ sec = bts_updowntime(bts);
+ if (sec)
+ vty_out(vty, " %llu days %llu hours %llu min. %llu sec.",
+ OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60);
+ vty_out(vty, "%s", VTY_NEWLINE);
+}
+
static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts)
{
unsigned int i;
To view, visit change 35567. To unsubscribe, or for help writing mail filters, visit settings.