老师桌面snmp55net5移植记录_第1页
老师桌面snmp55net5移植记录_第2页
老师桌面snmp55net5移植记录_第3页
老师桌面snmp55net5移植记录_第4页
老师桌面snmp55net5移植记录_第5页
已阅读5页,还剩14页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、在i686–pc-GNU/Linux平台下的选项配 Make 配置 Trap功能 trap的工作流 trap的环境配 2、在arm-linux下的配 配 编 修改/etc/profile文件,让自动启 启动snmpd程 (7)端(管理端)配 (8)端(管理端)启动d进 snmpv3功能,必须移植安装openssl,net-snmp附录 1、用 2、安 3、系统类 4、可选特 5、可选 6、编译选 7、杂 8、配置9、企业 10、Perl支 13、一些有重大的环境变 1i686pc-GNU/Linux --prefix=/usr/local/net-snmp--with-default-snmp-version="3"--with-sys-contact="who@where"--with-sys-location="location"--with-logfile="location" persistent-directory="/var/net-snmp"--with-mib-modules="smuxmibII/mta_sendmailucd-snmp/diskioexamples/notification"****mibII/interfacesmake出错Make安 执行snmpd–c/usr/local/net-snmp/share/snmp/snmpd.conf–Le会出错 会生成snmpd.conf/看来应该先创建用户,然后运行,让系统产生snmpd.conf在/var/net-snmp/ ,再执行snmpd–c/usr/local/net-snmp/share/snmp/snmpd.con&(开发板上待验证)trapTrap功能:trap命令方式:发送各种trap命令(manager地址后面一定要加端162),在manager端看反应结果,在agent端无反应自动触发:配置snmpd.conftraptrap,发送给managertrap需要写c语言程序,用相应的api(send_easy_trapsend_v2trap)配置d.conf文件,设置权mibmibs用perl等语言编写处理trap的程trap1manager加入以下一行munityexecute,log,netmunityexecute,log,net添加以下几行到d.conf中traphandle...1 page_meuptraphandle..4.1.2021.251.1 page_meuptraphandle..4.1.2021.251.2 page_medowntraphandle 用sudod-d-f-Lo启动PS:如果d启动不起来是因为在安装net-snmp的时候有些模块没有安装上,./configure--with-mib-modules="examples/notification"sudomaketrap相关的模块。agent端输入:-v2ccpublic33:162UCD-SNMP-MIB::ucdStartanager端反应:Received73bytesfromUDP:0000:30470201040675626C63A73A 0016:04428AEC02010201002C3010 0032:082B06020101004304888697 0048:18060A06010601010400060A 064:060104 8F6581 2008-11-1110:16:12localhost[UDP:DISMAN-EVENT-MIB::sysUpTimeInstance=Timeticks:( )1day,0:51:13.51SNMPv2-MIB::OID.0=OID:UCD-SNMP-MIB::ucdStartsh:page_me:commandnot说明收到trapucdstart并且调用对应的程序,这里由于系统没有page_me这个命令,所(参考mibsnmp1snmp2trapSnmp1mib:TRAP-TEST-MIB.txt:IMPORTSucdExperimentalFROMUCD-SNMP-MIB;demotrapsOBJECTIDENTIFIER::={ucdExperimental990STATUScurrentENTERPRISEdemotrapsVARIABLES{sysLocation}DESCRIPTION"Thisisjusta::=Snmp2mib:NOTIFICATION-TEST-MIB.txt:demonotifsOBJECTIDENTIFIER::={ucdavis991}demo-notifNOTIFICATION-TYPESTATUScurrentOBJECTS{sysLocation}DESCRIPTION"Justatest::={demonotifs17mibs文件夹中manager端敲入命令:MIB::sysLocation.0sjusthere"agent端输出:Received96bytesfromUDP:0000:305E02 010406 75626C 63A751 0016:047DBA AA0201 020100 433010 0032:082B06020101004304891929 0048:18060A06010601010400060A 0064:0601048F6587113015082B060080:020101000409757374686572 just2008-11-1110:22:27localhost[UDP: )1day, SNMPv2-MIB::sysLocation.0=STRING:justheresh:log_it:commandnotfoundjusthere就是我们想要的结果4.让agent自动产生配置agent的snmpd.conf,加入以下几行:(参考##sendv1 #alsosendv2traps informsinkd-d-f-2arm-linux./configure--host=arm-linux--build=i386-linux--prefix=/usr/local/net-snmp--disablewith-endianness=little--enable-mini-agent--with-openssl=/usr/OpenSSL--with-mib-modules="smuxmibII/mta_sendmailexamples/notification"//前边部分可以通过配置和变*Initialization*:1:warning:thisisthelocationoftheprevious*Initialization*:1:warning:`linux'MakeinstallagentAddresscreateUserwxpMD5" "DESrwuserwxp munitypublic -Vsystemonly #Remembertoactivatethe'createUser'linesabove SittingontheDockoftheBay Me<me@> #From:#sendv1traps #alsosendv2traps informsinkmibdirsusr/local/net-snmp/share/snmp/mibs(5)修改/etc/profile文件,让自动启动 -c-Le/var/net-snmp/snmpd.conf#snmpd.confrm-rf/usr/local/net- snmpd-c-Le/usr/local/net-snmp/share/snmp/snmpd.conf& -Dread_config&#d-d-f-Lo(6)启动snmpd程(7)端(管理端)配munitylog,execute,nettraphandle...1 page_meuptraphandle..4.1.2021.251.1 page_meuptraphandle..4.1.2021.251.2 page_medowntraphandledefault (8)端(管理端)启动d进d-d-f-Lo此时会发现端每30秒会出现端发过来的信Received64bytesfromUDP:[34]:1026-0000:303E0200040675626C63A431 0016:092B060401BF020340AC170D0032:020106010143010DCF133011 0048:0C2B060401BF0203020002012010-08-1801:25:3334(viaUDP:[34]:1026-TRAP,SNMPv1,communityTrap(NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification)Uptime:NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatRate.0=sh:log_it:commandnot说理和trap配置成snmpwalk-v3-lauthPriv-uwxp-aMD5- -xDES- [root@localhostusr]#snmpwalk-v3-lauthPriv-uwxp-aMD5-A -xDES-X34systemSNMPv2-MIB::sysDescr.0=STRING:Linuxwangxpin2.4.20_elfin-d1.5#1SunAug801:19:08CST2010armv4lSNMPv2-MIB::sysObjectID.0=OID:SNMPv2-DISMAN-EVENT-MIB::sysUpTimeInstance=Timeticks:(76199)0:12:41.99SNMPv2-MIB::sysContact.0=STRING:Me<me@>SNMPv2-MIB::sysName.0=STRING:SNMPv2-MIB::sysLocation.0=STRING:SittingontheDockoftheBaySNMPv2-MIB::sysServices.0=INTEGER:72SNMPv2-MIB::sysORLastChange.0=Timeticks:(62)0:00:00.62SNMPv2-MIB::sysORID.1=OID:SNMPv2-MIB::snmpMIBSNMPv2-MIB::sysORID.2=OID:SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroupSNMPv2-MIB::sysORID.3=OID:SNMP-MPD-MIB::snmpMPDMIBObjects.3.1.1SNMPv2-MIB::sysORID.4=OID:SNMP-USER-BASED SNMPv2-MIB::sysORDescr.1=STRING:TheMIBmoduleforSNMPv2entitiesSNMPv2-MIB::sysORDescr.2=STRING:View-basedAccessControlModelforSNMP.SNMPv2-MIB::sysORDescr.3=STRING:TheMIBforMessageProcessingandDispatching.SNMPv2-MIB::sysORDescr.4=STRING:TheMIBforMessageProcessingandDispatching.SNMPv2-MIB::sysORDescr.5=STRING:TheSNMPManagementArchitectureMIB.SNMPv2-MIB::sysORUpTime.1=Timeticks:(62)0:00:00.62snmpv3功能,必须移植安装openssl,net-./configure--host=arm- examples/notification"1:1Usage:./configure[OPTION]...(比如.,CC,CFLAGS...),VAR=VALUE来指定,下面描述可用的环配置-h, disyoptionsspecifictothis disytheshorthelpofalltheincluded disyversioninformationand-q,--quiet,-- donotprint`checking...' cachetestresultsinFILE-C,--config- aliasfor`--cache--n,--no- donotcreateoutput findthesourcesinDIR[configurediror2、安 安装平立文件到指定 默认状态下,`makeinstall'命令会安装所有文件到`/usr/local/bin',`/usr/local/lib'等 你可以用前缀--prefix指定其他安装 -- userexecutables-- systemadminexecutables-- programexecutables-- read-onlysingle-machinedata-- modifiablearchitecture-independentdata -- modifiablesingle-machinedata-- objectcodelibraries-- Cheaderfiles-- Cheaderfilesfornon-gcc-- read-onlyarch.-independentdataroot-- read-onlyarchitecture-independentdata-- ation-- locale-dependentdata-- manation-- -- htmlation-- ation-- pdfation-- psation3、系统类型-- -- -- configureforbuildingcompilersforTARGET4、可选特性 忽略不能识别的--enable/--with FEATURE--enable- FEATURE libperl而非Net-SNMPlibraries.仅用于其他方式 --silent 不编译进程 (snmpget 不安装(mib2c, Mib mib任何都会导致配置终止 CompileinnewMIBmodulesandotherfeatureswhichareduetobeincludedinfuture CompileinoldMIBmodulesandotherfeatureswhichwererecedinthedefaultbuildofthisrelease. patibilityInstallucd-snmplook-alikeheadersand Donotincludecodethatparsesmanipulatesthemib DonotsupportDES Don'tcompileinsupportforprivacy DonotsupportMD5 UsetheinternalMD5 GenerateIPv6ready Donotincludecodethatimplements Donotincludecodethatimplements Outputsextradebugginginformationatall Normally,youshouldnotenablethis,butinsteadusethe-Dflagofthecommands,whichtogglesdebugingoutputat DisallowsdebuggingcodetobebuiltThismightprovidesomespeed Turnsonsup whenusinggcc. EnablessomecodesectionsthatonlybeusedfortestingofSNMPfunctionalities. Thisshould*not*beturnedonforproductionuse. Enableslockingfunctionsthatlibraryresourcesinsomemulti-threading Thisdoesnotguaranteethread-safeoperation.Currentlyanexperimental Don'tcompileindeprecated DonotallowSNMPset RestrictSMUXconnectionstolocalhost(by DisableUDP/TCPtransportsfor--disable-d- Disableagentxsubagentcodein Buildaminimal UsenewMFDrewritesofmibwhereavailable.(defaultistouseoriginalmibmodulecode). DisableembeddedPerlintheSNMPagentd.enabledby DisableconfigurechecksforwhetherCCompileriscompatiblewithourswhenembeddedPerlisenabled. buildsharedlibraries buildstaticlibrariesoptimizeforfastinstallation avoidlocking(mightbreakparallel5、可选包 donotusePACKAGE(sameas--with-6 useCCtocompile useCCtolink useARasthe defineendiannessoftargettform useCFLAGSascompiletime useLDFLAGSaslinktimeargumentsto useLIBSaslinktimeargumentsto Usedmalloclibrary Lookforanduselibefence Lookforlibrsarefin Lookforopensslin Lookforpkcs11in Lookforkrb5in Don'tincludesupportfortheRPMpackagemanagementsystemwhenbuildingthehostMIB Justforinstalling,prefixdirectorieswithPATH. Thisisknownnottoworkonsomesystemswithsharedlibraries(eg,HPUX)CompileinMIBmodulesandotherfeaturesasifthiswasrelease"version"(defaultis5.5).7、杂项 Usedefaultsforprompted Defaultdirectoriestolookfor(Default: DefaultmibIDsto(Thedefaultlistis"IP-MIB:IF-withtheadditionofanymibsusedbythemibmodulestheagentisconfiguredwith)--with-mibfiles="file1:file2"Defaultmibfilesto usesIDsabove Don'tusespecialopaqueSNMPnormallycannothandlefloatingnumbers,norlarge64bitintegerswell. Bydefault,thenet-snmppackagecompilesinsupportfortheseextradatatypes(inalegalway) DefaultlogfilelocationforDefaultdirectoryforpersistentdata Defaultmaskforpersistentdata(Default:(oruse"yes"tocopythem).(Default:yes) --with-default-snmp-version="3"DefaultversionofSNMPto(Default:Legalvalues:1,2(forSNMPv2c)or--with-transports="t1t2 CompileinthegivenSNMPmodules(spaceorcommaseparated ExcludelistedSNMP(spaceorcommaseparated supportforSNMPoverUDP/IP.Thistransportisalwayscompiledin. supportforSNMPoverThistransportisavailableforLinux,SolarisandBSDatleast.ThistransportiscompiledinbydefaultifIPv6supportis supportforSNMPoverThistransportisavailableforLinux,SolarisandBSDatleast.ThistransportiscompiledinbydefaultifIPv6supportis supportforSNMPoverThistransportiscompiledinbydefault,butmaybe supportforSNMPoverUnixThistransportiscompiledinbydefaultexceptonWin32tforms,andmaybeomitted. supportforSNMPoveraninternallocallyconnectedpairofsnmp_sessions. Thealiastransportsimplyletsyoudefinemorecomplextransportstringsandaliasthemtosimplenamesinthesnmp.conf supportforSNMPoverAAL5ThistransportispresentlyonlyavailableforLinux,isnevercompiledinbydefaultandmaybeomitted. supportforSNMPoverIPXperRFCThistransportispresentlyonlyavailableforLinux,isnevercompiledinbydefaultandmaybeomitted. (alpha)supportfortunnelingSNMPover (alpha)supportfortunnelingSNMPover CompileinthegivenSNMPmoduleservices(spaceseparated supportforuserbasedSNMPsecurity(requiredandalwayscompiledin) supportforkerberosbasedSNMP supportfortheTransport-based(forusewiththeSSHandDTLSUDP8、配置 Thesnmpdagentwon'trequirerootaccessrunit. Theinformationitreturnsinthemib-IItreemaynotbecorrect, Donotincludeanycoderelatedtotheof Provide'ceholder'dummyvalueswherethenecessaryinformationisnotavailable.ThisistechnicallynotcompliantwiththeSNMPspecifications,butwashowtheagentoperatedforversions<4.0. Defaultsystem(Default:LOGIN@ Defaultsystem(Default: AgentXsocket(Default:/var/agentx/masterasspecifiedinRFC2741) Compilewithadditionalmib(Spaceseparated Compilewithoutthesemibmodules.Defaultmibmodulescompiledintotheagent(whichcanberemoved): supportforthemib-II supportforthesnmpv3mib AgentXsupport(see mibssupportingspecificationoftrapdestinations. SupportfortheSNMPWGsTARGET-MIB. generalagentconfiguration supportfortheDISMAN-EVENT-MIB(supportsselfmonitoringandnotificationdeliverywhenerrorconditionsare supportfortheDISMAN-SCHEDULE-(triggerSETrequestsatspecified hostresourcesmib(onlyonmajorsupported编译进AgentMib可选模组 smuxsupporttoallowsubagentstoattachtosnmpd. Sendmailstatisticsmonitoring(MTA-MIB) Tableofio-devicesandhowmuchdatathey (onlytestedonSolaris,Linux) previousimplementationoftheDISMAN-EVENT-MIBOptionalmodulesforspecifictforms hardwaremonitoring(LM-SENSORS-MIB) LinuxTUNNEL-MIBsupport(ifTableextension) (oldifTableimplementation) accountingrulesIPfirewallinformation firewallchainsunderipfw(See supportfortheSCTP-MIB supportfortheEtherLike-MIB hardwaremonitoring(LM-SENSORS-MIB)if- IF-MIBrewrite(add--enable-mfd-rewrites) TCP-MIBrewrite(tcpConnectionTableandtcpListenerTable;add--enable-mfd-rewrites) UDP-MIBrewrite(udpEndpointTable;add--enable-mfd-rewrites)if- IF-MIBrewrite(add--enable-mfd-AgentX allowstheagenttorunaseitherasnmporasanagentXsub- makestheagentrunasanagentXmasteraswellasanormalsnmp includesbothagentx/masterandagentx/OptionalmodulesforCcoderstolookatand/orincludeasextension SNMPv3interoperabilitytestingmib. exampleCcodeextension.9、企业(warning:thisshouldbeusedwith TheenterprisenumberassignedtothevendorbyIANA. togetone,thoughusingthedefaultisprobablytherightchoiceismostcases.(default8072="-s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论