Install Cacti in centos 5

langkah – langkah nya sebagai berikut :

1. buat revo baru dengan nama dag.repo :

vi /etc/yum.repos.d/dag.repo

kemudian isi kan file berikut didalam nya.

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el5/en/i386/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

2. install php , apache , mysql dan snmp

yum install php httpd mysql mysql-server php-mysql vim-enhanced net-snmp

3. install cacti

wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz
tar xzvf cacti-0.8.7e.tar.gz
mv cacti-0.8.7e cacti
mv cacti /var/www/html

4. kemudian buat cactiuser dan group nya

/usr/sbin/groupadd cacti
/usr/sbin/useradd -g cacti cactiuser
passwd cactiuser

5. ganti ownership dari /var/www/html/cacti/rra/ dan /var/www/html/cacti/log/ directories ke cactiuser yang telah di buat
cd /var/www/html/cacti
chown -R cactiuser rra/ log/

6. buat mysql password misal : pass = 12345
/usr/bin/mysqladmin -u root password 12345

7. buat database cacti nya

mysqladmin –user=root –password=12345 create cacti

8. import database

cd /var/www/html/cacti
mysql –user=root –password=12345 cacti < cacti.sql 9. masuk ke mysql mysql --user=root --password=12345 mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘12345’;
flush privileges;

10. kemudian edit confg DB cacti nya

vi /var/www/html/cacti/include/config.php

/* make sure these values refect your actual database/host/user/password */
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “12345”;
$database_port = “3306”;

11. kemudian buat cron untuk cacti
vi /etc/crontab

masukan

*/5 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1

12 . edit php.ini >> ganti memory_limit jadi 128 M
vi /etc/php.ini

13. install rddtool

yum install rrdtool

14. restart service

/etc/init.d/mysqld restart
/etc/init.d/httpd restart

15. test akses cacti nya

http://ipaddrs/cacti

user : admin
pass : admin

sumber : http://www.linux.com/learn/tutorials/38270-installing-cacti-on-centos-5

installl mrtg on centos

1. install snmp

yum install net-snmp-utils net-snmp

-config snmp

# service snmpd start
# chkconfig –add snmpd
# chkconfig snmpd on

vi /etc/snmp/snmpd.conf

#pertama :

cari baris :

com2sec notConfigUser default public

ganti dengan (make sure you replace 192.168.0.0/24 with your network/subnet) baris di bawah ini:

com2sec local localhost public
com2sec mynetwork 192.168.0.0/24 public

#kedua /scroll ke bawah

cari baris:

group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser

ganti dengan :

group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork

#ketiga / scroll

Find line:

view systemview included system

Replace with:

view all included .1 80

#keempat /scroll

Find line:

access notConfigGroup “” any noauth exact systemview none none

Replace with:

access MyROGroup “” any noauth exact all none none
access MyRWGroup “” any noauth exact all all none

#kelima /scroll

Find lines:

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root (configure /etc/snmp/snmp.local.conf)

Replace with (make sure you supply appropriate values):

syslocation Linux (RH3_UP2), Home Linux Router.
syscontact YourNameHere

(a) Make sure when linux comes up snmpd always starts after the system reboot:

# chkconfig snmpd on

(b) Start the snmpd service:

# service snmpd start

(c) Finally, test your snmp server:

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

2. Install MRTG

yum install mrtg

#config mrtg

(a) Create a document root to store mrtg graphs/html pages for Apache web-server, enter:

# mkdir -p /var/www/html/mymrtg/

(b) Run any one of the following cfgmaker command to create mrtg configuration file:

# cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg.cfg public@localhost

OR (make sure FQDN resolves. In the following example I’m using rh9.test.com i.e. my router’s FQDN address)

# cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg1.cfg public@rh9.test.com

(c) Create a default index page for your MRTG configuration, run:

# indexmaker –output=/var/www/html/mymrtg/index.html /etc/mrtg/mymrtg.cfg

(d) Copy all tiny png files to your mrtg path, run:

# cp -av /var/www/html/mrtg/*.png /var/www/html/mymrtg/

3. test mrtg di browser

(a) Run mrtg command from command line with your configuration file, enter:

# mrtg /etc/mrtg/mymrtg.cfg

Note: You may get few warning message for the first time; please ignore them.

(b) Fire your favorite web browser (like FireFox ) and type the url http://www.your-name.com/mymrtg/ or http://your-ip-here/mymrtg/

sumber : http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/

Install Mrtg & Snmp 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