-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpyconfig.py
52 lines (45 loc) · 1.64 KB
/
pyconfig.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# TABLE ROW DEFINITIONS
sysName_named_oid = [('SNMPv2-MIB', 'sysName', 0)]
interfaces_table_named_oid = [
('IF-MIB', 'ifDescr'),
('IF-MIB', 'ifType'),
('IF-MIB', 'ifMtu'),
('IF-MIB', 'ifSpeed'),
('IF-MIB', 'ifPhysAddress'),
('IF-MIB', 'ifAdminStatus'),
('IF-MIB', 'ifOperStatus'),
('IF-MIB', 'ifHCInOctets'),
('IF-MIB', 'ifHCOutOctets'),
('IF-MIB', 'ifHighSpeed')
]
lldp_table_named_oid = [
('LLDP-MIB', 'lldpRemSysName'),
('LLDP-MIB', 'lldpRemSysDesc'),
('LLDP-MIB', 'lldpRemPortId'),
('LLDP-MIB', 'lldpRemPortDesc')
]
lldp_local_port_name = [('LLDP-MIB', 'lldpLocPortId', 0)]
#######
#STATS
#######
MAX_STATS_RECORDS = 2016
#########################################################
# REGULAR EXPLRESSIONS FOR MATCHING PORT NAMES TO SPEEDS
# NOTE: This is used in visuzation later to color lines
#########################################################
LINK_SPEEDS = [("^TwentyGigE*", "20"),
("^FortyGig*", "40"),
("^Ten-GigabitEthernet*", "10"),
("^GigabitEthernet*", "1")]
#########################################################
# REGULAR EXPLRESSIONS FOR MATCHING DEVICES HIERARHY
# E.g. Access layer switches have "AC" in their name
# or aggregation layer devices have "AG" in their names
#########################################################
NODE_HIERARCHY = [
('^[a-zA-Z]{5}L2.*', "4", "L2.png"),
('^[a-zA-Z]{5}L3.*', "5", "L3.png"),
('^[a-zA-Z]{5}DS.*', "3", "DS.png"),
('^[a-zA-Z]{5}AC.*', "2", "AC.png")
]
IGNORED_IFTYPES = [ "l3ipvlan", "softwareLoopback", "other"]