Commit 9fc9923f authored by Joanne Hugé's avatar Joanne Hugé

software/ors-amarisoft: add useful information in enb logs

* rename enb-output.log to enb-info.log
* add host ID, FPGA version and kernel version in enb-info.log
* keep the 50 latest enb radio logs
* don't let enb-info execeed 500kB, but store up to 100MB of enb-info
  archives
  into another file
parent 97b8d884
......@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 02afb6fb088106df46fea25d80963dba
md5sum = be054d3312acd4ff5bea116e9af895b0
[template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
......@@ -88,22 +88,36 @@ xlog-fluentbit = ${:var}/xlog-fluentbit
[enb-sh-wrapper]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
enb-log = ${directory:log}/enb-output.log
enb-info-log = ${directory:log}/enb-info.log
enb-info-archive-log = ${directory:log}/enb-info.log
enb-radio-log = ${directory:log}/enb.log
enb-start-date = ${directory:run}/enb-start.date
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo -n /opt/amarisoft/rm-tmp-lte;
sudo -n /opt/amarisoft/init-sdr;
sudo -n /opt/amarisoft/init-enb;
# Amarisoft init scripts
sudo -n /opt/amarisoft/rm-tmp-lte
sudo -n /opt/amarisoft/init-sdr
sudo -n /opt/amarisoft/init-enb
# Add useful information to enb-info log
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software...") >> ${:enb-info-log}
(echo -n "PCB: " ; for o in t b v s ; do sudo -n /opt/amarisoft/get-sdr-info -$o 2> /dev/null ; echo -n " " ; done ; echo) >> ${:enb-info-log}
(AMARISOFT_PATH=/dev/null {{ enb }}/lteenb ${directory:etc}/enb.cfg 2>&1 >/dev/null | sed -n 's/^.*\(Host ID.*\)$/\1/gp') >> ${:enb-info-log}
echo "System info: $(uname -a)" >> ${:enb-info-log}
({{ sdr }}/sdr_util version && echo) >> ${:enb-info-log}
# Keep the 50 latest enb radio log
stat ${:enb-start-date} && mv ${:enb-radio-log} ${directory:log}/enb-$(cat ${:enb-start-date}).log
rm -f $(ls -1t ${directory:log}/enb-2* | tail -n+50)
rm -f $(ls -1t ${directory:log}/enb-info-2* | tail -n+50)
date +"%Y-%m-%d-%T" > ${:enb-start-date}
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software..." && echo) >> ${:enb-log};
tail -c 1M ${:enb-log} > ${:enb-log}.tmp;
mv ${:enb-log}.tmp ${:enb-log};
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-log} 2>> ${:enb-log};
# Trim enb info log to 500k and keep a 100M archive of enb info log
head -c -500k ${:enb-info-log} >> ${:enb-info-archive-log}
tail -c 500k ${:enb-info-log} > ${:enb-info-log}.tmp
mv ${:enb-info-log}.tmp ${:enb-info-log}
tail -c 100M ${:enb-info-archive-log} > ${:enb-info-archive-log}.tmp
mv ${:enb-info-archive-log}.tmp ${:enb-info-archive-log}
# Launch lteenb
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-info-log} 2>> ${:enb-info-log}
{% endif %}
[enb-service]
......
......@@ -50,6 +50,10 @@
"$ref": "instance-enb-input-schema.json#/properties/gnb_id_bits",
"default": 28
},
"gtp_addr": {
"$ref": "instance-enb-input-schema.json#/properties/gtp_addr",
"default": "127.0.1.1"
},
"amf_list": {
"$ref": "instance-enb-input-schema.json#/properties/amf_list",
"default": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment