-
Notifications
You must be signed in to change notification settings - Fork 390
/
main.py
36 lines (33 loc) · 1.07 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from opserver.plugins.alarm_base import *
from opserver.sandesh.alarmgen_ctrl.sandesh_alarm_base.ttypes import *
class BgpConnectivity(AlarmBase):
"""BGP peer mismatch.
Not enough BGP peers are up in BgpRouterState.num_up_bgp_peer"""
_RULES = {
'or_list': [
{
'and_list': [
{
'operand1': 'BgpRouterState.num_up_bgp_peer',
'operation': '==',
'operand2': {
'json_value': 'null'
}
}
]
},
{
'and_list': [
{
'operand1': 'BgpRouterState.num_up_bgp_peer',
'operation': '!=',
'operand2': {
'uve_attribute': 'BgpRouterState.num_bgp_peer'
}
}
]
}
]
}
def __init__(self):
AlarmBase.__init__(self, AlarmBase.ALARM_MAJOR)