Rully's Blog

02 November 2006

Cacti II

Assalamu'alaikum Warahmatullahi Wabarakatuh


Buat semua pengunjung blog ini dan yang ini, Selamat Idul Fitri 1 Syawal 1427 H. Taqabalallahu minna wa minkum, mohon maaf lahir & batin.
Beberapa minggu yang lalu, coba (lagi) install cacti di mesin yang lain (router). Sebelumnya install di notebook. Hm ... ada sedikit perbedaan.
Intinya sih sama. Cuma ada "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)".

1. Install Cacti & DAMP (Debian, Apache, MySQL, PHP). *He he*

:~# apt-get install cacti

2. :~# adduser cacti

3. :~# mysqld --skip-grant-tables --user=root

4. :~# mysql -u root

5. mysql> UPDATE mysql.user SET Password=PASSWORD('password_baru') WHERE User='root';

Query OK, 2 rows affected (0.07 sec)
Rows matched: 2 Changed: 2 Warnings: 0


6. mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.07 sec)

7. mysql> exit

8. :~# vim /etc/cacti/debian.php

$database_username='cacti';
$database_password='cacti';
$database_default='cacti';
$database_hostname='localhost';
$dbport='';
$dbtype='mysql';


9. :/usr/share/cacti/site# chown -R cacti rra/ log/

10. Tambahkan 1 baris di file crontab:

:~# vim /etc/crontab

*/5 * * * * cacti php /usr/share/cacti/site/poller.php > /dev/null 2>&1

11. :~# mysql --user=root mysql -p

12. mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';

13. mysql> flush privileges;

14. mysql> exit

15. Browse ke: http://ip-router/cacti/

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cacti -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.


*waduh, ada yang lupa*

16. :~# mysqladmin --user=root create cacti -p

17. :~# zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti --password=cacti cacti

18. :~# echo "extension=mysql.so" >> /etc/php4/apache/php.ini

19. :~# /etc/init.d/apache restart

20. Browse (lagi) ke: http://ip-router/cacti/. Berhasil.

- Next
- Please select the type of installation: New Install
- The following information has been determined from Cacti's configuration file. If it is not correct, please edit 'include/config.php' before continuing.
Database User: cacti
Database Hostname: localhost
Database: cacti
Server Operating System Type: unix
- Next
- Make sure all of these values are correct before continuing.
[FOUND] RRDTool Binary Path: The path to the rrdtool binary. -> /usr/bin/rrdtool
[FOUND] PHP Binary Path: The path to your PHP binary file (may require a php recompile to get this file). -> /usr/bin/php
[FOUND] snmpwalk Binary Path: The path to your snmpwalk binary. -> /usr/bin/snmpwalk
[FOUND] snmpget Binary Path: The path to your snmpget binary. -> /usr/bin/snmpget
[FOUND] snmpbulkwalk Binary Path: The path to your snmpbulkwalk binary. -> /usr/bin/snmpbulkwalk
[FOUND] snmpgetnext Binary Path: The path to your snmpgetnext binary. -> /usr/bin/snmpgetnext
[FOUND] Cacti Log File Path: The path to your Cacti log file. -> /usr/share/cacti/site/log/cacti.log
SNMP Utility Version: The type of SNMP you have installed. Required if you are using SNMP v2c or don't have embedded SNMP support in PHP. -> NET_SNMP 5.X
RRDTool Utility Version: The version of RRDTool that you have installed. -> RRDTool 1.2.x

- Finish


21. Login

Please enter your Cacti user name and password below:
User Name:
admin
Password: admin

22. *** Forced Password Change ***

Please enter a new password for cacti:
Password:
Confirm:


23. Selesai


Wassalamu'alaikum Warahmatullahi Wabarakatuh