Table of Contents
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:
Portage only makes the webapp available on the system; in order to install it into a particular webroot, use <tt>webapp-config</tt>. <source lang="bash"> webapp-config -I -V -h cacti.sihnon.net cacti 0.8.7d </source>
- Create a <tt>cacti</tt> user on <tt>mysql.sihnon.net</tt>, and grant privileges on all cacti_ databases (use [https://dev.sihnon.net/pma phpMyAdmin to do this).
- Create a <tt>cacti_db</tt> database
- Install the database schema by running the following command on the web host:
<source lang="bash"> mysql -u cacti -p cactipass -h mysql.sihnon.net cacti_db < /var/www/cacti.sihnon.net/html/cacti.sql </source> *Edit the database configuration file with the correct settings (<tt>/var/www/cacti.sihnon.net/html/include/config.php</tt>)
Install a cronjob to update the data queries /etc/cron.d/cacti|<syntax lang="cron"> */5 * * * * apache /usr/bin/php /var/www/cacti.sihnon.net/html/poller.php > /dev/null 2>&1 </syntax>
Restart <tt>vixie-cron</tt> to pick up the new cronjob: <source lang="bash"> /etc/init.d/vixie-cron restart </source>
Create an Apache vhost to serve cacti: /etc/apache2/vhosts.d/01_cacti.sihnon.net.conf|<syntax lang="apache"> <VirtualHost *:80> ServerName "cacti.sihnon.net" DocumentRoot "/var/www/cacti.sihnon.net/html" <Directory "/var/www/cacti.sihnon.net/html"> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> - vim: set filetype=apache: </syntax>
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 <tt>mod_proxy</tt> on a suitable machine by adding <tt>APACHE_OPTS=“-D PROXY”</tt> to <tt>/etc/conf.d/apache2</tt>.
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. <source lang="bash"> /etc/init.d/apache restart </source> 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:
Configuration
Create an SNMPv3 user that cacti can use to access the statistics: <source lang="bash"> net-snmp-config --create-snmpv3-user -X password -a "passphrase" cacti </source>
Create a very minimal SNMP configuration file: /etc/snmp/snmpd.conf|<syntax lang="conf"> rouser cacti </syntax>
Start snmpd, and ensure it autostarts on boot: <source lang="bash"> /etc/init.d/snmpd start rc-update add snmpd default </source>