Cacti: traffic analysis and monitoring network: Difference between revisions
m (category added) |
m (minor layout changes, Cmd doesn't work in all cases, Needs fix) |
||
Line 1: | Line 1: | ||
Install needed packages: | Install needed packages: | ||
{{Cmd|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" | ||
Save and exit editor. | Save and exit editor. | ||
Create a softlink for the cacti web files: | Create a softlink for the cacti web files: | ||
{{Cmd|ln -s /usr/share/webapps/cacti /var/www/localhost/htdocs/cacti}} | |||
If it hasn't already been done, setup MySQL: | If it hasn't already been done, setup MySQL: | ||
{{Cmd|apk add mysql-client}} | |||
mysql_install_db --user=mysql | mysql_install_db --user=mysql | ||
{{Cmd|/etc/init.d/mysql start}} | |||
{{Cmd|mysql_secure_installation}} | |||
Create the cacti database and populate it | Create the cacti database and populate it | ||
{{Cmd|echo "create database cacti;" | mysql --user=root -p}} | |||
Grant Cacti MySQL user access (give it a more secure password): | Grant Cacti MySQL user access (give it a more secure password): | ||
{{Cmd|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. | 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: | Import the initial Cacti MySQL config: | ||
mysql --user=cacti -p cacti < /usr/share/webapps/cacti/cacti.sql | mysql --user=cacti -p cacti < /usr/share/webapps/cacti/cacti.sql | ||
Set lighttpd to autostart and start the daemon. | Set lighttpd to autostart and start the daemon. | ||
{{Cmd|rc-update add lighttpd && rc-service lighttpd start}} | |||
Browse to http://localhost/cacti/<br /> | Browse to http://localhost/cacti/<br /> | ||
: -> Next | |||
: -> New install, Next | |||
: -> Finish | |||
Login using admin:admin, change password.<br /> | Login using admin:admin, change password.<br /> | ||
Add to crontab:<br /> | Add to crontab:<br /> |
Revision as of 08:59, 15 June 2011
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;"
Grant Cacti MySQL user access (give it a more secure password):
echo "grant all on cacti.* to 'cactiuser'@'localhost' identified by 'MostSecurePassword'; flush privileges;"
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
Set lighttpd to autostart and start the daemon.
rc-update add lighttpd && rc-service lighttpd start
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!