====== Cacti ======
===== Overview =====
Cacti is hosted on [[Silverhold]] and can be found at http://cacti.sihnon.net/.
You can view the graphs as a guest, by logging in with the following credentials:
* Username: **guest**
* Password: **view**
* Realm: **Local**
===== Cacti =====
==== Installation ====
Install cacti using portage:
* {{Package|direct=yes|net-analyzer/cacti}} {{USEFlag|{{EnableFlag|snmp}} {{EnableFlag|vhosts}}}}
Portage only makes the webapp available on the system; in order to install it into a particular webroot, use webapp-config.
{{Root|}}
* Create a cacti user on mysql.sihnon.net, and grant privileges on all cacti_ databases (use [https://dev.sihnon.net/pma phpMyAdmin to do this).
* Create a cacti_db database
* Install the database schema by running the following command on the web host:
{{Command|}}
*Edit the database configuration file with the correct settings (/var/www/cacti.sihnon.net/html/include/config.php)
Install a cronjob to update the data queries
{{File|/etc/cron.d/cacti|
*/5 * * * * apache /usr/bin/php /var/www/cacti.sihnon.net/html/poller.php > /dev/null 2>&1
}}
Restart vixie-cron to pick up the new cronjob:
{{Root|}}
Create an Apache vhost to serve cacti:
{{File|/etc/apache2/vhosts.d/01_cacti.sihnon.net.conf|
ServerName "cacti.sihnon.net"
DocumentRoot "/var/www/cacti.sihnon.net/html"
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
- vim: set filetype=apache:
}}
Open the web interface in a browser, and follow the initial setup. The initial credentials are advertised by webapp-config.
==== Configuration ====
//todo//
==== Proxy ====
[[Silverhold]] doesn't have a publicly accessible IP, so cacti needs to be proxied through a machine that does.
Enable mod_proxy on a suitable machine by adding APACHE_OPTS="-D PROXY" to /etc/conf.d/apache2.
Then create the following vhost:
{{File|/etc/apache2/vhosts/07_cacti.sihnon.net.conf|
ServerName cacti.sihnon.net
ProxyRequests Off
Order deny,allow
Allow from all
ProxyPass / http://cacti.sihnon.net/
ProxyPassReverse / http://cacti.sihnon.net/
- vim: set ts=4 expandtab filetype=apache:
}}
Arrange for DNS to resolve internally to the cacti host, and externally to the proxy host.
Finally, restart apache to pick up the new vhost.
{{Root|}}
{{Note|You must restart rather than reload apache, else it will not pick up the PROXY define and will die}}
===== SNMP =====
==== Installation ====
Install the following package on all Gentoo machines to monitor:
* {{Package|direct=yes|net-analyzer/net-snmp}}
==== Configuration ====
Create an SNMPv3 user that cacti can use to access the statistics:
{{Root|}}
Create a very minimal SNMP configuration file:
{{File|/etc/snmp/snmpd.conf|
rouser cacti
}}
Start snmpd, and ensure it autostarts on boot:
{{Root|}}