1. apt-get install librrds-perl libsnmp-session-perl snmpd rrdtool snmp apache2 -y
2. perl -MCPAN -e 'install Config::IniFiles'
3. wget http://jaringanwarnet.com/downloads/squidstats-r54.tar
4. tar -xvf squidstats-r54.tar
5. cd squidstats-r54
5. cp mib.txt /etc/squid/ (jika install squid auto) atau /usr/local/squid/etc (manual, sesuaikan dgn instalasi squid)
6. cp snmpd.conf /etc/snmp/
7. nano Makefile.defaults edit SQUID_MIBFILE sesuai dgn folder install squid
8. untuk squid.conf tambahkan berikut ini :
Code:
snmp_port 3401 acl snmppublic snmp_community public snmp_access allow snmppublic all
10. snmpwalk -v 1 -c public localhost
11. squidstats.pl createdb
12. squidstats.pl gather
13. crontab -e
*/5 * * * * /usr/local/bin/squidstats.pl gather >/dev/null
14. cp squidstats.conf /etc/apache2/conf.d
15. reboot
16. cek hasilnya ke http://ipproxy/squidstats/graph-summary.cgi
untuk info lebih jelas silahkan ke:
Req. Squidstat untuk lihat performance squid...
thanks to bang jaringanwarnet.com
B.WEBALIZER
grapik model jadul banget....
1.apt-get install webalizer
2.edit /etc/apache/apache2.conf
Code:
HostnameLookups Off
Code:
HostnameLookups On
Code:
LogFile /var/log/apache2/access.log.1
Code:
LogFile /var/log/apache2/access.log
Code:
0 * * * * webalizer
Code:
#webalizer
Click this bar to view the small image. |
C. MONITORING SQUID WITH MUNIN
pada ubuntu 9.10
1.apt-get install munin munin-node
2.edit /etc/munin/munin.conf
Code:
dbdir /var/lib/munin htmldir /var/www/munin logdir /var/log/munin rundir /var/run/munin
secara default dir apache2 adalah /var/www
jadi apache2 akan membaca smua file yang ada dalam direktori /var/www
3.edit /etc/munin/munin-node.conf
Code:
# Which address to bind to; host *
Code:
# Which address to bind to; host 127.0.0.1
5./etc/init.d/munin-node restart
cek di browser http://IP_PROXY/munin
pada ubuntu 10.10 sama juga seperti pada ubuntu 9.10
tapi ada sedikit yang di edit...
edit /etc/munin/apache.conf
directory apachenya harus di samakan dengan directory yang dibuat di /etc/munin/munin.conf
edit menjadi
Code:
Alias /munin /var/cache/munin/wwwOrder allow,deny Allow from localhost 127.0.0.0/8 ::1 Options None # This file can be used as a .htaccess file, or a part of your apache # config file. # # For the .htaccess file option to work the munin www directory # (/var/cache/munin/www) must have "AllowOverride all" or something # close to that set. # # AuthUserFile /etc/munin/munin-htpasswd # AuthName "Munin" # AuthType Basic # require valid-user # This next part requires mod_expires to be enabled. # # Set the default expiration time for files to 5 minutes 10 seconds from # their creation (modification) time. There are probably new files by # that time. # ExpiresActive On ExpiresDefault M310
[code]
restart munin-node]
cek di browser http://IP_PROXY/munin
thanks to bang ucok......
D.SARG...
1.apt-get install sarg
2.download sarg.conf dan sarg-reports.conf di http://www.ziddu.com/download/12248914/sarg.rar.html
3.copy copy sarg-repots.conf dan sarg.conf ke /etc/sarg
4.membuat daily monthly danweekly reports
nano /etc/sarg/sarg-report-daily
Code:
#daily : #====== #!/bin/bash #Get current date TODAY=$(date +%d/%m/%Y) #Get one week ago today YESTERDAY=$(date --date "1 day ago" +%d/%m/%Y) sarg /var/log/squid/access.log -o /var/www/squid-reports/daily -z -d $YESTERDAY-$TODAY /usr/sbin/squid -k rotate exit 0
Code:
# Weekly : #======== #!/bin/bash #Get current date TODAY=$(date +%d/%m/%Y) #Get one week ago today YESTERDAY=$(date --date "1 week ago" +%d/%m/%Y) sarg /var/log/squid/access.log -o /var/www/squid-reports/weekly -z -d $YESTERDAY-$TODAY /usr/sbin/squid -k rotate exit 0
Code:
# Monthly : #======== #!/bin/bash #Get current date TODAY=$(date +%d/%m/%Y) #Get one week ago today YESTERDAY=$(date --date "1 month ago" +%d/%m/%Y) sarg /var/log/squid/access.log -o /var/www/squid-reports/monthly -z -d $YESTERDAY-$TODAY /usr/sbin/squid -k rotate exit 0
chmod 777 /etc/sarg/sarg-report-daily
chmod 777 /etc/sarg/sarg-report-weekly
chmod 777 /etc/sarg/sarg-report-monthly
6.membuat peerjaan sarg menggunakan cron
crontab -e
Code:
00 00 * * * /etc/sarg/sarg-report-daily 00 01 * * 1 /etc/sarg/sarg-report-weekly 03 02 1 * * /etc/sarg/sarg-report-monthly
8.ketik di browser http://IP_PROXY/squid-reports/
Click this bar to view the small image. |
daftar pustaka : http://www.udiniqgeek.com/sarg_ubuntu.html
jika ada graph selain yang diatas mohon di tambah....
jadi biar gak banyak thread nya....
MOHON DI KOREKSI BILA ADA SALAH.....
tambahan
tambahkan di mt :
buat dolo address list di mt nya
ip fi address add list=LOKAL address=192.168.0.0/16 <<<<---sesuaikan dengan IP anda
chain=dstnat action=dst-nat to-addresses=IP_PROXY to-ports=3128
protocol=tcp src-address=!IP_PROXY dst-address-list=!LOKAL
dst-port=80
untuk menhindari squidstats dan munin menampilkan halaman2 itu2 saja
jadi perlu dibuat address list dolo.....
mohon masukan yang lain......
ref : FMI
No comments:
Post a Comment