User Tools

Site Tools


cacti

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cacti [2014/11/24 01:14] (current)
0.0.0.0 created
Line 1: Line 1:
 +====== 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 <​tt>​webapp-config</​tt>​.
 +{{Root|<​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:
 +{{Command|<​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
 +{{File|/​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:
 +{{Root|<​source lang="​bash">​
 +/​etc/​init.d/​vixie-cron restart
 +</​source>​}}
 +
 +Create an Apache vhost to serve cacti:
 +{{File|/​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>​.
 +
 +Then create the following vhost:
 +{{File|/​etc/​apache2/​vhosts/​07_cacti.sihnon.net.conf|<​syntax lang="​apache">​
 +<​VirtualHost *:80>
 +
 +    ServerName cacti.sihnon.net
 +
 +    ProxyRequests Off
 +
 +    <Proxy *>
 +        Order deny,allow
 +        Allow from all
 +    </​Proxy>​
 +
 +    ProxyPass / http://​cacti.sihnon.net/​
 +    ProxyPassReverse / http://​cacti.sihnon.net/​
 +
 +</​VirtualHost>​
 +  - vim: set ts=4 expandtab filetype=apache:​
 +</​syntax>​}}
 +
 +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|<​source lang="​bash">​
 +/​etc/​init.d/​apache restart
 +</​source>​}}
 +{{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|<​source lang="​bash">​
 +net-snmp-config --create-snmpv3-user -X password -a "​passphrase"​ cacti
 +</​source>​}}
 +
 +Create a very minimal SNMP configuration file:
 +{{File|/​etc/​snmp/​snmpd.conf|<​syntax lang="​conf">​
 +rouser cacti
 +</​syntax>​}}
 +
 +Start snmpd, and ensure it autostarts on boot:
 +{{Root|<​source lang="​bash">​
 +/​etc/​init.d/​snmpd start
 +rc-update add snmpd default
 +</​source>​}}
cacti.txt · Last modified: 2014/11/24 01:14 by 0.0.0.0