TRAP SQUID PROSES WITH CACTI

Backup dari websiteku yg lain : http://aa.cakralintas.net.id

Dipublish ulang dari thread http://forum.linux.or.id/viewtopic.php?t=3737
Tujuannya adalah untuk membuat graph dari squid proses. Kasus ini diungkap karena ternyata masih banyak rekan2 yg masih belom bisa mentrap squid proses ke dalam graphic dari mulai :

  • Squid Available File Descriptor
  • Squid Cache Hit Rate
  • ImageSquid Client Request Rate
  • Squid CPU Usage
  • Squid DNS Statistics
  • Squid Error Rate
  • Squid Number of Clients
  • Squid Page Faults
  • Squid Service Timers
  • Squid Storage Activity
  • Squid Storage Utilisation
  • Squid Traffic In / Out / Saved

Tool yg dibutuhkan :

  • GNU/Linux Fedora (Tutorial ini menggunakan fedora 8 )
  • CACTI (harus sudah berjalan baik, versi yg terbaru lebih bagus, di install beda dengan mesin proxy lebih bagus)
  • ~]# yum -y install cacti
  • NET-SNMP
  • ~]# yum -y install net-snmp net-snmp-libs net-snmp-utils net-snmp-devel php-snmp

Persiapan :

Pengerjaan :

proxy host:

  • Load MIB-SQUID ke environment
  • ~]# export MIBFILES="/etc/squid/mib.txt"
  • Edit net-snmp di proxy/squid host, tambahkan baris berikut di snmpd.conf:
  • ~]# vim /etc/snmp/snmpd.conf
    proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1

Note : comunity dan localhost : sesuaikan.

Paramater di atas artinya :
proxy :: parameter proxy support untuk net-snmp (memasukan snmp squid (3401) ke net-snmp utama (161).
-v 1 :: memakai versi 1 (aku blom tahu bisa nga pake v 2, ini tergantung squidnya)
-c public :: komuniti yg di snmp squid.conf dan net-snmp samakan.
localhost:3401 :: host bisa berupa localhost atau IP dengan port snmp squid.
.1.3.6.1.4.1.3495.1 :: OID yg diberikan u/ trap snmp dari MIB-SQUID.

  • Contoh snmpd.conf lengkapnya di proxy squid host
  • ~]# cat /etc/snmp/snmpd.conf
    com2sec mynetwork  192.168.0.0/24    public
    group MyROGroup   v1        mynetwork
    view all    included  .1
    access MyROGroup ""      any       noauth   exact   all    none   none
    syslocation NOC-SQUID-PROXY
    syscontact NOC
    proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1
  • Contoh squid.conf untuk configuration snmp internal squid :
  • ~]# cat /etc/squid/squid.conf
    acl snmppublic snmp_community public
    snmp_port 3401
    snmp_access allow snmppublic lan
    snmp_access deny all
  • Reload net-snmpd

Cacti Host:

  1. Kopikan file dibawah ini ke <cacti_path>/resource/snmp_queries:
    a) webcache_squid_core.xml
    b) webcache_squid_median.xml
  2. Import file ini cacti_host_template_webcache_squid_server_snmp.xml ke system cacti.
  3. Mulailah dengan add device atau edit device yang sudah ada.
  4. add data Query :
    WebCache – Squid Statistics – Core
    WebCache – Squid Statistics – Median Based



  5. Create Graphs for this Host
  6. Done!

Catatan :

squidstat-0.1.zip <=aslinya hanya bisa digunakan di cacti 0.8.5.
Intruksi di atas untuk memfungsikan squidstat-0.1 di cacti seri terbaru. ini sudah dicoba di cacti 0.8.6 (c,d,g).

Ucapan Terimakasih :
mas fish (Agung Solo) untuk uji-coba dan trial nya , snmpne ora error mas :)
Teman2 Forum.linux.or.id , many many thanks. Hidup linux……

Tags: , 962 views

Leave a Reply