Cacti: traffic analysis and monitoring network: Difference between revisions

From Alpine Linux
(Initial page creation)
 
m (added fcgi to the initial list of installed packages)
Line 1: Line 1:
Install needed packages:
Install needed packages:
  apk add lighttpd php cacti net-snmp-tools
  apk add lighttpd php cacti net-snmp-tools fcgi
Add php support to lighttpd (uncomment this line in /etc/lighttpd/lighttpd.conf):
Add php support to lighttpd (uncomment this line in /etc/lighttpd/lighttpd.conf):
  include "mod_fastcgi.conf"
  include "mod_fastcgi.conf"

Revision as of 23:04, 2 November 2010

Install needed packages:

apk add lighttpd php cacti net-snmp-tools fcgi

Add php support to lighttpd (uncomment this line in /etc/lighttpd/lighttpd.conf):

include "mod_fastcgi.conf"

Save and exit editor. Create a softlink for the cacti web files:

ln -s /usr/share/webapps/cacti /var/www/localhost/htdocs/cacti

If it hasn't already been done, setup MySQL:

apk add mysql-client
mysql_install_db --user=mysql
/etc/init.d/mysql start
mysql_secure_installation

Create the cacti database and populate it

echo "create database cacti;" | mysql --user=root -p

Grant Cacti MySQL user access (give it a more secure password):

echo "grant all on cacti.* to 'cactiuser'@'localhost' identified by 'MostSecurePassword'; flush privileges;" | mysql --user=root -p

Edit /var/www/localhost/htdocs/cacti/include/config.php and put in the password you used in the above step for the mysql user. Import the initial Cacti MySQL config:

mysql --user=cacti -p cacti < /usr/share/webapps/cacti/cacti.sql

Browse to http://localhost/cacti/

-> Next
-> New install, Next
-> Finish

Login using admin:admin, change password.
Add to crontab:

*/5 * * * * php /var/www/localhost/cacti/poller.php > /dev/null 2>&1

Add your devices and you're ready to start monitoring!