VTY: Add command `show bts brief`
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
This commit is contained in:
parent
e1f33e5c10
commit
5572c82378
|
@ -51,6 +51,7 @@ struct gsm_network *gsmnet_from_vty(struct vty *vty);
|
||||||
|
|
||||||
int bts_vty_init(void);
|
int bts_vty_init(void);
|
||||||
void bts_dump_vty(struct vty *vty, struct gsm_bts *bts);
|
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 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 ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts);
|
||||||
void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan);
|
void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan);
|
||||||
|
|
|
@ -257,6 +257,22 @@ DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]",
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN(show_bts_online, show_bts_online_cmd, "show bts brief",
|
||||||
|
SHOW_STR "Display information about a BTS\n"
|
||||||
|
"Display availability status of all BTS\n")
|
||||||
|
{
|
||||||
|
struct gsm_network *net = gsmnet_from_vty(vty);
|
||||||
|
struct gsm_bts *bts;
|
||||||
|
|
||||||
|
/* Print OML state of BTSs. */
|
||||||
|
llist_for_each_entry(bts, &net->bts_list, list) {
|
||||||
|
vty_out(vty, "BTS %d:", bts->nr);
|
||||||
|
bts_dump_vty_oml_link_state(vty, bts);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts <0-255> fail-rep [reset]",
|
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"
|
SHOW_STR "Display information about a BTS\n"
|
||||||
"BTS number\n" "OML failure reports\n"
|
"BTS number\n" "OML failure reports\n"
|
||||||
|
@ -3628,6 +3644,7 @@ int bsc_vty_init(struct gsm_network *network)
|
||||||
|
|
||||||
install_element_ve(&bsc_show_net_cmd);
|
install_element_ve(&bsc_show_net_cmd);
|
||||||
install_element_ve(&show_bts_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_bts_fail_rep_cmd);
|
||||||
install_element_ve(&show_rejected_bts_cmd);
|
install_element_ve(&show_rejected_bts_cmd);
|
||||||
install_element_ve(&show_trx_cmd);
|
install_element_ve(&show_trx_cmd);
|
||||||
|
|
|
@ -3992,7 +3992,6 @@ static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
|
||||||
void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
||||||
{
|
{
|
||||||
struct pchan_load pl;
|
struct pchan_load pl;
|
||||||
unsigned long long sec;
|
|
||||||
struct gsm_bts_trx *trx;
|
struct gsm_bts_trx *trx;
|
||||||
int ts_hopping_total;
|
int ts_hopping_total;
|
||||||
int ts_non_hopping_total;
|
int ts_non_hopping_total;
|
||||||
|
@ -4124,14 +4123,7 @@ void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
||||||
if (is_ipa_abisip_bts(bts)) {
|
if (is_ipa_abisip_bts(bts)) {
|
||||||
vty_out(vty, " OML Link: ");
|
vty_out(vty, " OML Link: ");
|
||||||
e1isl_dump_vty_tcp(vty, bts->oml_link);
|
e1isl_dump_vty_tcp(vty, bts->oml_link);
|
||||||
vty_out(vty, " OML Link state: %s", get_model_oml_status(bts));
|
bts_dump_vty_oml_link_state(vty, 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);
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
|
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
|
||||||
e1isl_dump_vty(vty, bts->oml_link);
|
e1isl_dump_vty(vty, bts->oml_link);
|
||||||
|
@ -4209,6 +4201,20 @@ void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
||||||
bts_dump_vty_features(vty, bts);
|
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)
|
static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
Loading…
Reference in New Issue