Вы находитесь на странице: 1из 6

20- SNMP - Perl

" Perl, ".


, , Perl.
" Perl" .
,
.
(SNMP) . ,
12, SNMP, ( ). , ,
, SNMP 1.
SNMP , SNMP,
. , , ,
. SNMP Perl 12, SNMP, , ,
, SNMP- .
1 SNMP. (SNMPv1, SNMPsec, SNMPv2p,
SNMPv2c, SNMPv2u, SNMPv2*, SNMPv3); 1 , ,
3 , 3 .
Perl SNMP . Perl . - -
Perl. SNMP . SNMP
: , , ( ) . , Perl,
SNMP ( ).
.
Perl SNMP . Perl , ,
, . SNMP . SNMP
, (management information base - MIB).
. MIB ( MIB-II)
( ), SNMP.
MIB ; MIB
. , ,
, . , ,
MIB SNMP, . , ,
.
G.1, " sysDescr(1) MIB" MIB.
G.1. sysDescr(1) MIB

: iso(1), ccitt(2), joint-iso-ccitt(3). iso(1) , org(3)


. dod(6), . internet(1) - .
. internet(1) ,
G.1, " internet(1)"
G.1. internet(1)

directory(1)

OSI

mgmt(2)

RFC

experimental(3)

private(4)

security(5)

snmpV2(6)

SNMP

SNMP , mgmt(2). ,
mgmt(2), MIB ( ). MIB,
, mgmt(2), - mib-2(1).
MIB . , ,
, .
system(1)
interfaces(2)
at(3)
ip(4)
icmp(5)
tcp(6)
udp(7)
egp(8)
cmot(9)
transmission(10)
snmp(11)
, SNMP "system description", system(1) - .
, sysDescr(1). , .
? ,
(OID) sysDescr(1), , , ,
.
OID , 1.3.6.1, OID - 1.3.6.1.2.1.1, OID sysDescr - 1.3.6.1.2.1.1.1.
OID ,
. , OID .0, ( ,
) .
, SNMP . , ,
Net-SNMP. - SNMP 1 3.
, Perl , ,
SNMP , . ,
SNMP, Perl .
Net-SNMP OID (.),
OID/ . , ,
solarisbox ( ,
; ):
$ snmpget -v 1 -c public solarisbox .1.3.6.1.2.1.1.1.0
$ snmpget -v 1 -c public solarisbox \
.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0
:
system.sysDescr.0 = Sun SNMP Agent, Ultra-1
. , P SNMP (Protocol). SNMP
. " " ("protocol data units") (PDU) .
PDU, , , Perl: [148]
get-request
get-request " " PDU: SNMP
SNMP .
get-next-request
get-next-request get-request, , MIB,
(" " RFC). ,
, , getnext-request ARP .
.
get-bulk-request
get-bulk-request SNMPv2/v3, .
PDU, . get-bulk
.
( ).
set-request
set-request , : SNMP.
SNMP- .
trap/snmpV2-trap
trap ("") SNMPv1, snmpV2-trap SNMPv2/3. "" SNMP-
(, , )
. "" , ,
.
inform-request
inform-request PDU SNMPv2/3. ""
. ( "" ,
. .)
response
response , . get-request,
set-request, .
, SNMP , Perl
SNMP. , , , , .
SNMP, : " ?
, , , - ; , ?" ,

SNMP , . SNMP ,
. RFC - SNMP-
. "reboot-request" (" ") , ,
- SNMP, .
set-request, .
, , ,
SNMP ? . , SNMP
("Simple Network Management Protocol") "Security Not My Problem" (" "), SNMPv1
. , ", , ?" ,
, .
SNMPv1 SNMPv2c , , SNMP . SNMP , , , ,
. , , .
, . - " ?".
" ?". RFC 1157 MIB,
, SNMP MIB. , SNMP- [149] SNMP
, SNMP- .
MIB : read-only, read-write none ( , ).
SNMP. SNMP MIB SNMP ,
SNMP, , MIB, .
"" "", SNMP, ,
-.
? , -
, , .
public () private () , . ,
Cisco :
! set the read-only community name to MyPublicCommunityName
snmp-server community MyPublicCommunityName RO
! set the read-write community name to MyPrivateCommunityName
snmp-server community MyPrivateCommunityName RW
Solaris /etc/snmp/conf/snmpd.conf:
read-community MyPublicCommunityName
write-community MyPrivateCommunityName
SNMP MyPublicCommunityName
MyPrivateCommunityName ,
/. , - SNMP .
. , SNMPv1, ,
" ".
SNMP, , v3 - . RFC 3414 3415 User Security Model
( ) (USM) View-Based Access Control Model ( ) (VACM): USM
, VACM
MIB. , , ,
RFC, SNMPv3 .
SNMPv3, Net-SNMP. USM VACM ,
, , SNMP
NuDesign Technologies (http://www.ndt-inc.com/SNMP/HelpFiles/v3ConfigTutorial/v3ConfigTutorial.html).
SNMP
.

.
.
, , , ,
.
SNMP - Simple Network Management Protocol. ,
UNIX,
. - -
. ,
, -
, .
, , - ( MIB - Management Information Base ). MIB
, . ,
, , , ..
, , MIB - ,
. , -
MIB. SNMP
MIB. :
get-request MIB
get-nextrequest

.
.
get-request get-next-request

set-request


MIB

getresponse

get-request, get-next-request setrequest

trap

cold warm restart


"" link'.

, , MIB,
, .
SNMP , .
, , - ,
MIB, .
, ,
. ,
, MIB .
MIB ? MIB ,
1.

.
root. , , system
3 sysUpTime. , : iso(1).org(3).dod(6).internet(1).mgmt(2).mib2(1).system(1).sysUpTime(3); : 1.3.6.1.2.1.1.3. , .
MIB, mgmt, .
"" MIB.
, . MIB,
experimental.
private-enterprises. , ,
.
, , .
.
, ? , SNMP ,
, . SNMP , ..
, ,
MIB, .
, - , SNMP.
,
Ethernet, EGP. Sun NetManager Sun Microsystems,
Solaris, SNMPc Castle Rock Computing, Windows.
MIB - . ,
MIB , cisco, ,
. , , cisco, ( login root)
on-line . SNMP
MIB.
MIB. flash-,
NVRAM, TFTP .
SNMP ,
. , . , ,
, Ethernet, TDR (Time-domain reflectometry),
. , TDR
ifExtnsTestTyp (1.3.6.1.2.1.12.2.1.4), , , TDR
MIB: 1.3.6.1.2.1.10.7.6.1. , -, ifExtnsTestResult (1.3.6.1.2.1.12.2.1.5),
:
1.
2.
3.
4.
5.
6.
7.
-, ifExtnsTestCode (1.3.6.1.2.1.12.2.1.6) MIB,
. 100-
. , .
,
MIB.

, SNMP
, MIB ,
SNMP.
SNMP (Simple Network Management Protocol, ) - 7 OSI,
. SNMP
, , . SNMP
, ,
, DView.
SNMP :
SNMP IP.

.
.

DES-3226S , "", SNMP-, ,


, ( ). SNMP-
UDP/IP .
SNMP 1,2 3
DES-3226S SNMP 3, 1 2. SNMP v.3 SNMP v.1 SNMP v.2 , SNMP v.3
, .
SNMP v.1 SNMP v.2 " " - Community String,
. SNMP SNMP Community Strings. SNMP
, , ().
SNMP v.3 , .
, SNMP. ,
SNMP.
.
SNMP. , SNMP, ,
, traps, SNMP v.1,
, /, SNMP v.3.
SNMP v.3 SNMP-
SNMP-. Object Identifier
(OID), MIB.
, SNMP v.3 , SNMP- (
HMAC-SHA-96 HMAC-MDA-96).
Traps
Traps - , .
(- ), .
traps .
traps ,
. traps
.
, traps . IP-
. SNMP, .
IP- traps SNMP ommunity strings.
traps, :
Cold Start , ,
, . ""
, ,
.
Warm Start , ( ),
(Power-On Self-Test - POST) .
Authentication Failure , - , "
" SNMP - Community string. IP- .
Topology Change Topology Change ( ) ,
Learning Forwarding, Forwarding Blocking. trap
, new root trap.
Link Change Event , link up link down link down
link up.
Port Partition , partition ( )
32 10 / 64
100 /.
Broadcast\Multicast Storm ,
/ . ( ), .
.
128 / , .
MIB (Management Information Base -MIB).
MIB-II. , MIB
, SNMP. MIB-II,
MIB . MIB
OID MIB (Object Identifier, MIB). MIB
(read-only), (read-write).
read-only MIB , , ,
. read-only . read-only
, ,
.

read-write MIB , . , IP- ,


Spanning Tree Algorithm, .
SNMP , ,
MIB . MIB, MIB
( MIB ). , MIB
, OID MIB .

Оценить