Debian: Install Cacti

# create container
export CONTAINER=cacti
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.jessie.sh -O - | bash -s -- -f
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart

# fix dns
echo nameserver 8.8.8.8 > /var/lib/lxc/${CONTAINER}/rootfs/etc/resolv.conf

# install applications
lxc-attach -n ${CONTAINER} --
LANG=en_US.UTF-8

apt-get update

# server
debconf-set-selections <<\EOF
cacti cacti/webserver select apache2
cacti cacti/dbconfig-install select true
mysql-server-5.5 mysql-server/root_password string t00r
mysql-server-5.5 mysql-server/root_password_again string t00r
libphp-adodb libphp-adodb/pathmove select true
EOF

apt-get install -y cacti
? apt-get install cacti-spine

# configure
http://your_server/cacti

# configure client
apt-get install snmpd
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org

agentAddress udp:127.0.0.1:161
agentAddress udp:161
sed -i 's|agentAddress udp:127.0.0.1:161|agentAddress udp:161|g' /etc/snmp/snmpd.conf

#rocommunity public localhost
rocommunity public 192.168.1.0/24
sed -i 's|#rocommunity public localhost|rocommunity public 192.168.1.0/24|g' /etc/snmp/snmpd.conf

service snmpd restart

# cronjob
# cat /etc/cron.d/cacti
MAILTO=root
*/1 * * * * www-data php --define suhosin.memory_limit=512M /usr/share/cacti/site/poller.php 2>&1 >/dev/null | if

 ; then ts ; else tee ; fi >> /var/log/cacti/poller-error.log
 
# /etc/init.d/cron restart
 
# logs
tail -f /var/log/cacti/*
 
 
 
# Links
http://www.nwlab.net/tutorials/cacti/cacti-tutorial.html
http://xmodulo.com/monitor-linux-servers-snmp-cacti.html
https://packages.debian.org/search?keywords=cacti
http://localhost/cacti