1SNMP::Info::Layer1(3) User Contributed Perl DocumentationSNMP::Info::Layer1(3)
2
3
4
6 SNMP::Info::Layer1 - SNMP Interface to network devices serving Layer1
7 only.
8
10 Max Baker
11
13 # Let SNMP::Info determine the correct subclass for you.
14 my $l1 = new SNMP::Info(
15 AutoSpecify => 1,
16 Debug => 1,
17 DestHost => 'myswitch',
18 Community => 'public',
19 Version => 2
20 )
21 or die "Can't connect to DestHost.\n";
22
23 my $class = $l1->class();
24 print "SNMP::Info determined this device to fall under subclass : $class\n";
25
26 # Let's get some basic Port information
27 my $interfaces = $l1->interfaces();
28 my $i_up = $l1->i_up();
29 my $i_speed = $l1->i_speed();
30
31 foreach my $iid (keys %$interfaces) {
32 my $port = $interfaces->{$iid};
33 my $up = $i_up->{$iid};
34 my $speed = $i_speed->{$iid}
35 print "Port $port is $up. Port runs at $speed.\n";
36 }
37
39 This class is usually used as a superclass for more specific device
40 classes listed under SNMP::Info::Layer1::* Please read all docs under
41 SNMP::Info first.
42
43 Provides abstraction to the configuration information obtainable from a
44 Layer1 device through SNMP. Information is stored in a number of MIBs.
45
46 For speed or debugging purposes you can call the subclass directly, but
47 not after determining a more specific class using the method above.
48
49 my $l1 = new SNMP::Info::Layer1(...);
50
51 Inherited Classes
52 SNMP::Info
53
54 Required MIBs
55 SNMP-REPEATER-MIB
56
57 MIBs required for "REQUIREMENTS" in SNMP::Info
58
59 See "REQUIREMENTS" in SNMP::Info for its MIB requirements.
60
62 These are methods that return scalar value from SNMP
63
64 $l1->ports_managed()
65 Gets the number of ports under the interface mib
66
67 ("ifNumber")
68
69 Overrides
70 $l1->model()
71 Cross references $l1->id() with product IDs.
72
73 For HP devices, removes 'hpswitch' from the name
74
75 For Cisco devices, removes 'sysid' from the name
76
77 $l1->vendor()
78 Tries to discover the vendor from $l1->model() and $l1->vendor()
79
80 $l1->ports()
81 Adds the values from rptr_ports() and ports_managed()
82
83 $l1->slots()
84 Number of 'groups' in the Repeater MIB
85
86 ("rptrGroupCapacity")
87
88 Global Methods imported from SNMP::Info
89 See documentation in "USAGE" in SNMP::Info for details.
90
92 These are methods that return tables of information in the form of a
93 reference to a hash.
94
95 Overrides
96 $l1->interfaces()
97 Returns reference to the map between IID and physical Port.
98
99 $l1->i_up()
100 Returns reference to map of IIDs to link status.
101
102 $l1->i_up_admin()
103 Returns reference to map of IIDs to administrative link status.
104
105 Repeater MIB
106 $l1->rptr_ports()
107 Number of ports in each group.
108
109 ("rptrGroupPortCapacity")
110
111 $l1->rptr_port()
112 Port number in Group
113
114 ("rptrPortIndex")
115
116 $l1->rptr_slot()
117 Group (slot) Number for given port.
118
119 ("rptrPortGroupIndex")
120
121 $l1->rptr_up_admin()
122 ("rptrPortAdminStatus")
123
124 $l1->rptr_up()
125 ("rptrPortOperStatus")
126
127 $l1->rptr_last_src()
128 ("rptrAddrTrackNewLastSrcAddress")
129
130 Table Methods imported from SNMP::Info
131 See documentation in "USAGE" in SNMP::Info for details.
132
133
134
135perl v5.32.0 2020-07-28 SNMP::Info::Layer1(3)