资源描述:
《Andrew_Nelson》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SNMP,forthosetimesyoucan'tinstalltheZabbixagent.AndrewNelsonSeniorLinuxConsultantSep10,2015Zabconf2015,Riga,LatviaOverview●Introduction●WhatisSNMP●ExtendingtheNet-SNMPagent●MyfirstMIB●Asub-agentforyourMIB2/27REDHAT
2、AndrewNelson$whoami●AndrewNelson●anelson@redhat.com
3、●SeniorLinuxConsultantwithRedHatNorthAmerica●ActiveintheZabbixcommunityforapproximately10years●Knownas“nelsonab”inforumsandIRC●AuthoroftheZabbixAPIRubylibraryzbxapi3/27REDHAT
4、AndrewNelsonSNMPa“Simple”IntroductionTopics●SNMPOverview●OIDs●Units●Tables●UsingSNMPWithZab
5、bix●ExtendingSNMP5/27REDHAT
6、AndrewNelsonWhatisSNMP●SimpleNetworkMonitoringProtocol●Likeallstandards,it'snotsimple!●DefinedbynumerousRFCs●Usesahierarchicaldatamodel●EmploysanAgent–Managerdesign●Agentscanbenested●Isextensible6/27REDHAT
7、AndrewNelsonWhatisSNMP●SNMPusesO
8、IDstoidentifyeachitem●OIDsarenumericwithtexttranslationsprovidedbyMIBfiles.7/27REDHAT
9、AndrewNelsonUsingSNMPwithZabbixZabbixAndSNMP●Availablesinceversion1.1●Onerequestpernetworkconnectionbefore2.2.3●Dynamicindexlookupsavailablesinceversion1.5●Item[“index”,”baseitem”,
10、”row”]●ifInOctets["index","ifDescr","GigabitEthernet0/1"]9/27REDHAT
11、AndrewNelsonZabbixandSNMP●Configureaglobalmacrofor{$SNMP_COMMUNITY}thenoverridelocallyforeachhostasneeded.●Templatesmakeuseofthismacro●Someparametersrequiresome“massaging”beforetheyareuseful.●Disksp
12、aceisoftenintheformofNAllocationUnits,notbytes.●Calculatedvalue:alocation_units[disk]*free_space[disk]10/27REDHAT
13、AndrewNelsonZabbixandSNMP●Becausecalculateditemsareneededtimelinesmaybecomeveryskewed.●Freediskspaceischeckedevery10minutes●Spacecalculationisperformede
14、very10minutes●Graphedvaluecouldbetimeskwedby20minutes!●Zabbixneedstheabilityforinboundvaluecalculation.●Ifonlytherewereascriptinginterfaceforthis…..11/27REDHAT
15、AndrewNelsonZabbixandSNMP●Itispossibletoderivepercentutilizationfromaccumulatedtimeitems.●SettheitemtoDelt
16、apersecond●Convertthetimescaleto“centi-seconds”andstoreasafloatwithaunitof“%”.●Resultantvaluewillbeanapproximationofthepercentutilization.