Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
b7780ff5
Commit
b7780ff5
authored
Aug 18, 2022
by
MaksimSmile13
Browse files
Fix Generic. Add method check a subinterface
parent
e06ce8d7
Pipeline
#37254
passed with stages
in 15 minutes and 51 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Ericsson/SEOS/get_interfaces.py
View file @
b7780ff5
# ---------------------------------------------------------------------
# Ericsson.SEOS.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-202
0
The NOC Project
# Copyright (C) 2007-202
2
The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
...
...
@@ -40,3 +40,6 @@ class Script(BaseScript):
for
oid
,
iftype
in
self
.
snmp
.
getnext
(
mib
[
"IF-MIB::ifType"
])
}
return
self
.
INTERFACE_TYPES
.
get
(
self
.
_iftype_map
[
ifindex
],
"other"
)
def
is_subinterface
(
self
,
iface
):
return
False
sa/profiles/Generic/get_interfaces.py
View file @
b7780ff5
# ---------------------------------------------------------------------
# Generic.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-202
0
The NOC Project
# Copyright (C) 2007-202
2
The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
...
...
@@ -187,6 +187,10 @@ class Script(BaseScript):
"""
return
True
def
is_subinterface
(
self
,
iface
):
if
"."
in
iface
:
return
True
def
execute_snmp
(
self
,
**
kwargs
):
ifaces
=
{}
# For interfaces
subifaces
=
{}
# For subinterfaces like Fa 0/1.XXX
...
...
@@ -202,7 +206,7 @@ class Script(BaseScript):
iface
[
"ifindex"
],
iface
[
"interface"
],
iface
.
get
(
"oper_status"
)
):
continue
if
"."
in
iface
[
"interface"
]:
if
self
.
is_subinterface
(
iface
[
"interface"
]
)
:
subifaces
[
iface
[
"ifindex"
]]
=
{
"name"
:
iface
[
"interface"
],
"snmp_ifindex"
:
iface
[
"ifindex"
],
...
...
Andrey Vertiprahov
@aversant
mentioned in commit
38f5d02e
·
Aug 18, 2022
mentioned in commit
38f5d02e
mentioned in commit 38f5d02e5d699f145566f6770e68ab35de8abdb9
Toggle commit list
MaksimSmile13
@sysfaray
mentioned in merge request
!6588 (merged)
·
Aug 18, 2022
mentioned in merge request
!6588 (merged)
mentioned in merge request !6588
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment