Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
slapos
Commits
31b636fe
Commit
31b636fe
authored
Jan 10, 2023
by
Lu Xu
👀
Committed by
Joanne Hugé
Feb 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/ors-amarisoft: add support for lopcomm RRH
parent
7175d973
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
280 additions
and
7 deletions
+280
-7
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+7
-3
software/ors-amarisoft/config/enb.jinja2.cfg
software/ors-amarisoft/config/enb.jinja2.cfg
+24
-2
software/ors-amarisoft/instance-enb-input-schema.json.jinja2
software/ors-amarisoft/instance-enb-input-schema.json.jinja2
+10
-0
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+38
-1
software/ors-amarisoft/instance-tdd1900-enb-epc-input-schema.json
.../ors-amarisoft/instance-tdd1900-enb-epc-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd1900-enb-input-schema.json
...ware/ors-amarisoft/instance-tdd1900-enb-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd2600-enb-epc-input-schema.json
.../ors-amarisoft/instance-tdd2600-enb-epc-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd2600-enb-input-schema.json
...ware/ors-amarisoft/instance-tdd2600-enb-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd3500-enb-epc-input-schema.json
.../ors-amarisoft/instance-tdd3500-enb-epc-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd3500-enb-input-schema.json
...ware/ors-amarisoft/instance-tdd3500-enb-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd3700-enb-epc-input-schema.json
.../ors-amarisoft/instance-tdd3700-enb-epc-input-schema.json
+10
-0
software/ors-amarisoft/instance-tdd3700-enb-input-schema.json
...ware/ors-amarisoft/instance-tdd3700-enb-input-schema.json
+10
-0
software/ors-amarisoft/instance.cfg
software/ors-amarisoft/instance.cfg
+3
-1
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
+95
-0
software/ors-amarisoft/software.cfg
software/ors-amarisoft/software.cfg
+23
-0
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
31b636fe
...
@@ -16,19 +16,23 @@
...
@@ -16,19 +16,23 @@
[template]
[template]
filename = instance.cfg
filename = instance.cfg
md5sum =
ed72fb7c36b0bc046df177e4d6f3bf12
md5sum =
3feff73b667736dabb394e415077d226
[amarisoft-stats.jinja2.py]
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
_update_hash_filename_ = amarisoft-stats.jinja2.py
md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 39e191080722ac13ebc56b1e6350eb8f
[template-lte-enb-epc]
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum = 833667743c693b8d5f78a2527b275a9e
md5sum = 833667743c693b8d5f78a2527b275a9e
[template-lte-enb]
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
c4584b338d26f57d5c9384956be36677
md5sum =
6eba063433bb16942ed592be70eb959d
[template-lte-gnb-epc]
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
@@ -60,7 +64,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
...
@@ -60,7 +64,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
filename = config/enb.jinja2.cfg
md5sum =
1d0bbfa1cd22740db4f1034588c946eb
md5sum =
0b2a37e6902fd5ad3d6b37e11eebec69
[sib23.asn]
[sib23.asn]
filename = config/sib23.asn
filename = config/sib23.asn
...
...
software/ors-amarisoft/config/enb.jinja2.cfg
View file @
31b636fe
...
@@ -6,6 +6,20 @@
...
@@ -6,6 +6,20 @@
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/enb.log",
log_filename: "{{ directory['log'] }}/enb.log",
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
rf_driver: {
name: "sdr",
args: "dev0=/dev/sdr0@0",
cpri_mapping: "hw",
cpri_mult: 16,
cpri_rx_delay: 0,
cpri_tx_delay: 0,
ifname: "{{ slap_configuration.get('tap-name', '') }}",
cpri_debug: 2,
},
tx_gain: 0,
rx_gain: 0,
{% else %}
rf_driver: {
rf_driver: {
name: "sdr",
name: "sdr",
args: "dev0=/dev/sdr0",
args: "dev0=/dev/sdr0",
...
@@ -13,6 +27,7 @@
...
@@ -13,6 +27,7 @@
},
},
tx_gain: {{ slapparameter_dict.get('tx_gain', slap_configuration['configuration.default_lte_tx_gain']) }},
tx_gain: {{ slapparameter_dict.get('tx_gain', slap_configuration['configuration.default_lte_tx_gain']) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', slap_configuration['configuration.default_lte_rx_gain']) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', slap_configuration['configuration.default_lte_rx_gain']) }},
{% endif %}
com_addr: "127.0.1.2:9001",
com_addr: "127.0.1.2:9001",
mme_list: [
mme_list: [
...
@@ -76,10 +91,13 @@
...
@@ -76,10 +91,13 @@
cell_default: {
cell_default: {
n_antenna_dl: N_ANTENNA_DL,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: N_ANTENNA_UL,
n_antenna_ul: N_ANTENNA_UL,
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
// uldl_config: 2,
// sp_config: 7,
{% else %}
uldl_config: 2,
uldl_config: 2,
sp_config: 7,
sp_config: 7,
{% endif %}
n_rb_dl: N_RB_DL,
n_rb_dl: N_RB_DL,
cyclic_prefix: "normal",
cyclic_prefix: "normal",
...
@@ -134,7 +152,11 @@
...
@@ -134,7 +152,11 @@
pucch_dedicated: {
pucch_dedicated: {
n1_pucch_sr_count: 11,
n1_pucch_sr_count: 11,
cqi_pucch_n_rb: 1,
cqi_pucch_n_rb: 1,
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
// tdd_ack_nack_feedback_mode: "multiplexing",
{% else %}
tdd_ack_nack_feedback_mode: "multiplexing",
tdd_ack_nack_feedback_mode: "multiplexing",
{% endif %}
},
},
pusch_dedicated: {
pusch_dedicated: {
...
...
software/ors-amarisoft/instance-enb-input-schema.json.jinja2
View file @
31b636fe
...
@@ -23,6 +23,16 @@
...
@@ -23,6 +23,16 @@
"type": "boolean"
"type": "boolean"
},
},
{%- endif %}
{%- endif %}
"rrh": {
"title": "RRH",
"description": "RRH",
"type": "string",
"default": "SDR",
"enum": [
"SDR",
"Lopcomm ORAN"
]
},
"tx_gain": {
"tx_gain": {
"title": "Tx gain",
"title": "Tx gain",
"description": "Tx gain (in dB)",
"description": "Tx gain (in dB)",
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
31b636fe
...
@@ -10,6 +10,10 @@ parts =
...
@@ -10,6 +10,10 @@ parts =
rx-saturated-promise
rx-saturated-promise
baseband-latency-promise
baseband-latency-promise
amarisoft-stats-log-promise
amarisoft-stats-log-promise
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
lopcomm-rrh-stats-service
vswr-promise
{% endif %}
{% if not slapparameter_dict.get("sub-instance", False) %}
{% if not slapparameter_dict.get("sub-instance", False) %}
cpu-temperature-promise
cpu-temperature-promise
{% endif %}
{% endif %}
...
@@ -122,7 +126,22 @@ mode = 0775
...
@@ -122,7 +126,22 @@ mode = 0775
url = {{ amarisoft_stats_template }}
url = {{ amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py
output = ${directory:bin}/amarisoft-stats.py
### eNodeB (enb)
[lopcomm-rrh-stats-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/lopcomm-rrh-stats.log
json-log-output = ${directory:var}/log/lopcomm-rrh-stats.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :log-output
key json_log_file :json-log-output
raw testing {{ slapparameter_dict.get("testing", False) }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ lopcomm_rrh_stats_template }}
output = ${directory:bin}/lopcomm-rrh-stats.py
[amarisoft-stats-service]
[amarisoft-stats-service]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-stats-template:output}
command-line = ${amarisoft-stats-template:output}
...
@@ -131,6 +150,14 @@ mode = 0775
...
@@ -131,6 +150,14 @@ mode = 0775
hash-files =
hash-files =
${amarisoft-stats-template:output}
${amarisoft-stats-template:output}
[lopcomm-rrh-stats-service]
recipe = slapos.cookbook:wrapper
command-line = ${lopcomm-rrh-stats-template:output}
wrapper-path = ${directory:service}/lopcomm-rrh-stats
mode = 0775
hash-files =
${lopcomm-rrh-stats-template:output}
[config-base]
[config-base]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
extensions = jinja2.ext.do
...
@@ -208,6 +235,16 @@ config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
...
@@ -208,6 +235,16 @@ config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
config-min-txrx-delay = {{ slapparameter_dict.get("min_txrx_delay", 5) }}
config-min-txrx-delay = {{ slapparameter_dict.get("min_txrx_delay", 5) }}
config-avg-txrx-delay = {{ slapparameter_dict.get("avg_txrx_delay", 7) }}
config-avg-txrx-delay = {{ slapparameter_dict.get("avg_txrx_delay", 7) }}
[vswr-promise]
recipe = slapos.cookbook:promise.plugin
eggs =
slapos.core
python-dateutil
file = {{ vswr_promise }}
output = ${directory:plugins}/check-vswr.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-lopcomm-stats-log = ${lopcomm-rrh-stats-template:json-log-output}
[amarisoft-stats-log-promise]
[amarisoft-stats-log-promise]
recipe = slapos.cookbook:promise.plugin
recipe = slapos.cookbook:promise.plugin
eggs =
eggs =
...
...
software/ors-amarisoft/instance-tdd1900-enb-epc-input-schema.json
View file @
31b636fe
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
"description"
:
"Activate iperf3 UDP server"
,
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
"type"
:
"boolean"
},
},
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd1900-enb-input-schema.json
View file @
31b636fe
...
@@ -3,6 +3,16 @@
...
@@ -3,6 +3,16 @@
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"title"
:
"Input Parameters"
,
"title"
:
"Input Parameters"
,
"properties"
:
{
"properties"
:
{
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd2600-enb-epc-input-schema.json
View file @
31b636fe
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
"description"
:
"Activate iperf3 UDP server"
,
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
"type"
:
"boolean"
},
},
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd2600-enb-input-schema.json
View file @
31b636fe
...
@@ -3,6 +3,16 @@
...
@@ -3,6 +3,16 @@
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"title"
:
"Input Parameters"
,
"title"
:
"Input Parameters"
,
"properties"
:
{
"properties"
:
{
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd3500-enb-epc-input-schema.json
View file @
31b636fe
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
"description"
:
"Activate iperf3 UDP server"
,
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
"type"
:
"boolean"
},
},
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd3500-enb-input-schema.json
View file @
31b636fe
...
@@ -3,6 +3,16 @@
...
@@ -3,6 +3,16 @@
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"title"
:
"Input Parameters"
,
"title"
:
"Input Parameters"
,
"properties"
:
{
"properties"
:
{
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd3700-enb-epc-input-schema.json
View file @
31b636fe
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
"description"
:
"Activate iperf3 UDP server"
,
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
"type"
:
"boolean"
},
},
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance-tdd3700-enb-input-schema.json
View file @
31b636fe
...
@@ -3,6 +3,16 @@
...
@@ -3,6 +3,16 @@
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"title"
:
"Input Parameters"
,
"title"
:
"Input Parameters"
,
"properties"
:
{
"properties"
:
{
"rrh"
:
{
"title"
:
"RRH"
,
"description"
:
"RRH"
,
"type"
:
"string"
,
"default"
:
"SDR"
,
"enum"
:
[
"SDR"
,
"Lopcomm ORAN"
]
},
"tx_gain"
:
{
"tx_gain"
:
{
"title"
:
"Tx gain"
,
"title"
:
"Tx gain"
,
"description"
:
"Tx gain (in dB)"
,
"description"
:
"Tx gain (in dB)"
,
...
...
software/ors-amarisoft/instance.cfg
View file @
31b636fe
...
@@ -32,7 +32,7 @@ context =
...
@@ -32,7 +32,7 @@ context =
recipe = slapos.recipe.build
recipe = slapos.recipe.build
init =
init =
import os
import os
lte_version = "202
1-09-18
"
lte_version = "202
2-10-27
"
path = "/opt/amarisoft/v" + lte_version
path = "/opt/amarisoft/v" + lte_version
options['lte-version'] = lte_version
options['lte-version'] = lte_version
options['path'] = path
options['path'] = path
...
@@ -110,12 +110,14 @@ extra-context =
...
@@ -110,12 +110,14 @@ extra-context =
raw sib23 ${sib23.asn:target}
raw sib23 ${sib23.asn:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw amarisoft_stats_template ${amarisoft-stats.jinja2.py:target}
raw lopcomm_rrh_stats_template ${lopcomm-rrh-stats.jinja2.py:target}
raw sdr_busy_promise ${sdr-busy-promise:target}
raw sdr_busy_promise ${sdr-busy-promise:target}
raw cell_gain_saturated_promise ${cell-gain-saturated-promise:target}
raw cell_gain_saturated_promise ${cell-gain-saturated-promise:target}
raw rx_saturated_promise ${rx-saturated-promise:target}
raw rx_saturated_promise ${rx-saturated-promise:target}
raw baseband_latency_promise ${baseband-latency-promise:target}
raw baseband_latency_promise ${baseband-latency-promise:target}
raw amarisoft_stats_log_promise ${amarisoft-stats-log-promise:target}
raw amarisoft_stats_log_promise ${amarisoft-stats-log-promise:target}
raw cpu_temperature_promise ${cpu-temperature-promise:target}
raw cpu_temperature_promise ${cpu-temperature-promise:target}
raw vswr_promise ${vswr-promise:target}
raw openssl_location ${openssl:location}
raw openssl_location ${openssl:location}
raw default_dl_earfcn ${default-params:default-dl-earfcn}
raw default_dl_earfcn ${default-params:default-dl-earfcn}
raw default_lte_dl_freq ${default-params:default-lte-dl-freq}
raw default_lte_dl_freq ${default-params:default-lte-dl-freq}
...
...
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
0 → 100644
View file @
31b636fe
#!{{ python_path }}
import
json
import
logging
import
time
import
xmltodict
from
logging.handlers
import
RotatingFileHandler
from
ncclient
import
manager
from
ncclient.xml_
import
*
from
ncclient.devices.default
import
DefaultDeviceHandler
class
LopcommNetconfClient
:
def
__init__
(
self
):
log_file
=
"{{ log_file }}"
json_log_file
=
"{{ json_log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
json_logger
=
logging
.
getLogger
(
'json_logger'
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
self
.
json_logger
.
setLevel
(
logging
.
DEBUG
)
json_handler
=
RotatingFileHandler
(
json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
json_handler
.
setFormatter
(
json_formatter
)
self
.
json_logger
.
addHandler
(
json_handler
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
self
.
logger
.
addHandler
(
handler
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
handler
.
setFormatter
(
formatter
)
if
{{
testing
}}:
return
def
connect
(
self
,
host
,
port
,
user
,
password
):
if
{{
testing
}}:
return
self
.
address
=
(
host
,
port
)
self
.
logger
.
info
(
'Connecting to %s, user %s...'
%
(
self
.
address
,
user
))
self
.
conn
=
manager
.
connect
(
host
=
host
,
port
=
port
,
username
=
user
,
password
=
password
,
timeout
=
1800
,
device_params
=
{
'name'
:
'huawei'
},
hostkey_verify
=
False
)
self
.
logger
.
info
(
'Connection to %s successful'
%
(
self
.
address
,))
def
subscribe
(
self
):
# Filter not compatible between ncclient and netconf server
#result = self.conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub
=
self
.
conn
.
create_subscription
()
self
.
logger
.
info
(
'Subscription to %s successful'
%
(
self
.
address
,))
def
get_notification
(
self
):
result
=
None
while
result
==
None
:
self
.
logger
.
debug
(
'Waiting for notification from %s...'
%
(
self
.
address
,))
result
=
self
.
conn
.
take_notification
(
block
=
True
)
if
result
:
self
.
logger
.
debug
(
'Got new notification from %s...'
%
(
self
.
address
,))
result_in_xml
=
result
.
_raw
data_dict
=
xmltodict
.
parse
(
result_in_xml
)
self
.
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
def
close
(
self
):
# Close not compatible between ncclient and netconf server
#self.conn.close()
pass
if
__name__
==
'__main__'
:
nc
=
LopcommNetconfClient
()
while
True
:
try
:
nc
.
connect
(
"192.168.0.210"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
.
subscribe
()
while
True
:
nc
.
get_notification
()
except
Exception
as
e
:
nc
.
logger
.
debug
(
'Got exception, waiting 10 seconds before reconnecting...'
)
nc
.
logger
.
debug
(
e
)
time
.
sleep
(
10
)
finally
:
nc
.
close
()
software/ors-amarisoft/software.cfg
View file @
31b636fe
...
@@ -40,6 +40,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
...
@@ -40,6 +40,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[amarisoft-stats.jinja2.py]
[amarisoft-stats.jinja2.py]
<= download-base
<= download-base
[lopcomm-rrh-stats.jinja2.py]
<= download-base
[template-lte-enb-epc]
[template-lte-enb-epc]
<= download-base
<= download-base
...
@@ -78,6 +81,8 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
...
@@ -78,6 +81,8 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
<= download-base
<= download-base
[interface-up-promise]
[interface-up-promise]
<= download-base
<= download-base
[vswr-promise]
<= download-base
[copy-to-instance]
[copy-to-instance]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
...
@@ -115,11 +120,29 @@ filename = ue-lte.jinja2.cfg
...
@@ -115,11 +120,29 @@ filename = ue-lte.jinja2.cfg
<= copy-config-to-instance
<= copy-config-to-instance
filename = ue-nr.jinja2.cfg
filename = ue-nr.jinja2.cfg
[pynacl]
recipe = zc.recipe.egg:custom
egg = pynacl
setup-eggs =
cffi
[bcrypt]
recipe = zc.recipe.egg:custom
egg = bcrypt
setup-eggs =
cffi
[eggs]
[eggs]
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
websocket-client
websocket-client
${pynacl:egg}
${bcrypt:egg}
xmltodict
ncclient
interpreter = pythonwitheggs
interpreter = pythonwitheggs
[versions]
[versions]
websocket-client = 1.4.2
websocket-client = 1.4.2
ncclient = 0.6.13
xmltodict = 0.13.0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment