https://wiki.archlinux.org/api.php?action=feedcontributions&user=Musicmastamike&feedformat=atomArchWiki - User contributions [en]2024-03-28T10:35:45ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Cacti&diff=83428Cacti2009-11-13T07:49:55Z<p>Musicmastamike: Add links</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
<br />
This article describes how to set up Cacti on an Arch Linux system. Cacti is a web-based system monitoring and graphing solution.<br />
<br />
==Server Setup==<br />
This article assumes that you already have a working LAMP (Linux, Apache, MySQL, PHP) server. If you don't have a web-server set up already, you can follow [[LAMP|these instructions]] to do so.<br />
<br />
==Cacti Setup==<br />
The following should all be performed as root.<br />
<br />
* Install the necessary programs<br />
# pacman -S cacti php-snmp<br />
<br />
* Edit /etc/php/php.ini<br />
:* Uncomment the following lines:<br />
;extension=mysql.so<br />
;extension=sockets.so<br />
;extension=snmp.so<br />
:* Comment the following line:<br />
open_basedir=...<br />
<br />
* Start mysqld and snmpd if they're not already running:<br />
# /etc/rc.d/mysqld start<br />
# /etc/rc.d/snmpd start<br />
:* Add mysqld and snmdp to the DAEMONS array in /etc/rc.conf to ensure that they're running at bootup<br />
<br />
* Edit /etc/http/conf/httpd.conf<br />
:* Inside the <Directory "/srv/http"> block, ensure that you have the following line:<br />
AllowOverride All<br />
<br />
* MySQL setup<br />
:* Create the cacti database, load the tables, and set the user. You will be asked for the MySQL root password for each of these commands.<br />
# mysqladmin -u root -p create cacti<br />
# mysql -u root -p cacti < /srv/http/cacti/cacti.sql<br />
# mysql -u root -p<br />
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'some_password';<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit<br />
<br />
* Edit /srv/http/cacti/include/config.php. The password was specified in the previous step.<br />
$database_username = "cacti";<br />
$database_password = "some_password";<br />
<br />
* Clean up cacti directory<br />
# chown -R http:http /srv/http/cacti/{rra,log}<br />
# rm /srv/http/cacti/.htaccess<br />
# chmod +x /srv/http/cacti/{cmd,poller}.php /srv/http/cacti/lib/ping.php<br />
<br />
* (Optional) Install spine, a faster poller for cacti, from AUR. Use the same password as in previous steps.<br />
# yaourt -S cacti-spine<br />
:* Edit /etc/spine.conf<br />
DB_User cacti<br />
DB_Pass some_password<br />
<br />
* Set up cron job to run poller every 5 minutes<br />
# crontab -e<br />
:* Add the following to the end of the list<br />
*/5 * * * * /usr/bin/sudo -u http /usr/bin/php /srv/http/cacti/poller.php > /dev/null 2>&1<br />
<br />
* Restart cron and apache<br />
# /etc/rc.d/crond restart<br />
# /etc/rc.d/httpd restart<br />
<br />
==Web Configuration==<br />
Open up a browser and go to http://your_ip/cacti. You should be welcomed with the cacti installer.<br />
* Click Next<br />
* Select New Install and click Next<br />
* Ensure that all paths are ok. For RRDTool Utility Version, select RRDTool 1.3.x. Click Finish.<br />
** If any paths are invalid, you'll need to figure out why. Check the apache error logs for hints.<br />
* Login with username "admin" and password "admin".<br />
* Change the password as requested, click Save.<br />
* (Optional) If you chose to install spine, follow these instructions to set it up.<br />
** Click on Settings, on the left panel of the Console tab.<br />
** Select the Poller tab.<br />
** Change Poller Type to spine.<br />
** Adjust any other settings on the page as desired, then click Save.<br />
** Select the Paths tab.<br />
** Set Spine Poller File Path to /usr/bin/spine and click Save.<br />
<br />
==See Also==<br />
* [[LAMP]] - Set up a LAMP server<br />
<br />
==External Links==<br />
* http://cacti.net</div>Musicmastamikehttps://wiki.archlinux.org/index.php?title=Cacti&diff=83427Cacti2009-11-13T07:45:17Z<p>Musicmastamike: Initial commit</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
<br />
This article describes how to set up Cacti on an Arch Linux system. Cacti is a web-based system monitoring and graphing solution.<br />
<br />
==Server Setup==<br />
This article assumes that you already have a working LAMP (Linux, Apache, MySQL, PHP) server. If you don't have a web-server set up already, you can follow [[LAMP|these instructions]] to do so.<br />
<br />
==Cacti Setup==<br />
The following should all be performed as root.<br />
<br />
* Install the necessary programs<br />
# pacman -S cacti php-snmp<br />
<br />
* Edit /etc/php/php.ini<br />
:* Uncomment the following lines:<br />
;extension=mysql.so<br />
;extension=sockets.so<br />
;extension=snmp.so<br />
:* Comment the following line:<br />
open_basedir=...<br />
<br />
* Start mysqld and snmpd if they're not already running:<br />
# /etc/rc.d/mysqld start<br />
# /etc/rc.d/snmpd start<br />
:* Add mysqld and snmdp to the DAEMONS array in /etc/rc.conf to ensure that they're running at bootup<br />
<br />
* Edit /etc/http/conf/httpd.conf<br />
:* Inside the <Directory "/srv/http"> block, ensure that you have the following line:<br />
AllowOverride All<br />
<br />
* MySQL setup<br />
:* Create the cacti database, load the tables, and set the user. You will be asked for the MySQL root password for each of these commands.<br />
# mysqladmin -u root -p create cacti<br />
# mysql -u root -p cacti < /srv/http/cacti/cacti.sql<br />
# mysql -u root -p<br />
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'some_password';<br />
mysql> FLUSH PRIVILEGES;<br />
mysql> exit<br />
<br />
* Edit /srv/http/cacti/include/config.php. The password was specified in the previous step.<br />
$database_username = "cacti";<br />
$database_password = "some_password";<br />
<br />
* Clean up cacti directory<br />
# chown -R http:http /srv/http/cacti/{rra,log}<br />
# rm /srv/http/cacti/.htaccess<br />
# chmod +x /srv/http/cacti/{cmd,poller}.php /srv/http/cacti/lib/ping.php<br />
<br />
* (Optional) Install spine, a faster poller for cacti, from AUR. Use the same password as in previous steps.<br />
# yaourt -S cacti-spine<br />
:* Edit /etc/spine.conf<br />
DB_User cacti<br />
DB_Pass some_password<br />
<br />
* Set up cron job to run poller every 5 minutes<br />
# crontab -e<br />
:* Add the following to the end of the list<br />
*/5 * * * * /usr/bin/sudo -u http /usr/bin/php /srv/http/cacti/poller.php > /dev/null 2>&1<br />
<br />
* Restart cron and apache<br />
# /etc/rc.d/crond restart<br />
# /etc/rc.d/httpd restart<br />
<br />
==Web Configuration==<br />
Open up a browser and go to http://your_ip/cacti. You should be welcomed with the cacti installer.<br />
* Click Next<br />
* Select New Install and click Next<br />
* Ensure that all paths are ok. For RRDTool Utility Version, select RRDTool 1.3.x. Click Finish.<br />
** If any paths are invalid, you'll need to figure out why. Check the apache error logs for hints.<br />
* Login with username "admin" and password "admin".<br />
* Change the password as requested, click Save.<br />
* (Optional) If you chose to install spine, follow these instructions to set it up.<br />
** Click on Settings, on the left panel of the Console tab.<br />
** Select the Poller tab.<br />
** Change Poller Type to spine.<br />
** Adjust any other settings on the page as desired, then click Save.<br />
** Select the Paths tab.<br />
** Set Spine Poller File Path to /usr/bin/spine and click Save.</div>Musicmastamike