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
arthur-zzz
noc
Commits
1a283661
Commit
1a283661
authored
Nov 19, 2021
by
Dmitry Lukhtionov
Browse files
Merge branch 'add_metrics_Alcatel.7302' into 'master'
add metrics Alcatel.7302 See merge request
noc/noc!5879
parents
8157192a
e63ec7c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Alcatel/7302/oidrules/slot.py
View file @
1a283661
# ---------------------------------------------------------------------
# Alcatel.7302.SlotRule
# ---------------------------------------------------------------------
# Copyright (C) 2007-201
9
The NOC Project
# Copyright (C) 2007-20
2
1 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
...
...
@@ -11,53 +11,70 @@ from noc.core.mib import mib
class
SlotRule
(
OIDRule
):
name
=
"slot"
def
iter_oids
(
self
,
script
,
metric
):
i
=
4353
# 4353 - nt-a slot num
# >4355 - lt-s slot
# chassis, slot, module, name
r
=
{}
if
script
.
has_capability
(
"S
tack
| Member Ids"
):
if
script
.
has_capability
(
"S
lot
| Member Ids"
):
sys_slot_index
=
[
0
]
+
[
int
(
index
)
for
index
in
script
.
capabilities
[
"S
tack
| Member Ids"
].
split
(
" | "
)
int
(
index
)
for
index
in
script
.
capabilities
[
"S
lot
| Member Ids"
].
split
(
" | "
)
]
elif
script
.
has_capability
(
"S
tack
| Members"
):
sys_slot_index
=
list
(
range
(
0
,
script
.
capabilities
[
"S
tack
| Members"
]
+
1
))
elif
script
.
has_capability
(
"S
lot
| Members"
):
sys_slot_index
=
list
(
range
(
0
,
script
.
capabilities
[
"S
lot
| Members"
]
+
1
))
else
:
sys_slot_index
=
[
0
]
for
ms
in
sys_slot_index
:
if
ms
in
[
0
]:
# nt-a card - 3 sensors
for
s_i
in
range
(
1
,
5
):
# r["nt-a_s%d" % s_i] = "%d.%d" % (ms, s_i)
if
"Temperature"
in
metric
.
metric
:
for
s_i
in
range
(
1
,
5
):
# r["nt-a_s%d" % s_i] = "%d.%d" % (ms, s_i)
r
[
(
"noc::chassis::1"
,
"noc::slot::0"
,
f
"noc::module::
{
s_i
}
"
,
f
"noc::sensor::Temperature_nt-a_s
{
s_i
}
"
,
)
]
=
"%d.%d"
%
(
i
,
s_i
)
else
:
r
[
(
"noc::chassis::1"
,
"noc::slot::1"
,
"noc::module::0"
,
f
"noc::sensor::Temperature_nt-a_s
{
s_i
}
"
,
"noc::slot::0"
,
"noc::sensor::State_nt-a_s"
,
)
]
=
"%d.%d"
%
(
ms
,
s_
i
)
]
=
str
(
i
)
continue
# r[str(i)] = {"healthModuleSlot": ms}
for
s_i
in
range
(
1
,
3
):
# Two sensors on cards
# r["lt:1/1/%d_s%d" % (ms, s_i)] = "%d.%d" % (i + ms - 2 if ms not in [2, 3] else i + 8 + ms, s_i)
if
"Temperature"
in
metric
.
metric
:
for
s_i
in
range
(
1
,
3
):
# Two sensors on cards
# r["lt:1/1/%d_s%d" % (ms, s_i)] = "%d.%d" % (i + ms - 2 if ms not in [2, 3] else i + 8 + ms, s_i)
r
[
(
"noc::chassis::1"
,
f
"noc::slot::
{
ms
}
"
,
f
"noc::module::
{
s_i
}
"
,
f
"noc::sensor::Temperature_lt_s
{
ms
,
s_i
}
"
,
)
]
=
"%d.%d"
%
(
i
+
ms
+
1
,
s_i
,
)
else
:
r
[
(
"noc::chassis::1"
,
"noc::slot::1"
,
f
"noc::module::
{
str
(
ms
)
}
"
,
f
"noc::sensor::Temperature_lt_s
{
s_i
,
}
"
,
f
"noc::slot::
{
ms
}
"
,
f
"noc::sensor::State_lt_s
{
ms
}
"
,
)
]
=
"%d.%d"
%
(
i
+
ms
-
2
if
ms
not
in
[
2
,
3
]
else
i
+
8
+
ms
,
s_i
,
)
]
=
str
(
i
+
ms
+
1
)
for
i
in
r
:
if
self
.
is_complex
:
gen
=
[
mib
[
self
.
expand
(
o
,
{
"hwSlotIndex"
:
r
[
i
]})]
for
o
in
self
.
oid
]
...
...
sa/profiles/Alcatel/7302/snmp_metrics/environment_restart.json
0 → 100644
View file @
1a283661
{
"$metric"
:
"Environment | Board | Restart"
,
"$type"
:
"slot"
,
"oid"
:
"1.3.6.1.4.1.637.61.1.23.3.1.26.{{ hwSlotIndex }}"
}
sa/profiles/Alcatel/7302/snmp_metrics/environment_status.json
0 → 100644
View file @
1a283661
{
"$metric"
:
"Environment | Sensor Status"
,
"$type"
:
"slot"
,
"oid"
:
"1.3.6.1.4.1.637.61.1.23.3.1.6.{{ hwSlotIndex }}"
}
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