Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alexey Shapovalov
noc
Commits
2c218c41
Commit
2c218c41
authored
Jan 27, 2022
by
Andrey Vertiprahov
Browse files
Merge branch 'patch-avs-iskratel-snmp' into 'master'
Iskratel.MSAN. Add SNMP proto to profile. See merge request
noc/noc!6043
parents
a840e1ac
e49c3644
Changes
6
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Iskratel/MSAN/get_interfaces.py
View file @
2c218c41
...
...
@@ -11,7 +11,8 @@ import re
from
collections
import
defaultdict
# NOC modules
from
noc.core.script.base
import
BaseScript
# from noc.core.script.base import BaseScript
from
noc.sa.profiles.Generic.get_interfaces
import
Script
as
BaseScript
from
noc.sa.interfaces.igetinterfaces
import
IGetInterfaces
from
noc.core.ip
import
IPv4
...
...
sa/profiles/Iskratel/MSAN/get_inventory.py
View file @
2c218c41
...
...
@@ -15,7 +15,7 @@ class Script(BaseScript):
name
=
"Iskratel.MSAN.get_inventory"
interface
=
IGetInventory
def
execute
(
self
):
def
execute
_cli
(
self
,
**
kwargs
):
v
=
self
.
profile
.
get_hardware
(
self
)
r
=
{
"vendor"
:
"ISKRATEL"
,
"part_no"
:
v
[
"part_no"
],
"serial"
:
v
[
"serial"
]}
if
v
[
"number"
]:
...
...
sa/profiles/Iskratel/MSAN/get_lldp_neighbors.py
View file @
2c218c41
...
...
@@ -31,7 +31,7 @@ class Script(BaseScript):
re
.
MULTILINE
|
re
.
DOTALL
,
)
def
execute
(
self
):
def
execute
_cli
(
self
,
**
kwargs
):
r
=
[]
try
:
v
=
self
.
cli
(
"show lldp remote-device all"
)
...
...
sa/profiles/Iskratel/MSAN/get_mac_address_table.py
View file @
2c218c41
...
...
@@ -32,7 +32,7 @@ class Script(BaseScript):
r
"^(?P<mac>\S+)\s+(?P<interface>\d+/\d+)\s+(?P<type>\S+)\s*\n"
,
re
.
MULTILINE
)
def
execute
(
self
,
interface
=
None
,
vlan
=
None
,
mac
=
None
):
def
execute
_cli
(
self
,
interface
=
None
,
vlan
=
None
,
mac
=
None
):
cmd
=
"show mac-addr-table"
if
interface
is
not
None
:
cmd
+=
" interface %s"
%
interface
...
...
sa/profiles/Iskratel/MSAN/get_version.py
View file @
2c218c41
...
...
@@ -24,6 +24,15 @@ class Script(BaseScript):
rx_ver
=
re
.
compile
(
r
"(Steer|Appl\.|Package)\s*Version\.+\s*(?P<version>\S+)"
)
def
execute_snmp
(
self
,
**
kwargs
):
version
=
self
.
snmp
.
get
(
"1.3.6.1.4.1.1332.1.1.5.1.3.1.0"
)
return
{
"vendor"
:
"Iskratel"
,
"platform"
:
"Iskratel SGR"
,
"version"
:
version
,
# "attributes": {"Serial Number": serial},
}
def
execute_cli
(
self
):
v
=
self
.
cli
(
"show hardware"
,
cached
=
True
)
match
=
self
.
rx_platform
.
search
(
v
)
...
...
sa/profiles/Iskratel/MSAN/profile.py
View file @
2c218c41
...
...
@@ -80,3 +80,13 @@ class Profile(BaseProfile):
else
:
match
=
self
.
rx_hw2
.
search
(
c
)
return
match
.
groupdict
()
rx_iface
=
re
.
compile
(
r
"[01]/\d+"
)
@
classmethod
def
get_interface_type
(
cls
,
name
):
if
cls
.
rx_iface
.
match
(
name
):
return
"physical"
if
name
==
"2/1"
:
return
"aggregated"
return
"other"
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