SNMP + Squid = MRTG

czerwiec 8th, 2007

A oto prosty sposób aby na bierząco monitorowac działanie squida, przy wykorzystaniu konfiguracji opisanej na blogu w jednym z poprzednich wpisów.

Ja do tego celu wykorzystuję MRTG, które to poprzez SNMP uzyskuje porządane informacje oraz generuje ładne i czytelne wykresy:

Poniżej wycinek z mrtg.cfg

LoadMIBS: /usr/share/squid/mib.txt
Options[snmp-proxy-srvkbinout]: nopercent, perminute, growright, nobanner
Target[snmp-proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:oper@localhost:3401
MaxBytes[snmp-proxy-srvkbinout]: 1250000
Title[snmp-proxy-srvkbinout]: Cache Server Traffic In / Out
PageTop[snmp-proxy-srvkbinout]:Cache Statistics: Server traffic volume (In/Out)
PageFoot[snmp-proxy-srvkbinout]: stats.eqax.pl
LegendI[snmp-proxy-srvkbinout]: Traffic In
LegendO[snmp-proxy-srvkbinout]: Traffic Out
Legend1[snmp-proxy-srvkbinout]: Traffic In
Legend2[snmp-proxy-srvkbinout]: Traffic Out
YLegend[snmp-proxy-srvkbinout]: per minute
ShortLegend[snmp-proxy-srvkbinout]: b/min
kMG[snmp-proxy-srvkbinout]: k,M,G,T
kilo[snmp-proxy-srvkbinout]: 1024
Suppress[snmp-proxy-srvkbinout]: y
#
Options[snmp-proxy-hit]: nopercent, perminute, dorelpercent, growright, nobanner
Target[snmp-proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:oper@localhost:3401
MaxBytes[snmp-proxy-hit]: 1250000
Title[snmp-proxy-hit]: HTTP Hits
PageTop[snmp-proxy-hit]:proxy Cache Statistics: HTTP Hits / Requests
PageFoot[snmp-proxy-hit]: stats.eqax.pl
LegendI[snmp-proxy-hit]: HTTP hits
LegendO[snmp-proxy-hit]: HTTP requests
Legend1[snmp-proxy-hit]: HTTP hits
Legend2[snmp-proxy-hit]: HTTP requests
YLegend[snmp-proxy-hit]: per minute
ShortLegend[snmp-proxy-hit]: req/min
Suppress[snmp-proxy-hit]: y
#
Options[snmp-proxy-error]: growright, nopercent, growright, nobanner
Target[snmp-proxy-error]: cacheServerErrors&cacheHttpErrors:oper@localhost:3401
MaxBytes[snmp-proxy-error]: 10000000
Title[snmp-proxy-error]: Server and HTTP Errors
PageTop[snmp-proxy-error]: proxy Errors
PageFoot[snmp-proxy-error]: stats.eqax.pl
YLegend[snmp-proxy-error]: errors/sec
ShortLegend[snmp-proxy-error]: err/s
LegendI[snmp-proxy-error]: Server Errors
LegendO[snmp-proxy-error]: HTTP Errors
Legend1[snmp-proxy-error]: Server Errors
Legend2[snmp-proxy-error]: HTTP Errors
Suppress[snmp-proxy-error]: y
#
Options[snmp-proxy-FileDescr]: gauge, growright, nopercent, nobanner
Target[snmp-proxy-FileDescr]: cacheCurrentUnusedFDescrCnt&cacheCurrentResFileDescrCnt:oper@localhost:3401
MaxBytes[snmp-proxy-FileDescr]: 1000000000
Title[snmp-proxy-FileDescr]: File Descriptors
PageTop[snmp-proxy-FileDescr]: Number of file descriptors
PageFoot[snmp-proxy-FileDescr]: stats.eqax.pl
YLegend[snmp-proxy-FileDescr]: # of FDs
ShortLegend[snmp-proxy-FileDescr]: FDs
LegendI[snmp-proxy-FileDescr]: Available File Descriptors
LegendO[snmp-proxy-FileDescr]: Reserved File Descriptors
Legend1[snmp-proxy-FileDescr]: Available File Descriptors
Legend2[snmp-proxy-FileDescr]: Reserved File Descriptors
Suppress[snmp-proxy-FileDescr]: y
#
Options[snmp-proxy-AllSvcTime]: gauge, growright, nopercent, nobanner
Target[snmp-proxy-AllSvcTime]: cacheHttpAllSvcTime.5&cacheHttpAllSvcTime.60:oper@localhost:3401
MaxBytes[snmp-proxy-AllSvcTime]: 1000000000
Title[snmp-proxy-AllSvcTime]: HTTP All Service Time
PageTop[snmp-proxy-AllSvcTime]:HTTP all service time
PageFoot[snmp-proxy-AllSvcTime]: stats.eqax.pl
YLegend[snmp-proxy-AllSvcTime]: time (ms)
ShortLegend[snmp-proxy-AllSvcTime]: ms
LegendI[snmp-proxy-AllSvcTime]: Medium Service Time (5min)
LegendO[snmp-proxy-AllSvcTime]: Medium Service Time (60min)
Legend1[snmp-proxy-AllSvcTime]: Medium Service Time
Legend2[snmp-proxy-AllSvcTime]: Medium Service Time
Suppress[snmp-proxy-AllSvcTime]: y
#
Options[snmp-proxy-SysNumReads]:growright, nopercent, nobanner
Target[snmp-proxy-SysNumReads]: cacheSysNumReads&cacheSysNumReads:oper@localhost:3401
MaxBytes[snmp-proxy-SysNumReads]: 10000000
Title[snmp-proxy-SysNumReads]: HTTP I/O number of reads
PageTop[snmp-proxy-SysNumReads]: HTTP I/O number of reads
PageFoot[snmp-proxy-SysNumReads]: stats.eqax.pl
YLegend[snmp-proxy-SysNumReads]: reads/sec
ShortLegend[snmp-proxy-SysNumReads]: reads/s
LegendI[snmp-proxy-SysNumReads]: I/O
LegendO[snmp-proxy-SysNumReads]:
Legend1[snmp-proxy-SysNumReads]: I/O
Legend2[snmp-proxy-SysNumReads]:
Suppress[snmp-proxy-SysNumReads]: y
#
Options[snmp-proxy-Storage]: gauge, growright, nopercent, nobanner
Target[snmp-proxy-Storage]: cacheSysVMsize&cacheSysStorage:oper@localhost:3401
MaxBytes[snmp-proxy-Storage]: 1000000000
Title[snmp-proxy-Storage]: Storage Memory / Swap Size
PageTop[snmp-proxy-Storage]: Storage Memory / Swap Size
PageFoot[snmp-proxy-Storage]: stats.eqax.pl
YLegend[snmp-proxy-Storage]: size
ShortLegend[snmp-proxy-Storage]: Bytes
LegendI[snmp-proxy-Storage]: Memory Size
LegendO[snmp-proxy-Storage]: Swap Size
Legend1[snmp-proxy-Storage]: Memory Size
Legend2[snmp-proxy-Storage]: Swap Size
Suppress[snmp-proxy-Storage]: y

W następnym odcinku podziele się skryptami, które wszczynaja alarm gdy proxy wariuje.

P.S. A może nie podziele się ? :)

One Response to “SNMP + Squid = MRTG”

  1. 1 PinY
    czerwiec 10th, 2007 at 4:56 pm

    Podziel się, podziel :) dzieci są ciekawe co tam wyrzeźbiłeś ;)

Leave a Reply