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
Nirina Malard
slapos
Commits
fb5d7b53
Commit
fb5d7b53
authored
Aug 10, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/ors-amarisoft: add more logs
parent
b25f8c60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+6
-6
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
+20
-0
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
fb5d7b53
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
[template]
[template]
filename = instance.cfg
filename = instance.cfg
md5sum =
38bceddc77a5a44d69f0d9614909d1a2
md5sum =
2735363970f6c5569431325c4738896f
[amarisoft-stats.jinja2.py]
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
_update_hash_filename_ = amarisoft-stats.jinja2.py
...
@@ -28,7 +28,7 @@ md5sum = c930c28365c685a6066f382c9b5d8893
...
@@ -28,7 +28,7 @@ md5sum = c930c28365c685a6066f382c9b5d8893
[lopcomm-rrh-stats.jinja2.py]
[lopcomm-rrh-stats.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
_update_hash_filename_ = lopcomm-rrh-stats.jinja2.py
md5sum =
6d6cc0c311ff4fe807e919ce3cb3d0d8
md5sum =
b35d43ea8f8add56d7649f2862ddffc5
[lopcomm-rrh-config.jinja2.py]
[lopcomm-rrh-config.jinja2.py]
_update_hash_filename_ = lopcomm-rrh-config.jinja2.py
_update_hash_filename_ = lopcomm-rrh-config.jinja2.py
...
@@ -36,7 +36,7 @@ md5sum = b34fe47a73890097fbc6ea6374aeb38d
...
@@ -36,7 +36,7 @@ md5sum = b34fe47a73890097fbc6ea6374aeb38d
[template-enb]
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
6382f871c0f4e7e965c95de7a959342a
md5sum =
f372570f16e73f5cc4e638792fd2d5e6
[template-gnb]
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
@@ -64,7 +64,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
...
@@ -64,7 +64,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
filename = config/enb.jinja2.cfg
md5sum =
584a75944dc9aee68fafb1b63e9c1b2b
md5sum =
10d5754bbc4d0d0ff665306f3ac9f5bd
[sib23.jinja2.asn]
[sib23.jinja2.asn]
filename = config/sib23.jinja2.asn
filename = config/sib23.jinja2.asn
...
@@ -84,7 +84,7 @@ md5sum = 48b577daa5b53c2cf7fe2d30ea9c0235
...
@@ -84,7 +84,7 @@ md5sum = 48b577daa5b53c2cf7fe2d30ea9c0235
[dnsmasq.jinja2.cfg]
[dnsmasq.jinja2.cfg]
filename = config/dnsmasq.jinja2.cfg
filename = config/dnsmasq.jinja2.cfg
md5sum =
5f67c7f750e7c7bd9b9839c527a06853
md5sum =
dfcd394d1d4b4dd1caa43a9ee7bd6080
[ims.jinja2.cfg]
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
filename = config/ims.jinja2.cfg
...
@@ -104,7 +104,7 @@ md5sum = e435990eb0a0d4be41efa9bd16dce09b
...
@@ -104,7 +104,7 @@ md5sum = e435990eb0a0d4be41efa9bd16dce09b
[cu_config.jinja2.xml]
[cu_config.jinja2.xml]
filename = netconf/cu_config.jinja2.xml
filename = netconf/cu_config.jinja2.xml
md5sum =
edd54bb35c13526291924de8d1d3b795
md5sum =
2660e02c5afb3e86436282efa9f9fbc4
[software.cfg.html]
[software.cfg.html]
_update_hash_filename_ = gadget/software.cfg.html
_update_hash_filename_ = gadget/software.cfg.html
...
...
software/ors-amarisoft/lopcomm-rrh-stats.jinja2.py
View file @
fb5d7b53
...
@@ -15,13 +15,19 @@ class LopcommNetconfClient:
...
@@ -15,13 +15,19 @@ class LopcommNetconfClient:
log_file
=
"{{ log_file }}"
log_file
=
"{{ log_file }}"
json_log_file
=
"{{ json_log_file }}"
json_log_file
=
"{{ json_log_file }}"
cfg_json_log_file
=
"{{ cfg_json_log_file }}"
cfg_json_log_file
=
"{{ cfg_json_log_file }}"
supervision_json_log_file
=
"{{ supervision_json_log_file }}"
ncsession_json_log_file
=
"{{ ncsession_json_log_file }}"
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
logger
=
logging
.
getLogger
(
'logger'
)
self
.
json_logger
=
logging
.
getLogger
(
'json_logger'
)
self
.
json_logger
=
logging
.
getLogger
(
'json_logger'
)
self
.
cfg_json_logger
=
logging
.
getLogger
(
'cfg_json_logger'
)
self
.
cfg_json_logger
=
logging
.
getLogger
(
'cfg_json_logger'
)
self
.
supervision_json_logger
=
logging
.
getLogger
(
'supervision_json_logger'
)
self
.
ncsession_json_logger
=
logging
.
getLogger
(
'ncsession_json_logger'
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
self
.
logger
.
setLevel
(
logging
.
DEBUG
)
self
.
json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
cfg_json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
cfg_json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
supervision_json_logger
.
setLevel
(
logging
.
DEBUG
)
self
.
ncsession_json_logger
.
setLevel
(
logging
.
DEBUG
)
json_handler
=
RotatingFileHandler
(
json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
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_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
...
@@ -33,6 +39,16 @@ class LopcommNetconfClient:
...
@@ -33,6 +39,16 @@ class LopcommNetconfClient:
cfg_json_handler
.
setFormatter
(
cfg_json_formatter
)
cfg_json_handler
.
setFormatter
(
cfg_json_formatter
)
self
.
cfg_json_logger
.
addHandler
(
cfg_json_handler
)
self
.
cfg_json_logger
.
addHandler
(
cfg_json_handler
)
supervision_json_handler
=
RotatingFileHandler
(
supervision_json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
supervision_json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
supervision_json_handler
.
setFormatter
(
supervision_json_formatter
)
self
.
supervision_json_logger
.
addHandler
(
supervision_json_handler
)
ncsession_json_handler
=
RotatingFileHandler
(
ncsession_json_log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
ncsession_json_formatter
=
logging
.
Formatter
(
'{"time": "%(asctime)s", "log_level": "%(levelname)s", "message": "%(message)s", "data": %(data)s}'
)
ncsession_json_handler
.
setFormatter
(
ncsession_json_formatter
)
self
.
ncsession_json_logger
.
addHandler
(
ncsession_json_handler
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
100000
,
backupCount
=
5
)
self
.
logger
.
addHandler
(
handler
)
self
.
logger
.
addHandler
(
handler
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
formatter
=
logging
.
Formatter
(
"%(asctime)s [%(levelname)s] %(message)s"
)
...
@@ -81,6 +97,10 @@ class LopcommNetconfClient:
...
@@ -81,6 +97,10 @@ class LopcommNetconfClient:
data_dict
=
xmltodict
.
parse
(
result_in_xml
)
data_dict
=
xmltodict
.
parse
(
result_in_xml
)
if
'alarm-notif'
in
data_dict
[
'notification'
]:
if
'alarm-notif'
in
data_dict
[
'notification'
]:
self
.
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
self
.
json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
elif
'supervision-notification'
in
data_dict
[
'notification'
]:
self
.
supervision_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
elif
'netconf-session-start'
in
data_dict
[
'notification'
]
or
'netconf-session-end'
in
data_dict
[
'notification'
]:
self
.
ncsession_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
else
:
else
:
self
.
cfg_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
self
.
cfg_json_logger
.
info
(
''
,
extra
=
{
'data'
:
data_dict
})
...
...
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