Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
67e5f961
Commit
67e5f961
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
added relative dir to SNMP device
parent
f273495a
No related branches found
No related tags found
1 merge request
!288
Resolve L2SS-446 "Extend snmp client to support mib files"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/snmp_device.py
+16
-10
16 additions, 10 deletions
...stationcontrol/tangostationcontrol/devices/snmp_device.py
with
16 additions
and
10 deletions
tangostationcontrol/tangostationcontrol/devices/snmp_device.py
+
16
−
10
View file @
67e5f961
...
@@ -12,13 +12,15 @@
...
@@ -12,13 +12,15 @@
"""
"""
# PyTango imports
# PyTango imports
from
tango.server
import
run
from
tangostationcontrol.common.entrypoint
import
entry
from
tangostationcontrol.clients.attribute_wrapper
import
attribute_wrapper
from
tangostationcontrol.devices.lofar_device
import
lofar_device
from
tango.server
import
device_property
from
tango.server
import
device_property
import
os
# Additional import
# Additional import
from
tangostationcontrol.clients.snmp_client
import
SNMP_client
,
mib_loader
from
tangostationcontrol.clients.snmp_client
import
SNMP_client
,
mib_loader
from
tangostationcontrol.clients.attribute_wrapper
import
attribute_wrapper
from
tangostationcontrol.devices.lofar_device
import
lofar_device
import
numpy
import
numpy
...
@@ -40,6 +42,8 @@ class SNMP(lofar_device):
...
@@ -40,6 +42,8 @@ class SNMP(lofar_device):
- Type:
'
DevULong
'
- Type:
'
DevULong
'
SNMP_community
SNMP_community
- Type:
'
DevString
'
- Type:
'
DevString
'
SNMP_rel_mib_dir
- Type:
'
DevString
'
SNMP_timeout
SNMP_timeout
- Type:
'
DevDouble
'
- Type:
'
DevDouble
'
"""
"""
...
@@ -58,7 +62,7 @@ class SNMP(lofar_device):
...
@@ -58,7 +62,7 @@ class SNMP(lofar_device):
mandatory
=
True
mandatory
=
True
)
)
SNMP_mib_dir
=
device_property
(
SNMP_
rel_
mib_dir
=
device_property
(
dtype
=
'
DevString
'
,
dtype
=
'
DevString
'
,
mandatory
=
False
mandatory
=
False
)
)
...
@@ -108,8 +112,14 @@ class SNMP(lofar_device):
...
@@ -108,8 +112,14 @@ class SNMP(lofar_device):
# create the mib_loader
# create the mib_loader
loader
=
mib_loader
()
loader
=
mib_loader
()
# get the full mib directory adding the given relative path to the absolute path of this
if
self
.
SNMP_rel_mib_dir
[
0
]
==
"
/
"
:
mib_path
=
os
.
path
.
dirname
(
__file__
)
+
self
.
SNMP_rel_mib_dir
else
:
mib_path
=
os
.
path
.
dirname
(
__file__
)
+
"
/
"
+
self
.
SNMP_rel_mib_dir
# set the directory with the compiled mib files.
# set the directory with the compiled mib files.
loader
.
set_pymib_dir
(
self
.
SNMP_mib_dir
)
loader
.
set_pymib_dir
(
mib_path
)
for
i
in
self
.
attr_list
():
for
i
in
self
.
attr_list
():
try
:
try
:
...
@@ -130,9 +140,5 @@ class SNMP(lofar_device):
...
@@ -130,9 +140,5 @@ class SNMP(lofar_device):
# ----------
# ----------
def
main
(
args
=
None
,
**
kwargs
):
def
main
(
args
=
None
,
**
kwargs
):
"""
Main function of the module.
"""
"""
Main function of the module.
"""
return
entry
((
SNMP
,),
args
=
args
,
**
kwargs
)
from
tangostationcontrol.common.lofar_logging
import
configure_logger
configure_logger
()
return
run
((
SNMP
,),
args
=
args
,
**
kwargs
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment