Friday, November 15, 2024
Cacti Debian DevOps

Install Cacti di debian

Untuk instalasi MRTG di debian anda bisa mengikuti tutorial berikut ini :

Requirment :

cpu
OS debian 7

1. lihat sources.list

pico /etc/apt/sources.list

misal masukan link lokal untuk source list nya

#Repo kambing UI
deb http://kambing.ui.ac.id/debian/ wheezy main non-free contrib
deb-src http://kambing.ui.ac.id/debian/ wheezy main non-free contrib

#Repo Update Security
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

2. update apt terlebih dahulu

apt-get update

3. install sql server

apt-get install mysql-server php5-mysql

4. lihat / edit file : /etc/profile kemudian masukan script export LC_ALL=en_US.UTF-8 di line paling bawah
contoh :
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
export LC_ALL=en_US.UTF-8

5. kemudian cek file /etc/bash.bashrc , pastikan di line paling bawah ada script berikut :

fi
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8
export LC_MESSAGES=en_US.UTF-8

6. kemudian install DB nya

mysql_install_db

7. lalu lanjutkan dengan command berikut :

/usr/bin/mysql_secure_installation

8.kemudian install nginx /apache nya , di sini saya instalkan nginx :

apt-get install nginx

9. test / running service nya :

service nginx start

10. kemudian cek file : /etc/nginx/sites-available/default

hasil nya di set seperti ini

server {
listen 80;

root /usr/share/nginx/www;
index index.php index.html index.htm;

server_name example.com;

location / {
try_files $uri $uri/ /index.html;
}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

}

11. kemudian cek apakah folder : /usr/share/nginx/www/ sudah ada
12. install fpm untuk php

apt-get install php5-fpm

13. kemudian cek php.ini nya

pico /etc/php5/fpm/php.ini
pico /etc/php5/fpm/pool.d/www.conf

14. restart service fpm & nginx

service php5-fpm restart
service nginx restart

15. install snmpd

apt-get install snmpd

kemudian cek pula :

pico /etc/default/snmpd
pico /etc/snmp/snmp.conf

16. install mibs

apt-get install snmp-mibs-downloader

17. restart service snmpd

service snmpd restart

18. cek service yg jalan

ps ax

19. kemudian install cacti

apt-get install cacti cacti-spine

20 . lakukan command berikut

cd /usr/share/nginx/www/
ln -s /usr/share/cacti/site cacti

21 lalu command

chown -R www-data:www-data cacti/

22. cd /usr/src/ >> install plugin

wget http://docs.cacti.net/_media/plugin:realtime-v0.5-2.tgz -O realtime.tgz
tar -xzvf realtime.tgz -C /usr/share/nginx/www/cacti/plugins/
mkdir -p /usr/share/nginx/www/cacti/plugins/realtime/cache
chown -R www-data:www-data /usr/share/nginx/www/cacti/plugins/realtime/

wget http://docs.cacti.net/_media/plugin:spikekill-v1.3-2.tgz -O spikekill.tgz
tar -xzvf spikekill.tgz -C /usr/share/nginx/www/cacti/plugins/
chown -R www-data:www-data /usr/share/nginx/www/cacti/plugins/spikekill/

wget http://docs.cacti.net/lib/exe/fetch.php?hash=424de1&media=http%3A%2F%2Fdocs.cacti.net%2F_media%2Fuserplugin%3Adashboardv_v1.2.tar -O dashboard.tar
tar -xvf dashboardv_v1.2.tar -C /usr/share/nginx/www/cacti/plugins/
chown -R www-data:www-data /usr/share/nginx/www/cacti/plugins/dashboard/

23. lanjut ke command berikut :

cd /usr/share/nginx/www/cacti
mkdir rra

24. lalu set cron nya

crontab -e

*/1 * * * * chown -R www-data:www-data /usr/share/nginx/www/cacti/rra/

*/1 * * * * chmod 777 /usr/share/nginx/www/cacti/rra/*

25. lalu restart snmp

service snmpd restart

26. kemudian lanjut

cd /usr/share/nginx/www/cacti/plugin/realtime
chmod -R 755 cache/

27 . kemudian test running :

cek dulu kalau2 service apache jalan

ps ax

/etc/init.d/apache2 stop
/etc/init.d/nginx start

28 . kemudian buka browser : http://IPserver/cacti

(Visited 196 times, 1 visits today)

Similar Posts