Cacti: traffic analysis and monitoring network: Difference between revisions
m (cacti package has been fixed) |
mNo edit summary |
||
Line 5: | Line 5: | ||
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}} | {{Cmd|ln -s /usr/share/webapps/cacti /var/www/localhost/htdocs/cacti}} | ||
Assign permits to lighttpd user: | Assign permits to lighttpd user: | ||
{{Cmd|chown -R lighttpd:lighttpd /var/www/localhost/htdocs/cacti/}} | |||
In case you are using other web server than lighttpd have to assign permits to that user. | In case you are using other web server than lighttpd have to assign permits to that user. | ||
If it hasn't already been done, setup MySQL: | If it hasn't already been done, setup MySQL: | ||
{{Cmd|apk add mysql-client}} | {{Cmd|apk add mysql-client}} | ||
{{Cmd|<nowiki>mysql_install_db --user=mysql</nowiki>}} | |||
{{Cmd|/etc/init.d/mysql start}} | {{Cmd|/etc/init.d/mysql start}} | ||
{{Cmd|mysql_secure_installation}} | {{Cmd|mysql_secure_installation}} | ||
Create the cacti database and populate it | Create the cacti database and populate it | ||
{{Cmd| mysql -u root -p}} | {{Cmd| mysql -u root -p}} | ||
{{Cmd| mysql> create database cacti;}} | {{Cmd| mysql> create database cacti;}} | ||
Grant Cacti MySQL user access (give it a more secure password): | Grant Cacti MySQL user access (give it a more secure password): | ||
{{Cmd| mysql> grant all on cacti.* to 'cactiuser'@'localhost' identified by 'MostSecurePassword'; flush privileges;}} | {{Cmd| mysql> grant all on cacti.* to 'cactiuser'@'localhost' identified by 'MostSecurePassword'; flush privileges;}} | ||
Quit from Mysql command prompt: | Quit from Mysql command prompt: | ||
{{Cmd| mysql> \q }} | {{Cmd| mysql> \q }} | ||
Edit and put in the password you used in the above step for the mysql user. | Edit and put in the password you used in the above step for the mysql user. | ||
{{Cmd|vi /var/www/localhost/htdocs/cacti/include/config.php}} | |||
Import the initial Cacti MySQL config: | Import the initial Cacti MySQL config: | ||
{{Cmd|<nowiki>mysql --user=cacti -p cacti < /usr/share/webapps/cacti/cacti.sql</nowiki>}} | |||
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}} | {{Cmd|rc-update add lighttpd && rc-service lighttpd start}} | ||
Browse to http://localhost/cacti/<br /> | Browse to http://localhost/cacti/<br /> | ||
In the web page click: | In the web page click: | ||
: -> Next | : -> Next |
Revision as of 16:46, 1 July 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
Assign permits to lighttpd user:
chown -R lighttpd:lighttpd /var/www/localhost/htdocs/cacti/
In case you are using other web server than lighttpd have to assign permits to that user. 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
mysql -u root -p
mysql> create database cacti;
Grant Cacti MySQL user access (give it a more secure password):
mysql> grant all on cacti.* to 'cactiuser'@'localhost' identified by 'MostSecurePassword'; flush privileges;
Quit from Mysql command prompt:
mysql> \q
Edit and put in the password you used in the above step for the mysql user.
vi /var/www/localhost/htdocs/cacti/include/config.php
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/
In the web page click:
- -> Next
Then select new install in case is not selected:
- -> New install, Next
Then finish
- -> Finish
Login using:
Password= admin user= admin
Next wil be prompted to change password:
change password.
Add to crontab:
cd /etc/crontabs vi root
copy to the end of the file:
*/5 * * * * lighttpd php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1
In case you are using other web server have to modify the "lighttpd" user.
*/5 * * * * "web server user" php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1
Add your devices and you're ready to start monitoring!