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
Carlos Ramos Carreño
slapos
Commits
ac3786d9
Commit
ac3786d9
authored
Jan 20, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lopcomm stats service
parent
3aefe472
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
3 deletions
+115
-3
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+6
-2
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+23
-1
software/ors-amarisoft/instance.cfg
software/ors-amarisoft/instance.cfg
+1
-0
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
+66
-0
software/ors-amarisoft/software.cfg
software/ors-amarisoft/software.cfg
+19
-0
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
ac3786d9
...
...
@@ -16,19 +16,23 @@
[template]
filename = instance.cfg
md5sum =
61e9685d6aa973ae0c45c45ca357458a
md5sum =
e4d4b5c9d4f00b36478dc9f2b13c1e3c
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
md5sum = 6e0a052bd0ca08cc0c7b4880d3deffcc
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum = 37a5d971626f44d8dfd734ebce8c8473
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
md5sum = 833667743c693b8d5f78a2527b275a9e
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
afd8867c4dec5c5c68a4005dec502ebb
md5sum =
fb2e5265bdb844c5c936d1f3837f9892
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
ac3786d9
...
...
@@ -5,6 +5,7 @@ parts =
lte-enb-config
lte-enb-service
amarisoft-stats-service
lopcomm-rrh-stats-service
sdr-busy-promise
cell-gain-saturated-promise
rx-saturated-promise
...
...
@@ -120,7 +121,20 @@ mode = 0775
url = {{ amarisoft_stats_template }}
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.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key log_file :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]
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-stats-template:output}
...
...
@@ -129,6 +143,14 @@ mode = 0775
hash-files =
${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]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
...
...
software/ors-amarisoft/instance.cfg
View file @
ac3786d9
...
...
@@ -110,6 +110,7 @@ extra-context =
raw sib23 ${sib23.asn:target}
raw ltelogs_template ${ltelogs.jinja2.sh: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 cell_gain_saturated_promise ${cell-gain-saturated-promise:target}
raw rx_saturated_promise ${rx-saturated-promise:target}
...
...
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
0 → 100644
View file @
ac3786d9
#!{{ python_path }}
import
json
import
logging
import
time
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 }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
logger
.
setLevel
(
logging
.
INFO
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
30000
,
backupCount
=
2
)
formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
handler
.
setFormatter
(
formatter
)
self
.
logger
.
addHandler
(
handler
)
if
{{
testing
}}:
return
def
connect
(
host
,
port
,
user
,
password
):
if
{{
testing
}}:
return
conn
=
manager
.
connect
(
host
=
host
,
port
=
port
,
username
=
user
,
password
=
password
,
timeout
=
1800
,
device_params
=
{
'name'
:
'huawei'
},
hostkey_verify
=
False
)
#result = conn.create_subscription(filter=('xpath', '/o-ran-fm:*'))
sub
=
conn
.
create_subscription
()
result
=
None
while
result
==
None
:
result
=
conn
.
take_notification
(
block
=
True
,
timeout
=
60
)
print
(
result
)
import
pdb
;
pdb
.
set_trace
()
#self.logger.info('', extra={'data': r})
if
__name__
==
'__main__'
:
#LOG_FORMAT = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(message)s'
#logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=LOG_FORMAT)
#logging.getLogger().setLevel(logging.DEBUG)
connect
(
"192.168.0.210"
,
830
,
"oranuser"
,
"oranpassword"
)
nc
=
LopcommNetconfClient
()
while
True
:
try
:
nc
.
connect
()
time
.
sleep
(
10
)
except
Exception
as
e
:
nc
.
logger
.
debug
(
e
)
finally
:
nc
.
close
()
software/ors-amarisoft/software.cfg
View file @
ac3786d9
...
...
@@ -40,6 +40,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[amarisoft-stats.jinja2.py]
<= download-base
[lopcomm-rrh-stats.jinja2.py]
<= download-base
[template-lte-enb-epc]
<= download-base
...
...
@@ -115,11 +118,27 @@ filename = ue-lte.jinja2.cfg
<= copy-config-to-instance
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]
recipe = zc.recipe.egg
eggs =
websocket-client
${pynacl:egg}
${bcrypt:egg}
ncclient
interpreter = pythonwitheggs
[versions]
websocket-client = 1.4.2
ncclient = 0.6.13
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