Commit 61a2e825 authored by Paul Graydon's avatar Paul Graydon

software/ors-amarisoft: Add fluentbit tag and tail state tracking

parent 86d54d98
...@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 8b9301f26fc4ffbc7eda9c1ac8da1a46 md5sum = 140cce72eb04768abbe87ea4982f36bd
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
...@@ -80,6 +80,7 @@ script = ${:etc}/run ...@@ -80,6 +80,7 @@ script = ${:etc}/run
service = ${:etc}/service service = ${:etc}/service
promise = ${:etc}/promise promise = ${:etc}/promise
log = ${:var}/log log = ${:var}/log
xlog-fluentbit = ${:var}/xlog-fluentbit
{% if slapparameter_dict.get("enb_config_link", None) %} {% if slapparameter_dict.get("enb_config_link", None) %}
[enb-config-dl] [enb-config-dl]
...@@ -149,6 +150,26 @@ command-line = ${xamari-xlog-script:output} ...@@ -149,6 +150,26 @@ command-line = ${xamari-xlog-script:output}
hash-files = ${:command-line} hash-files = ${:command-line}
{% if slapparameter_dict.get('xlog_fluentbit_forward_host') %} {% if slapparameter_dict.get('xlog_fluentbit_forward_host') %}
[xlog-fluentbit-tag]
recipe = slapos.recipe.build
computer = ${slap-connection:computer-id}
enb-id = {{ slapparameter_dict.get("enb_id", "") }}
gnb-id = {{ slapparameter_dict.get("gnb_id", "") }}
init =
import socket
options['hostname'] = socket.gethostname()
radio_id = ''
if options['enb-id']:
radio_id = 'e%s' % options['enb-id']
elif options['gnb-id']:
radio_id = 'g%s' % options['gnb-id']
options['radio-id'] = radio_id
xlog_fluentbit_tag = '_'.join(options[x] for x in ('hostname', 'computer', 'radio-id') if options[x])
options['xlog-fluentbit-tag'] = xlog_fluentbit_tag
[xlog-fluentbit-config] [xlog-fluentbit-config]
recipe = slapos.recipe.template recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}.cfg output = ${directory:etc}/${:_buildout_section_name_}.cfg
...@@ -163,7 +184,9 @@ inline = ...@@ -163,7 +184,9 @@ inline =
[INPUT] [INPUT]
name tail name tail
path ${:logfile} path ${:logfile}
tag ${xlog-fluentbit-tag:xlog-fluentbit-tag}
Read_from_Head True Read_from_Head True
db ${directory:xlog-fluentbit}/tail-state
[OUTPUT] [OUTPUT]
name forward name forward
match * match *
...@@ -240,6 +263,9 @@ ru-list = {{ dumps(rulib.iru_dict.keys() | sort) }} ...@@ -240,6 +263,9 @@ ru-list = {{ dumps(rulib.iru_dict.keys() | sort) }}
cell-list = {{ dumps(rulib.icell_dict.keys() | sort) }} cell-list = {{ dumps(rulib.icell_dict.keys() | sort) }}
peer-list = {{ dumps(ipeer_dict.keys() | sort) }} peer-list = {{ dumps(ipeer_dict.keys() | sort) }}
peer-cell-list = {{ dumps(ipeercell_dict.keys() | sort) }} peer-cell-list = {{ dumps(ipeercell_dict.keys() | sort) }}
{%- if slapparameter_dict.get('xlog_fluentbit_forward_host') %}
fluentbit-tag = ${xlog-fluentbit-tag:xlog-fluentbit-tag}
{%- endif %}
[monitor-instance-parameter] [monitor-instance-parameter]
......
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