1SNMP::Info::Layer1(3) User Contributed Perl DocumentationSNMP::Info::Layer1(3)
2
3
4

NAME

6       SNMP::Info::Layer1 - SNMP Interface to network devices serving Layer1
7       only.
8

AUTHOR

10       Max Baker
11

SYNOPSIS

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     => 1
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

DESCRIPTION

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 "Required MIBs" in SNMP::Info
58
59       See "Required MIBs" in SNMP::Info for its MIB requirements.
60
61       SNMP-REPEATER-MIB needs to be extracted from
62       ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
63

GLOBALS

65       These are methods that return scalar value from SNMP
66
67       $l1->ports_managed()
68           Gets the number of ports under the interface mib
69
70           ("ifNumber")
71
72   Overrides
73       $l1->model()
74           Cross references $l1->id() with product IDs.
75
76           For HP devices, removes 'hpswitch' from the name
77
78           For Cisco devices, removes 'sysid' from the name
79
80       $l1->vendor()
81           Tries to discover the vendor from $l1->model() and $l1->vendor()
82
83       $l1->ports()
84           Adds the values from rptr_ports() and ports_managed()
85
86       $l1->slots()
87           Number of 'groups' in the Repeater MIB
88
89           ("rptrGroupCapacity")
90
91   Global Methods imported from SNMP::Info
92       See documentation in "GLOBALS" in SNMP::Info for details.
93

TABLE METHODS

95       These are methods that return tables of information in the form of a
96       reference to a hash.
97
98   Overrides
99       $l1->interfaces()
100           Returns reference to the map between IID and physical Port.
101
102       $l1->i_up()
103           Returns reference to map of IIDs to link status.
104
105       $l1->i_up_admin()
106           Returns reference to map of IIDs to administrative link status.
107
108   Repeater MIB
109       $l1->rptr_ports()
110           Number of ports in each group.
111
112           ("rptrGroupPortCapacity")
113
114       $l1->rptr_port()
115           Port number in Group
116
117           ("rptrPortIndex")
118
119       $l1->rptr_slot()
120           Group (slot) Number for given port.
121
122           ("rptrPortGroupIndex")
123
124       $l1->rptr_up_admin()
125           ("rptrPortAdminStatus")
126
127       $l1->rptr_up()
128           ("rptrPortOperStatus")
129
130       $l1->rptr_last_src()
131           ("rptrAddrTrackNewLastSrcAddress")
132
133   Table Methods imported from SNMP::Info
134       See documentation in "TABLE METHODS" in SNMP::Info for details.
135
136
137
138perl v5.28.1                      2019-04-04             SNMP::Info::Layer1(3)
Impressum