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
18adae30
Commit
18adae30
authored
Jan 25, 2022
by
Andrey Vertiprahov
Browse files
Merge branch 'patch-avs-eltex-mes-revision' into 'master'
Eltex.MES. Add MES-3324F rev B platform. See merge request
noc/noc!6041
parents
8eef650d
8471d4dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Eltex/MES/get_inventory.py
View file @
18adae30
...
...
@@ -54,12 +54,12 @@ class Script(BaseScript):
else
:
descr
=
None
platform
=
None
platform
,
revision
=
None
,
None
match
=
self
.
rx_platform
.
search
(
plat
)
if
match
:
platform
=
match
.
group
(
"platform"
)
platform
=
platform
.
split
(
"."
)[
8
]
platform
=
self
.
profile
.
get_platform
(
platform
)
platform
,
revision
=
self
.
profile
.
get_platform
(
platform
)
elif
self
.
has_capability
(
"Stack | Members"
):
# Try to obtain platform from description
if
descr
and
descr
.
startswith
(
"MES"
):
...
...
@@ -84,7 +84,9 @@ class Script(BaseScript):
r
=
{
"type"
:
"CHASSIS"
,
"vendor"
:
"ELTEX"
,
"part_no"
:
[
platform
]}
if
serial
:
r
[
"serial"
]
=
serial
.
group
(
"serial"
)
if
hardware
:
if
revision
:
r
[
"revision"
]
=
revision
.
split
(
"."
)[
-
1
]
elif
hardware
:
r
[
"revision"
]
=
hardware
.
group
(
"hardware"
)
if
descr
:
r
[
"description"
]
=
descr
...
...
sa/profiles/Eltex/MES/get_version.py
View file @
18adae30
...
...
@@ -35,29 +35,40 @@ class Script(BaseScript):
def
execute_snmp
(
self
,
**
kwargs
):
try
:
platform
=
self
.
snmp
.
get
(
mib
[
"SNMPv2-MIB::sysObjectID
.0"
],
cached
=
True
)
platform
=
self
.
snmp
.
get
(
mib
[
"SNMPv2-MIB::sysObjectID
"
,
0
],
cached
=
True
)
platform
=
platform
.
split
(
"."
)[
8
]
platform
=
self
.
profile
.
get_platform
(
platform
.
split
(
")"
)[
0
])
version
=
self
.
snmp
.
get
(
"1.3.6.1.2.1.47.1.1.1.1.10.67108992"
,
cached
=
True
)
bootprom
=
self
.
snmp
.
get
(
"1.3.6.1.2.1.47.1.1.1.1.9.67108992"
,
cached
=
True
)
hardware
=
self
.
snmp
.
get
(
"1.3.6.1.2.1.47.1.1.1.1.8.67108992"
,
cached
=
True
)
serial
=
self
.
snmp
.
get
(
"1.3.6.1.2.1.47.1.1.1.1.11.67108992"
,
cached
=
True
)
platform
,
revision
=
self
.
profile
.
get_platform
(
platform
.
split
(
")"
)[
0
])
version
=
self
.
snmp
.
get
(
mib
[
"ENTITY-MIB::entPhysicalSoftwareRev"
,
67108992
])
try
:
bootprom
=
self
.
snmp
.
get
(
mib
[
"ENTITY-MIB::entPhysicalFirmwareRev"
,
67108992
])
except
self
.
snmp
.
SNMPError
:
bootprom
=
None
try
:
hardware
=
self
.
snmp
.
get
(
mib
[
"ENTITY-MIB::entPhysicalHardwareRev"
,
67108992
])
except
self
.
snmp
.
SNMPError
:
hardware
=
None
serial
=
self
.
snmp
.
get
(
mib
[
"ENTITY-MIB::entPhysicalSerialNum"
,
67108992
])
if
not
version
:
# rndBrgVersion
version
=
self
.
snmp
.
get
(
"1.3.6.1.4.1.89.2.4.0"
,
cached
=
True
)
if
not
serial
:
# rlPhdUnitGenParamSerialNum
serial
=
self
.
snmp
.
get
(
"1.3.6.1.4.1.89.53.14.1.5.1"
,
cached
=
True
)
r
eturn
{
r
=
{
"vendor"
:
"Eltex"
,
"platform"
:
platform
,
"version"
:
version
,
"attributes"
:
{
"Boot PROM"
:
bootprom
,
"HW version"
:
hardware
,
"Serial Number"
:
serial
,
},
}
if
bootprom
:
r
[
"attributes"
][
"Boot PROM"
]
=
bootprom
if
hardware
:
r
[
"attributes"
][
"HW version"
]
=
hardware
if
revision
:
r
[
"attributes"
][
"revision"
]
=
revision
return
r
except
self
.
snmp
.
TimeOutError
:
raise
self
.
UnexpectedResultError
...
...
@@ -83,7 +94,7 @@ class Script(BaseScript):
match
=
self
.
rx_platform
.
search
(
plat
)
platform
=
match
.
group
(
"platform"
)
platform
=
platform
.
split
(
"."
)[
8
]
platform
=
self
.
profile
.
get_platform
(
platform
)
platform
,
revision
=
self
.
profile
.
get_platform
(
platform
)
match
=
self
.
rx_version1
.
search
(
ver
)
if
match
:
...
...
@@ -124,4 +135,6 @@ class Script(BaseScript):
res
[
"attributes"
][
"Boot PROM"
]
=
bootprom
.
group
(
"bootprom"
)
if
hardware
:
res
[
"attributes"
][
"HW version"
]
=
hardware
.
group
(
"hardware"
)
if
revision
:
res
[
"attributes"
][
"revision"
]
=
revision
return
res
sa/profiles/Eltex/MES/profile.py
View file @
18adae30
...
...
@@ -99,10 +99,12 @@ class Profile(BaseProfile):
"116"
:
"MES-3308F"
,
"120"
:
"MES-3348F"
,
"136"
:
"MES-5316A"
,
"190"
:
(
"MES-3324F"
,
"rev.B"
),
# rev.B
}
def
get_platform
(
self
,
s
):
return
self
.
PLATFORMS
.
get
(
s
)
platform
,
*
revision
=
self
.
PLATFORMS
.
get
(
s
)
return
platform
,
revision
[
0
]
if
revision
else
None
INTERFACE_TYPES
=
{
"as"
:
"physical"
,
# Async
...
...
sa/profiles/Eltex/MES24xx/get_fqdn.py
View file @
18adae30
...
...
@@ -22,10 +22,10 @@ class Script(BaseScript):
def
execute_cli
(
self
):
fqdn
=
""
v
=
self
.
scripts
.
get_config
(
)
v
=
self
.
cli
(
"show startup-config"
,
cached
=
True
)
match
=
self
.
rx_hostname
.
search
(
v
)
if
match
:
fqdn
=
match
.
group
(
"hostname"
)
fqdn
=
match
.
group
(
"hostname"
)
.
strip
(
'"'
)
match
=
self
.
rx_domain_name
.
search
(
v
)
if
match
:
fqdn
=
fqdn
+
"."
+
match
.
group
(
"domain"
)
...
...
sa/profiles/Generic/get_chassis_id.py
View file @
18adae30
...
...
@@ -35,6 +35,8 @@ class Script(BaseScript):
"00:01:02:03:04:00"
,
# Very Smart programmer
"00:01:02:03:04:05"
,
# Very Smart+ programmer
"00:02:03:04:05:06"
,
# Ubiquity Programmers
"00:AA:BB:CC:DD:13"
,
"06:00:00:00:00:80"
,
"FF:FF:FF:FF:FF:FF"
,
# Broadcast
}
...
...
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