Created
April 20, 2011 03:48
-
-
Save ijin/930293 to your computer and use it in GitHub Desktop.
cacti installation on Ubuntu 10.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cacti setup | |
sudo apt-get install cacti cacti-spine | |
# templates | |
# memory | |
wget http://www.eric-a-hall.com/software/cacti-netsnmp-memory/cacti-netsnmp-memory.0.7.tar.gz | |
tar xvfz cacti-netsnmp-memory.0.7.tar.gz | |
cd cacti-netsnmp-memory/scripts | |
sudo chown root: ss_netsnmp_memory.php | |
sudo cp ss_netsnmp_memory.php /usr/share/cacti/site/scripts/ | |
sudo chmod u+x /usr/share/cacti/site/scripts/ss_netsnmp_memory.php | |
cd - | |
rm -rf cacti-netsnmp-memory | |
# manual import xml | |
# mysql | |
# on MySQL server, GRANT PROCESS,SUPER,SELECT ON *.* TO 'cactiuser'@'10.%' identified by 'xxxx'; | |
wget http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.7.tar.gz | |
tar xvfz better-cacti-templates-1.1.7.tar.gz | |
cd better-cacti-templates-1.1.7 | |
vi scripts/ss_get_mysql_stats.php | |
perl tools/make-template.pl definitions/mysql_definitions.pl --poll_interval 60 --script scripts/ss_get_mysql_stats.php > ../better-cacti-templates-1.1.7_cacti.xml | |
sudo cp scripts/ss_get_mysql_stats.php /usr/share/cacti/site/scripts/ | |
sudo chmod u+x /usr/share/cacti/site/scripts/ss_get_mysql_stats.php | |
# set polling to 60sec | |
perl tools/make-template.pl --poll_interval 60 --script scripts/ss_get_by_ssh.php definitions/memcached_definitions.pl > templates/memcached_template.xml | |
perl tools/make-template.pl --poll_interval 60 --script scripts/ss_get_by_ssh.php definitions/gnu_linux_definitions.pl > templates/gnu_linux_template.xml | |
perl tools/make-template.pl --poll_interval 60 --script scripts/ss_get_by_ssh.php definitions/nginx_definitions.pl > templates/nginx_template.xml | |
perl tools/make-template.pl --poll_interval 60 --script scripts/ss_get_by_ssh.php definitions/redis_definitions.pl > templates/redis_template.xml | |
# passenger | |
wget http://mysql-cacti-templates.googlecode.com/issues/attachment?aid=-5137644984424254818&name=passenger_support.diff&token=37167e25a883cc3ed803a9dcebb1ce85 -O passenger_support.diff | |
patch -p0 < passenger_support.diff | |
tools/make-template.pl --poll_interval 60 --script scripts/ss_get_by_ssh.php definitions/passenger_definitions.pl > templates/passenger_template.xml | |
# plugins ref: http://docs.cacti.net/plugins.install | |
# plugin-architecture ref: http://forums.cacti.net/viewtopic.php?f=20&t=36499 | |
wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz | |
unzip cacti-plugin-0.8.7e-PA-v2.6.zip | |
sudo cp cacti-plugin-arch/cacti-plugin-0.8.7e-PA-v2.6.diff /usr/share/cacti/site/ | |
cd /usr/share/cacti/site/ | |
sudo patch -p1 -N < cacti-plugin-0.8.7e-PA-v2.6.diff | |
sudo vi include/global.php | |
mysql -uroot -p cacti < pa.sql | |
sudo vi /etc/cacti/debian.php | |
cd - | |
#settings | |
wget "http://docs.cacti.net/_media/plugin:settings-v0.7-1.tgz?id=plugin%3Asettings&cache=cache" -O settings-v0.7-1.tgz | |
tar xvfz settings-v0.7-1.tgz | |
sudo cp -Rv settings /usr/share/cacti/site/plugins/ | |
rm -rf settings | |
#thold | |
wget "http://docs.cacti.net/_media/plugin:thold-latest.tgz?id=plugin%3Athold&cache=cache" -O thold-latest.tgz | |
tar xvfz thold-latest.tgz | |
sudo cp -Rv thold-0.41 /usr/share/cacti/site/plugins/thold | |
rm -rf thold-0.41 | |
cd /usr/share/cacti/site/plugins/thold | |
mysql -uroot -p cacti < thold.sql | |
sudo wget "http://cactiusers.org/forums/download/file.php?id=592" -O thold-template.patch | |
sudo patch -p1 -NJ < thold-template.patch | |
cd - | |
sudo patch -p1 -N < thold-template.patch | |
sudo vi /usr/share/cacti/site/include/global.php | |
# create cacti user | |
cd /etc/cacti | |
sudo ssh-keygen #/etc/cacti/id_rsa | |
sudo chown www-data id_rsa* | |
sudo -u www-data | |
#sudo mkdir /var/www/.ssh | |
#sudo chown www-data: /var/www/.ssh | |
#sudo su - www-data -c 'ssh -i /etc/cacti/id_rsa [email protected] echo "it works"' | |
ssh cacti@remove -i /etc/cacti/id_rsa | |
exit | |
sudo cp scripts/ss_get_by_ssh.php /usr/share/cacti/site/scripts/ | |
cat > /usr/share/cacti/site/scripts/ss_get_by_ssh.php.cnf | |
<?php | |
$ssh_user = 'cacti'; | |
$ssh_iden = '-i /etc/cacti/id_rsa'; | |
?> | |
CTRL-D | |
sudo su - www-data -c 'env -i php /usr/share/cacti/site/scripts/ss_get_by_ssh.php --type memory --host 10.13.0.134 --items au,av' | |
# set poller cron to 1minute | |
sudo vi /etc/cron.d/cacti | |
#*/1 * * * * www-data php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you please tell me wat is the suitable plugin architecture version for Ubuntu 10.04 , and cacti 0.8.7 e ?