使用mrtg监控Squid非常全.docx

上传人:b****8 文档编号:12582746 上传时间:2023-06-06 格式:DOCX 页数:17 大小:22.88KB
下载 相关 举报
使用mrtg监控Squid非常全.docx_第1页
第1页 / 共17页
使用mrtg监控Squid非常全.docx_第2页
第2页 / 共17页
使用mrtg监控Squid非常全.docx_第3页
第3页 / 共17页
使用mrtg监控Squid非常全.docx_第4页
第4页 / 共17页
使用mrtg监控Squid非常全.docx_第5页
第5页 / 共17页
使用mrtg监控Squid非常全.docx_第6页
第6页 / 共17页
使用mrtg监控Squid非常全.docx_第7页
第7页 / 共17页
使用mrtg监控Squid非常全.docx_第8页
第8页 / 共17页
使用mrtg监控Squid非常全.docx_第9页
第9页 / 共17页
使用mrtg监控Squid非常全.docx_第10页
第10页 / 共17页
使用mrtg监控Squid非常全.docx_第11页
第11页 / 共17页
使用mrtg监控Squid非常全.docx_第12页
第12页 / 共17页
使用mrtg监控Squid非常全.docx_第13页
第13页 / 共17页
使用mrtg监控Squid非常全.docx_第14页
第14页 / 共17页
使用mrtg监控Squid非常全.docx_第15页
第15页 / 共17页
使用mrtg监控Squid非常全.docx_第16页
第16页 / 共17页
使用mrtg监控Squid非常全.docx_第17页
第17页 / 共17页
亲,该文档总共17页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

使用mrtg监控Squid非常全.docx

《使用mrtg监控Squid非常全.docx》由会员分享,可在线阅读,更多相关《使用mrtg监控Squid非常全.docx(17页珍藏版)》请在冰点文库上搜索。

使用mrtg监控Squid非常全.docx

使用mrtg监控Squid非常全

使用mrtg监控Squid

(一)

2009/03/0615:

09

MRTG是一个强大的网络流量监控工具,我试图使用MRTG监控Squid,并成功。

将配置文件

列出让大家参考:

输出结果:

配置文件:

mrtg.cfg

######################################################################

#MultiRouterTrafficGrapher--squidConfigurationFile

######################################################################

#Thisfileisforusewithmrtg-2.0

#

#CustomizedformonitoringSquidCache

#by

#

#-changeWorkDirandLoadMIBssettings

#-changeall"hostname"occurrencestoyoursquidhost

#-changeall"chris"occurrencestoyourname/address

#-changethecommunitystringsifrequired(eg:

"public")

#-changethesnmpportifrequired(eg:

3401)

#

#Note:

#

#*Keywordsmuststartatthebeginofaline.

#

#*Lineswhichfollowakeywordlinewhichdostart

#  withablankareappendedtothekeywordline

#

#*EmptyLinesareignored

#

#*Linesstartingwitha#signarecomments.

#####################

#GlobalConfiguration

#####################

#Whereshouldthelogfiles,andwebpagesbecreated?

WorkDir:

/opt/mrtg/squid

#--------------------------

#OptionalGlobalParameters

#--------------------------

#Howmanysecondsapartshouldthebrowser(Netscape)be

#instructedtoreloadthepage?

Ifthisisnotdefined,the

#defaultis300seconds(5minutes).

#Refresh:

600

#Howoftendoyoucallmrtg?

Thedefaultis5minutes.If

#youcallitlessoften,youshouldspecifyithere.This

#doestwothings:

#a)thegeneratedHTMLpagedoescontaintheright

#   informationaboutthecallinginterval...

#b)aMETAheaderinthegeneratedHTMLpagewillinstruct

#   cachesaboutthetimetoliveofthispage.....

#Inthisexamplewetellmrtgthatwewillbecallingit

#every10minutes.Ifyouarecallingmrtgevery5

#minutes,youcanleavethislinecommentedout.

#Interval:

10

#Withthisswitchmrtgwillgenerate.metafilesforCERN

#andApacheserverswhichcontainExpirationtagsforthe

#htmlandgiffiles.The*.metafileswillbecreatedin

#thesamedirectoryastheotherfiles,soyoumighthave

#toset"MetaDir."inyoursrm.conffileforthistowork

#

#NOTE:

IfyouarerunningApache-1.2youcanusethemod_expire

#toachievethesameeffect...seethefilehtaccess-dist

WriteExpires:

Yes

#Ifyouwanttokeepthemrtgiconsinsomeplaceotherthanthe

#workingdirectory,usetheIconDirvaribaletogiveitsurl.

#IconDir:

/mrtgicons/

IconDir:

/images/

LoadMIBs:

/opt/mrtg/squid/mib.txt

##################################################

#ConfigurationforeachTargetyouwanttomonitor

##################################################

#Theconfigurationkeywords"Target"mustbefollowedbya

#uniquename.Thiswillalsobethenameusedforthe

#webpages,logfilesandgifscreatedforthattarget.

#Notethatthe"Target"sectionscanbeauto-generatedwith

#thecfgmakertool.Checkreadme.htmlforinstructions.

#    ========

##

##Target----------------------------------------

##

#Withthe"Target"keywordyoutellmrtgwhatitshould

#monitor.The"Target"keywordtakesargumentsinawide

#rangeofformats:

#*Themostbasicformatis"port:

community@router"

#  Thiswillgenerateatrafficgraphforport'port'

#  oftherouter'router'anditwillusethecommunity

#  'community'forthesnmpquery.

#Target[ezwf]:

2:

public@wellfleet-fddi.ethz.ch

#*Sometimesyouaresittingonthewrongsideofthe

#  link.AndyouwouldliketohavemrtgreportIncoming

#  trafficasoutgoingandvisaversa.Thiscanbeachieved

#  byaddingthe'-'signinfrontofthe"Target"

#  description.Itflipstheinandoutgoingtrafficrates.

#Target[ezci]:

-1:

public@ezci-ether.ethz.ch

#*YoucanalsoexplicitlydefinetheOIDtoquerybyusingthe

#  followingsyntax'OID_1&OID_2:

community@router'

#  Thefollowingexamplewillretrieveerrorinputandoutput

#  octets/seconinterface1.MRTGneedstographtwovalues,so

#  youneedtospecifytwoOID'ssuchastemperatureandhumidity

#  orerrorinputanderroroutput.

#Target[ezwf]:

1.3.6.1.2.1.2.2.1.14.1&1.3.6.1.2.1.2.2.1.20.1:

public@myrouter

#*mrtgknowsanumberofsymbolicalSNMPvariable

#  names.Seethefilemibhelp.txtforalistofknown

#  names.OneexamplearetheifInErrorsandandifOutErrors

#  names.Thismeansyoucanspecifytheaboveas:

#Target[ezwf]:

ifInErrors.1&ifOutErrors.1:

public@myrouter

#*ifyouwanttomonitorsomethingwhichdoesnotprovide

#  dataviasnmpyoucanusesomeexternalprogramtodo

#  thedatagathering.

#

#  Theexternalcommandmustreturn4linesofoutput:

#    Line1:

currentstateofthe'incomingbytescounter'

#    Line2:

currentstateofthe'outgoingbytescounter'

#    Line3:

string,tellingtheuptimeofthetarget.

#    Line4:

string,tellingthenameofthetarget.

#  Dependingonthetypeofdatayourscriptreturnsyou

#  mightwanttousethe'gauge'or'absolute'arguments

#  forthe"Options"keyword.

#Target[ezwf]:

`/usr/local/bin/df2mrtg/dev/dsk/c0t2d0s0`

#*Youcanalsouseseveralstatementsinamathematical

#  expression.ThiscouldbeusedtoaggregatebothBchannels

#  inanISDNconnectionormultipleT1'sthatareaggregated

#  intoasinglechannelforgreaterbandwidth.

#  Notethewhitespacearroundthetargetdefinitions.

#Target[ezwf]:

2:

public@wellfleetA+1:

public@wellfleetA

#             *4:

public@ciscoF

##

##RouterUptime---------------------------------------

##

#

#Incaseswhereyoucalculatetheusedbandwidthfrom

#severalinterfacesyounormalydon'tgettherouteruptime

#androuternamedisplayedonthewebpage.

#Ifthisinterfaceareonthesamerouterandtheuptimeand

#nameshouldbedisplayedneverthelessyouhavetospecify

#itscommunityandaddressagainwiththeRouterUptimekeyword.

#Target[kacisco]:

1:

public@194.64.66.250+2:

public@194.64.66.250

#RouterUptime[kacisco]:

public@194.64.66.250

##

##MaxBytes-------------------------------------------

##

#Howmanybytespersecondcanthisportcarry.Sincemost

#linksareratedinbitspersecond,youneedtodivide

#theirmaximumbandwidth(inbits)byeight(8)inordertoget

#bytespersecond.Thisisveryimportanttomakeyour

#unscaledgraphsdisplayrealisticinformation.

#T1=193000,56K=7000,Ethernet=1250000.The"MaxBytes"

#valuewillbeusedbymrtgtodecidewhetheritgota

#validresponsefromtherouter.Ifanumberhigherthan

#"MaxBytes"isreturned,itisignored.Alsoreadthesection

#onAbsMaxforfurtherinfo.

#MaxBytes[ezwf]:

1250000

##

##Title-----------------------------------------------

##

#TitlefortheHTMLpagewhichgetsgeneratedforthegraph.

#Title[ezwf]:

TrafficAnalysisforETZC95.1

##

##PageTop---------------------------------------------

##

#ThingstoaddtothetopofthegeneratedHTMLpage.Note

#thatyoucanhaveseverallinesoftextaslongasthe

#firstcolumnisempty.

#Notethatthecontinuationlineswillallenduponthesame

#lineinthehtmlpage.Ifyouwantlinebreaksinthegenerated

#htmlusethe'n'sequence.

#PageTop[ezwf]:

TrafficAnalysisforETZC95.1

#OurCampusBackbonerunsoveranFDDIlinen

#withamaximumtransferrateof12.5MegaBytesper

#Second.

##

##PageFoot---------------------------------------------

##

#Thingstoaddattheveryendofthemrtggeneratedhtmlpage

#PageFoot[ezwf]:

ThispageismanagedbyBlubber

#--------------------------------------------------

#OptionalTargetConfigurationTags

#--------------------------------------------------

##

##AddHead-----------------------------------------

##

#UsethistaglikethePageTopheader,butitscontents

#willbeaddedbetweenand.

#AddHead[ezwf]:

##

##AbsMax------------------------------------------

##

#Ifyouaremonitoringalinkwhichcanhandlemoretraffic

#thantheMaxBytesvalue.Eg,alinewhichusescompression

#orsomeframerelaylink,youcanusetheAbsMaxkeyword

#togivetheabsolutemaximumvalueevertobereached.We

#needtoknowthisinordertosortoutunrealisticvalues

#returnedbytherouters.Ifyoudonotsetabsmax,rateup

#willignorevalueshigherthenMaxBytes.

#AbsMax[ezwf]:

2500000

##

##Unscaled------------------------------------------

##

#Bydefaulteachgraphisscaledverticallytomakethe

#actualdatavisibleevenwhenitismuchlowerthan

#MaxBytes.Withthe"Unscaled"variableyoucansuppress

#this.It'sargumentisastring,containingoneletter

#foreachgraphyoudon'twanttobescaled:

d=dayw=week

#m=monthy=year.IntheexampleIsuppressscalingforthe

#yearlyandthemonthlygraph.

#Unscaled[ezwf]:

ym

##

##WithPeak------------------------------------------

##

#Bydefaultthegraphsonlycontaintheaveragetransfer

#ratesforincomingandoutgoingtraffic.The

#followingoptioninstructsmrtgtodisplaythepeak

#5minutetransferratesinthe[w]eekly,[m]onthlyand

#[y]earlygraph.Intheexamplewedefinethemonthly

#andtheyearlygraphtocontainpeakaswellasaverage

#values.

#WithPeak[ezwf]:

ym

##

##Supress------------------------------------------

##

#ByDefaultmrtgproduces4graphs.Withthisoptionyou

#cansuppressthegenerationofselectedgraphs.Theformat

#isanalogtotheaboveoption.Inthisexamplewesuppress

#theyearlygraphasitisquiteemptyinthebeginning.

#Suppress[ezwf]:

y

##

##Directory

##

#Bydefault,mrtgputsallthefilesthatitgeneratesforeach

#route

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 计算机软件及应用

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2