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 ...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 02afb6fb088106df46fea25d80963dba md5sum = be054d3312acd4ff5bea116e9af895b0
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
...@@ -88,22 +88,36 @@ xlog-fluentbit = ${:var}/xlog-fluentbit ...@@ -88,22 +88,36 @@ xlog-fluentbit = ${:var}/xlog-fluentbit
[enb-sh-wrapper] [enb-sh-wrapper]
recipe = slapos.recipe.template recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_} 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-radio-log = ${directory:log}/enb.log
enb-start-date = ${directory:run}/enb-start.date enb-start-date = ${directory:run}/enb-start.date
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %} {% if not slapparameter_dict.get("testing", False) %}
sudo -n /opt/amarisoft/rm-tmp-lte; # Amarisoft init scripts
sudo -n /opt/amarisoft/init-sdr; sudo -n /opt/amarisoft/rm-tmp-lte
sudo -n /opt/amarisoft/init-enb; 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 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-2* | tail -n+50)
rm -f $(ls -1t ${directory:log}/enb-info-2* | tail -n+50)
date +"%Y-%m-%d-%T" > ${:enb-start-date} date +"%Y-%m-%d-%T" > ${:enb-start-date}
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software..." && echo) >> ${:enb-log}; # Trim enb info log to 500k and keep a 100M archive of enb info log
tail -c 1M ${:enb-log} > ${:enb-log}.tmp; head -c -500k ${:enb-info-log} >> ${:enb-info-archive-log}
mv ${:enb-log}.tmp ${:enb-log}; tail -c 500k ${:enb-info-log} > ${:enb-info-log}.tmp
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-log} 2>> ${:enb-log}; 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 %} {% endif %}
[enb-service] [enb-service]
......
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
"$ref": "instance-enb-input-schema.json#/properties/gnb_id_bits", "$ref": "instance-enb-input-schema.json#/properties/gnb_id_bits",
"default": 28 "default": 28
}, },
"gtp_addr": {
"$ref": "instance-enb-input-schema.json#/properties/gtp_addr",
"default": "127.0.1.1"
},
"amf_list": { "amf_list": {
"$ref": "instance-enb-input-schema.json#/properties/amf_list", "$ref": "instance-enb-input-schema.json#/properties/amf_list",
"default": { "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