====== 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| webapp-config -I -V -h cacti.sihnon.net cacti 0.8.7d }} * 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| mysql -u cacti -p cactipass -h mysql.sihnon.net cacti_db < /var/www/cacti.sihnon.net/html/cacti.sql }} *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| /etc/init.d/vixie-cron restart }} 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| /etc/init.d/apache restart }} {{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| net-snmp-config --create-snmpv3-user -X password -a "passphrase" cacti }} Create a very minimal SNMP configuration file: {{File|/etc/snmp/snmpd.conf| rouser cacti }} Start snmpd, and ensure it autostarts on boot: {{Root| /etc/init.d/snmpd start rc-update add snmpd default }}