Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Wed Nov 26, 2014 8:28 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Installation cacti 0.8.7g on CentOS
PostPosted: Mon Aug 30, 2010 6:00 am 
Offline
Cacti User

Joined: Wed Aug 27, 2008 5:21 am
Posts: 64
Location: China
install:
Code:
wget http://forums.cacti.net/download/file.php?id=23781 -O cacti87g.sh
sh cacti87g.sh


Code:
#!/bin/sh

# Install cacti 0.8.7g on CentOS linux
# This shell will be auto install the following :
# 1) cacit 0.8.7g with :
#       data_source_deactivate.patch
#       graph_list_view.patch
#       html_output.patch
#       ldap_group_authenication.patch
#       script_server_command_line_parse.patch
#       ping.patch
#       poller_interval.patch
# 2) pa 2.9
# 3) spine 0.8.7g with:
#       unified_issues.patch
# 4) plugins :
#      settings v0.7
#      clog v1.6
#      monitor v1.2
#      realtime v0.43
#      cycle v1.2
#      thold v0.43
#      ntop v0.2
#      boost v4.3
#      discovery v1.1
#      weathermap v0.97a
#      flowview v0.6
#      mactrack v2.9
#      routerconfigs v0.3
#      syslog v1.21
#      aggregate v0.75
#      loginmod v1.0
#      docs v0.2
#      ReportIt v0.73
#      mobile v0.1
#      rrdclean v0.41
#      tools v0.3
#      ssl v0.1
#      domains v0.1
# 5) Ntop
# Make by Patrick.Ru @ China
# E-Mail : patrick.ru@hotmail.com
# Date : 25-Jun-2011

# config for the rpmforge-release
echo $(date) --\> configing for the rpmforge-release... >> /var/log/cacti_install.log
yum install -y wget
if [ "$HOSTTYPE" == "x86_64" ]; then
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/apt-0.5.15lorg3.94a-5.el5.rf.x86_64.rpm
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
elif [ "$HOSTTYPE" == "i386" ]; then
wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/apt-0.5.15lorg3.94a-5.el5.rf.i386.rpm
wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
fi
rpm -Uvh *.rpm
rm *.rpm
echo $(date) --\> configed for the rpmforge-release! >> /var/log/cacti_install.log

# install httpd
echo $(date) --\> installing httpd... >> /var/log/cacti_install.log
yum install -y httpd
chkconfig httpd on
service httpd start
echo $(date) --\> installed httpd! >> /var/log/cacti_install.log
# install mysql-server
echo $(date) --\> installing mysql-server... >> /var/log/cacti_install.log
yum install -y mysql-server
chkconfig mysqld on
service mysqld start
mysqladmin -u root password dbadmin
echo $(date) --\> installed mysql-server! >> /var/log/cacti_install.log
# install php
echo $(date) --\> installing php... >> /var/log/cacti_install.log
yum install -y php php-gd php-mysql php-cli php-ldap php-snmp php-mbstring php-mcrypt
chkconfig snmpd on
service snmpd start
echo $(date) --\> installed php! >> /var/log/cacti_install.log
# restart httpd service
echo $(date) --\> restarting httpd... >> /var/log/cacti_install.log
service httpd restart
echo $(date) --\> restarted httpd! >> /var/log/cacti_install.log
# install rrdtool
echo $(date) --\> installing rrdtool... >> /var/log/cacti_install.log
yum install -y rrdtool
echo $(date) --\> installed rrdtool! >> /var/log/cacti_install.log
# install net-snmp
echo $(date) --\> installing net-snmp-utils... >> /var/log/cacti_install.log
yum install -y net-snmp-utils
echo $(date) --\> installed net-snmp-utils! >> /var/log/cacti_install.log

# download cacit 0.8.7g and patch
if [ -d  /usr/src/cacti ]; then
   echo $(date) --\> folder: /usr/src/cacti is exist. >> /var/log/cacti_install.log
else
   mkdir /usr/src/cacti
   echo $(date) --\> create folder: /usr/src/cacti. >> /var/log/cacti_install.log
fi

cd /usr/src/cacti
if [ ! -f ./cacti-0.8.7g.tar.gz ];  then
   echo $(date) --\> downloading cacti-0.8.7g.tar.gz... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded cacti-0.8.7g.tar.gz! >> /var/log/cacti_install.log
   else
      rm -f cacti-0.8.7g.tar.gz
      echo $(date) --\> download cacti-0.8.7g.tar.gz fault! >> /var/log/cacti_install.log
      exit
   fi
else
  echo $(date) --\> cacti-0.8.7g.tar.gz is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./cacti-plugin-0.8.7g-PA-v2.9.tar.gz ];  then
   echo $(date) --\> downloading cacti-plugin-0.8.7g-PA-v2.9.tar.gz... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/pia/cacti-plugin-0.8.7g-PA-v2.9.tar.gz
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded cacti-plugin-0.8.7g-PA-v2.9.tar.gz! >> /var/log/cacti_install.log
   else
      rm -f cacti-plugin-0.8.7g-PA-v2.9.tar.gz
      echo $(date) --\> download cacti-plugin-0.8.7g-PA-v2.9.tar.gz fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> cacti-plugin-0.8.7g-PA-v2.9.tar.gz is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./data_source_deactivate.patch ];  then
   echo $(date) --\> downloading data_source_deactivate.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/patches/0.8.7g/data_source_deactivate.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded data_source_deactivate.patch! >> /var/log/cacti_install.log
   else
      rm -f data_source_deactivate.patch
      echo $(date) --\> download data_source_deactivate.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> data_source_deactivate.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./graph_list_view.patch ];  then
   echo $(date) --\> downloading graph_list_view.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/patches/0.8.7g/graph_list_view.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded graph_list_view.patch! >> /var/log/cacti_install.log
   else
      rm -f graph_list_view.patch
      echo $(date) --\> download graph_list_view.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> graph_list_view.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./html_output.patch ];  then 
   echo $(date) --\> downloading html_output.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/patches/0.8.7g/html_output.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded html_output.patch! >> /var/log/cacti_install.log
   else
      rm -f html_output.patch
      echo $(date) --\> download html_output.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> html_output.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./ldap_group_authenication.patch ];  then 
   echo $(date) --\> downloading ldap_group_authenication.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/patches/0.8.7g/ldap_group_authenication.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded ldap_group_authenication.patch! >> /var/log/cacti_install.log
   else
      rm -f ldap_group_authenication.patch
      echo $(date) --\> download ldap_group_authenication.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> ldap_group_authenication.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./script_server_command_line_parse.patch ];  then
   echo $(date) --\> downloading script_server_command_line_parse.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/patches/0.8.7g/script_server_command_line_parse.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded script_server_command_line_parse.patch! >> /var/log/cacti_install.log
   else
      rm -f script_server_command_line_parse.patch
      echo $(date) --\> download script_server_command_line_parse.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> script_server_command_line_parse.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./ping.patch ];  then
   echo $(date) --\> downloading ping.patch... >> /var/log/cacti_install.log
   wget -N http://www.cacti.net/downloads/patches/0.8.7g/ping.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded ping.patch! >> /var/log/cacti_install.log
   else
      rm -f ping.patch
      echo $(date) --\> download ping.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> ping.patch is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./poller_interval.patch ];  then
   echo $(date) --\> downloading poller_interval.patch... >> /var/log/cacti_install.log
   wget -N http://www.cacti.net/downloads/patches/0.8.7g/poller_interval.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded poller_interval.patch! >> /var/log/cacti_install.log
   else
      rm -f poller_interval.patch
      echo $(date) --\> download poller_interval.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> poller_interval.patch is exist! >> /var/log/cacti_install.log
fi

# extract and patch cacti-0.8.7g
echo $(date) --\> extracting cacti-0.8.7g.tar.gz... >> /var/log/cacti_install.log
tar zxvf cacti-0.8.7g.tar.gz
if [ $? = 0 ]; then
   echo $(date) --\> extracted cacti-0.8.7g.tar.gz! >> /var/log/cacti_install.log
else
   rm -rf cacti-0.8.7g
   echo $(date) --\> extract cacti-0.8.7g.tar.gz fault! >> /var/log/cacti_install.log
   exit
fi   
echo $(date) --\> extracting cacti-plugin-0.8.7g-PA-v2.9.tar.gz... >> /var/log/cacti_install.log
tar zxvf cacti-plugin-0.8.7g-PA-v2.9.tar.gz
if [ $? = 0 ]; then
   echo $(date) --\> extracted cacti-plugin-0.8.7g-PA-v2.9.tar.gz! >> /var/log/cacti_install.log
else
   rm -rf cacti-plugin-arch
   echo $(date) --\> extract cacti-plugin-0.8.7g-PA-v2.9.tar.gz fault! >> /var/log/cacti_install.log
   exit
fi

mv cacti-0.8.7g/* /var/www/html/
rm -rf cacti-0.8.7g
cd /var/www/html

echo $(date) --\> patching file data_source_deactivate.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/data_source_deactivate.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file data_source_deactivate.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file data_source_deactivate.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file graph_list_view.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/graph_list_view.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file graph_list_view.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file graph_list_view.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file html_output.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/html_output.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file html_output.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file html_output.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file ldap_group_authenication.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/ldap_group_authenication.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file ldap_group_authenication.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file ldap_group_authenication.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file script_server_command_line_parse.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/script_server_command_line_parse.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file script_server_command_line_parse.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file script_server_command_line_parse.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file ping.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/ping.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file ping.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file ping.patch fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> patching file poller_interval.patch... >> /var/log/cacti_install.log
patch -p1 -N < /usr/src/cacti/poller_interval.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file poller_interval.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file poller_interval.patch fault! >> /var/log/cacti_install.log
   exit
fi

# patch for pa 2.9
echo $(date) --\> patching file cacti-plugin-0.8.7g-PA-v2.9.diff... >> /var/log/cacti_install.log
patch -p1 -N --dry-run < /usr/src/cacti/cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.9.diff
if [ $? = 0 ]; then
   patch -p1 -N < /usr/src/cacti/cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.9.diff
   if [ $? = 0 ]; then
      echo $(date) --\> patched file cacti-plugin-0.8.7g-PA-v2.9.diff! >> /var/log/cacti_install.log
   else
      echo $(date) --\> patch file cacti-plugin-0.8.7g-PA-v2.9.diff fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> pre-patch file cacti-plugin-0.8.7g-PA-v2.9.diff fault! >> /var/log/cacti_install.log
   exit
fi

# create database for cacti
echo $(date) --\> Creating database cacti... >> /var/log/cacti_install.log
mysql -u root -pdbadmin -e 'CREATE DATABASE `cacti` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;'
if [ $? = 0 ]; then
   echo $(date) --\> Created database cacti! >> /var/log/cacti_install.log
else
   echo $(date) --\> Create database cacti fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> Creating database user cactiuser... >> /var/log/cacti_install.log
mysql -u root -pdbadmin -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
if [ $? = 0 ]; then
   echo $(date) --\> Created database user cactiuser! >> /var/log/cacti_install.log
else
   echo $(date) --\> Create database user cactiuser fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> Granting database permission... >> /var/log/cacti_install.log
mysql -u root -pdbadmin -e 'GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'localhost';'
if [ $? = 0 ]; then
   echo $(date) --\> Granted database permission! >> /var/log/cacti_install.log
else
   echo $(date) --\> Grant database permission fault! >> /var/log/cacti_install.log
   exit
fi
# import cacti database
echo $(date) --\> Importing cacti.sql... >> /var/log/cacti_install.log
mysql -u cactiuser -pcactiuser cacti < /var/www/html/cacti.sql
if [ $? = 0 ]; then
   echo $(date) --\> Imported cacti.sql! >> /var/log/cacti_install.log
else
   echo $(date) --\> Import cacti.sql fault! >> /var/log/cacti_install.log
   exit
fi
# import PLA database
echo $(date) --\> Importing pa.sql... >> /var/log/cacti_install.log
mysql -u cactiuser -pcactiuser cacti < /usr/src/cacti/cacti-plugin-arch/pa.sql
if [ $? = 0 ]; then
   echo $(date) --\> Imported pa.sql! >> /var/log/cacti_install.log
else
   echo $(date) --\> Import pa.sql fault! >> /var/log/cacti_install.log
   exit
fi
# setting folder permission
chown -R apache:apache /var/www/html/
/etc/init.d/httpd restart

# create crond job for cacti
if [ ! -f /etc/cron.d/cacti ]; then
   touch /etc/cron.d/cacti
   echo "*/5 * * * * apache php /var/www/html/poller.php >/dev/null 2>&1" > /etc/cron.d/cacti
   echo $(date) --\> Create cron for cacti! >> /var/log/cacti_install.log
else
   echo $(date) --\> /etc/cron.d/cacti is exist! no update! >> /var/log/cacti_install.log
fi

# install compile tools for compiling spine
echo $(date) --\> installing compile tools for compile spine... >> /var/log/cacti_install.log
yum install -y gcc-c++ libtool net-snmp-devel openssl-devel mysql mysql-devel
echo $(date) --\> installed compile tools for compile spine! >> /var/log/cacti_install.log

# download spine and patch
cd /usr/src/cacti
if [ ! -f ./cacti-spine-0.8.7g.tar.gz ];  then
   echo $(date) --\> downloading cacti-spine-0.8.7g.tar.gz... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded cacti-spine-0.8.7g.tar.gz! >> /var/log/cacti_install.log
   else
      rm -f cacti-spine-0.8.7g.tar.gz
      echo $(date) --\> download cacti-spine-0.8.7g.tar.gz fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> cacti-spine-0.8.7g.tar.gz is exist! >> /var/log/cacti_install.log
fi
if [ ! -f ./unified_issues.patch ];  then
   echo $(date) --\> downloading unified_issues.patch... >> /var/log/cacti_install.log
   wget http://www.cacti.net/downloads/spine/patches/0.8.7g/unified_issues.patch
   if [ $? = 0 ]; then
      echo $(date) --\> downloaded unified_issues.patch! >> /var/log/cacti_install.log
   else
      rm -f unified_issues.patch
      echo $(date) --\> download unified_issues.patch fault! >> /var/log/cacti_install.log
      exit
   fi
else
   echo $(date) --\> unified_issues.patch is exist! >> /var/log/cacti_install.log
fi

# extract and patch spine-0.8.7g
echo $(date) --\> extracting cacti-spine-0.8.7g.tar.gz... >> /var/log/cacti_install.log
tar zxvf cacti-spine-0.8.7g.tar.gz
if [ $? = 0 ]; then
   echo $(date) --\> extracted cacti-spine-0.8.7g.tar.gz! >> /var/log/cacti_install.log
else
   rm -rf cacti-0.8.7g
   echo $(date) --\> extract cacti-spine-0.8.7g.tar.gz fault! >> /var/log/cacti_install.log
   exit
fi
cd cacti-spine-0.8.7g
echo $(date) --\> patching file unified_issues.patch... >> /var/log/cacti_install.log
patch -p1 -N < ../unified_issues.patch
if [ $? = 0 ]; then
   echo $(date) --\> patched file unified_issues.patch! >> /var/log/cacti_install.log
else
   echo $(date) --\> patch file unified_issues.patch fault! >> /var/log/cacti_install.log
   exit
fi

# compile spine 0.8.7g
echo $(date) --\> configuring spine 0.8.7g... >> /var/log/cacti_install.log
./configure
if [ $? = 0 ]; then
   echo $(date) --\> configured spine 0.8.7g! >> /var/log/cacti_install.log
else
   echo $(date) --\> configured spine 0.8.7g fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> making spine 0.8.7g... >> /var/log/cacti_install.log
make
if [ $? = 0 ]; then
   echo $(date) --\> made spine 0.8.7g! >> /var/log/cacti_install.log
else
   echo $(date) --\> made spine 0.8.7g fault! >> /var/log/cacti_install.log
   exit
fi
echo $(date) --\> installing spine 0.8.7g... >> /var/log/cacti_install.log
make install
if [ $? = 0 ]; then
   echo $(date) --\> installed spine 0.8.7g! >> /var/log/cacti_install.log
   cp /usr/local/spine/etc/spine.conf.dist  /usr/local/spine/etc/spine.conf
else
   echo $(date) --\> installed spine 0.8.7g fault! >> /var/log/cacti_install.log
fi

# install plugins for cacti 0.8.7g
cd /usr/src/cacti
# install settings v0.7-1
echo $(date) --\> installing settings... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:settings-v0.7-1.tgz -O settings.tgz
tar zxvf settings*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/settings ];then
   echo $(date) --\> installed settings! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed settings fault! >> /var/log/cacti_install.log
fi
# install clog v1.6-1
echo $(date) --\> installing clog... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:clog-v1.6-1.tgz -O clog.tgz
tar zxvf clog*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/clog ];then
   echo $(date) --\> installed clog! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed clog fault! >> /var/log/cacti_install.log
fi
# install monitor v1.2-1
echo $(date) --\> installing monitor... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:monitor-v1.2-1.tgz -O monitor.tgz
tar zxvf monitor*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/monitor ];then
   echo $(date) --\> installed monitor! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed monitor fault! >> /var/log/cacti_install.log
fi
# install realtime v0.43-1
echo $(date) --\> installing realtime... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:realtime-v0.43-1.tgz -O realtime.tgz
tar zxvf realtime*.tgz -C /var/www/html/plugins
mkdir /var/www/html/plugins/realtime/cache
if [ -e /var/www/html/plugins/realtime ];then
   echo $(date) --\> installed realtime! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed realtime fault! >> /var/log/cacti_install.log
fi
# install cycle v1.2-1
echo $(date) --\> installing cycle... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:cycle-v1.2-1.tgz -O cycle.tgz
tar zxvf cycle*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/cycle ];then
   echo $(date) --\> installed cycle! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed cycle fault! >> /var/log/cacti_install.log
fi
# install thold v0.43
echo $(date) --\> installing thold... >> /var/log/cacti_install.log
wget http://cactiusers.org/downloads/thold.tar.gz
tar zxvf thold*.tar.gz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/thold ];then
   echo $(date) --\> installed thold! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed thold fault! >> /var/log/cacti_install.log
fi
# install ntop v0.2-1
echo $(date) --\> install ntop... >> /var/log/cacti_install.log
yum install ntop -y
if [ $? = 0 ]; then
   ntop --set-admin-password=ntopadmin
   echo "/usr/bin/ntop > /dev/null 2>&1" >> /etc/rc.d/rc.local
   ntop&
   echo $(date) --\> installed ntop! >> /var/log/cacti_install.log
   echo $(date) --\> installing ntop... >> /var/log/cacti_install.log
   wget http://docs.cacti.net/_media/plugin:ntop-v0.2-1.tgz -O ntop.tgz
   tar zxvf ntop*.tgz -C /var/www/html/plugins
   if [ -e /var/www/html/plugins/ntop ];then
      echo $(date) --\> installed ntop! >> /var/log/cacti_install.log
   else
      echo $(date) --\> installed ntop fault! >> /var/log/cacti_install.log
   fi
else
   echo $(date) --\> installed ntop fault! >> /var/log/cacti_install.log
fi
# install boost v4.3-1
echo $(date) --\> installing boost... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:boost-v4.3-1.tgz -O boost.tgz
tar zxvf boost*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/boost ];then
   echo $(date) --\> installed boost! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed boost fault! >> /var/log/cacti_install.log
fi
# install discovery v1.1-1
echo $(date) --\> installing discovery... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:discovery-v1.1-1.tgz -O discovery.tgz
tar zxvf discovery*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/discovery ];then
   echo $(date) --\> installed discovery! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed discovery fault! >> /var/log/cacti_install.log
fi
# install weathermap v0.97a
echo $(date) --\> installing weathermap... >> /var/log/cacti_install.log
yum install -y unzip
wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip
unzip php-weathermap-0.97a.zip -d /var/www/html/plugins/
if [ -e /var/www/html/plugins/weathermap ];then
   echo $(date) --\> installed weathermap! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed weathermap fault! >> /var/log/cacti_install.log
fi
# install flowview v0.6
echo $(date) --\> installing flowview... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:flowview-latest.tgz -O flowview.tgz
tar zxvf flowview*.tgz -C /var/www/html/plugins
mv -f /var/www/html/plugins/flowview* /var/www/html/plugins/flowview
if [ -e /var/www/html/plugins/flowview ];then
   echo $(date) --\> installed flowview! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed flowview fault! >> /var/log/cacti_install.log
fi
# install mactrack v2.9-1
echo $(date) --\> installing mactrack... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz -O mactrack.tgz
tar zxvf mactrack*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/mactrack ];then
   echo $(date) --\> installed mactrack! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed mactrack fault! >> /var/log/cacti_install.log
fi
# install routerconfigs v0.3-1
echo $(date) --\> installing routerconfigs... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:routerconfigs-v0.3-1.tgz -O routerconfigs.tgz
tar zxvf routerconfigs*.tgz -C /var/www/html/plugins
mkdir /var/www/html/plugins/routerconfigs/backups
if [ -e /var/www/html/plugins/routerconfigs ];then
   echo $(date) --\> installed routerconfigs! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed routerconfigs fault! >> /var/log/cacti_install.log
fi
# install syslog v1.21-1
echo $(date) --\> installing syslog... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:syslog-v1.21-1.tgz -O syslog.tgz
tar zxvf syslog*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/syslog ];then
   echo $(date) --\> installed syslog! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed syslog fault! >> /var/log/cacti_install.log
fi
# install aggregate v0.75
echo $(date) --\> installing aggregate... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:aggregate-v0.75.tgz -O aggregate.tgz
tar zxvf aggregate*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/aggregate ];then
   echo $(date) --\> installed aggregate! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed aggregate fault! >> /var/log/cacti_install.log
fi
# install loginmod v1.0
echo $(date) --\> installing loginmod... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:loginmod-latest.tgz -O loginmod.tgz
tar zxvf loginmod*.tgz -C /var/www/html/plugins
mv -f /var/www/html/plugins/loginmod* /var/www/html/plugins/loginmod
if [ -e /var/www/html/plugins/loginmod ];then
   echo $(date) --\> installed loginmod! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed loginmod fault! >> /var/log/cacti_install.log
fi
# install docs v0.2
echo $(date) --\> installing docs... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:docs_v0.2.tar.gz -O docs.tar.gz
tar zxvf docs*.tar.gz -C /var/www/html/plugins
mv -f /var/www/html/plugins/docs* /var/www/html/plugins/docs
if [ -e /var/www/html/plugins/docs ];then
   echo $(date) --\> installed docs! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed docs fault! >> /var/log/cacti_install.log
fi
# install ReportIt v0.73
echo $(date) --\> installing ReportIt... >> /var/log/cacti_install.log
wget http://nchc.dl.sourceforge.net/project/cacti-reportit/cacti-reportit/reportit_v073/reportit_v073.tar.gz -O reportit.tar.gz
tar zxvf reportit*.tar.gz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/reportit ];then
   echo $(date) --\> installed ReportIt! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed ReportIt fault! >> /var/log/cacti_install.log
fi
# install mobile v0.1
echo $(date) --\> installing mobile... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:mobile-latest.tgz -O mobile.tgz
tar zxvf mobile*.tgz -C /var/www/html/plugins
mv -f /var/www/html/plugins/mobile* /var/www/html/plugins/mobile
if [ -e /var/www/html/plugins/mobile ];then
   echo $(date) --\> installed mobile! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed mobile fault! >> /var/log/cacti_install.log
fi
# install rrdclean v0.41
echo $(date) --\> installing rrdclean... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:rrdclean-v0.41.tgz -O rrdclean.tgz
tar zxvf rrdclean*.tgz -C /var/www/html/plugins
mkdir -p /var/www/rra/backup
mkdir -p /var/www/rra/archive
if [ -e /var/www/html/plugins/rrdclean ];then
   echo $(date) --\> installed rrdclean! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed rrdclean fault! >> /var/log/cacti_install.log
fi
# install tools v0.3
echo $(date) --\> installing tools... >> /var/log/cacti_install.log
wget http://cactiusers.org/downloads/tools.tar.gz
tar zxvf tools*.tar.gz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/tools ];then
   echo $(date) --\> installed tools! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed tools fault! >> /var/log/cacti_install.log
fi
# install ssl v0.1
echo $(date) --\> installing ssl... >> /var/log/cacti_install.log
wget http://cactiusers.org/downloads/ssl.tar.gz
tar zxvf ssl*.tar.gz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/ssl ];then
   echo $(date) --\> installed ssl! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed ssl fault! >> /var/log/cacti_install.log
fi
# install domains v0.1-1
echo $(date) --\> installing domains... >> /var/log/cacti_install.log
wget http://docs.cacti.net/_media/plugin:domains-v0.1-1.tgz -O domains.tgz
tar zxvf domains*.tgz -C /var/www/html/plugins
if [ -e /var/www/html/plugins/domains ];then
   echo $(date) --\> installed domains! >> /var/log/cacti_install.log
else
   echo $(date) --\> installed domains fault! >> /var/log/cacti_install.log
fi
# setting the plugins files's permission
chown -R apache:apache /var/www/html/

echo $(date) --\> All install finised! >> /var/log/cacti_install.log



Attachments:
cacti-pa-spine@centos.sh [27.28 KiB]
Downloaded 374 times


Last edited by nationals on Sat Jun 25, 2011 8:50 am, edited 12 times in total.
Top
 Profile  
 
 Post subject: Re: Installation spine 0.8.7g on CentOS
PostPosted: Mon Aug 30, 2010 8:00 am 
Offline
Cacti User

Joined: Wed Aug 27, 2008 5:21 am
Posts: 64
Location: China
Code:
# change the interval to 1 minute for RHEL/CentOS
mysql -u cactiuser -pcactiuser -e 'use cacti; update data_template_data set rrd_step=60 where rrd_step=300;'
mysql -u cactiuser -pcactiuser -e "use cacti; update settings set value=60 where name='poller_interval';"
mysql -u cactiuser -pcactiuser -e "use cacti; update settings set value=60 where name='cron_interval';"
if [ -f /etc/cron.d/cacti ]; then
   rm -rf /etc/cron.d/cacti
fi
echo "*/1 * * * * apache php /var/www/html/poller.php >/dev/null 2>&1" > /etc/cron.d/cacti
rm -rf `find /var/www/html/rra |grep rrd`



Last edited by nationals on Sun Jun 26, 2011 2:28 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: i686 compiled
PostPosted: Tue Aug 31, 2010 1:23 am 
Offline
Cacti User

Joined: Wed Aug 27, 2008 5:21 am
Posts: 64
Location: China
Code:
wget http://forums.cacti.net/download.php?id=21625 -O spine.tgz
tar zxvf spine.tgz -C /usr/local
cp /usr/local/spine/etc/spine.conf.dist  /usr/local/spine/etc/spine.conf


Attachments:
spine.tgz [93.4 KiB]
Downloaded 229 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2010 9:24 am 
Offline

Joined: Mon Feb 02, 2009 10:21 am
Posts: 28
Location: CHINA
I installed MySQL-client-community-5.1.50-1.rhel5.x86_64.rpm & MySQL-server-community-5.1.50-1.rhel5.x86_64.rpm on centos 5.5 final.

But I get the error when install php-mysql by yum.
[root@localhost tmp]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.candishosting.com.cn
* base: mirror01.idc.hinet.net
* extras: mirror01.idc.hinet.net
* updates: mirror01.idc.hinet.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.1.6-27.el5 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: php-mysql
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: php-mysql
--> Running transaction check
---> Package mysql.x86_64 0:5.0.77-4.el5_5.3 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
---> Package php-pdo.x86_64 0:5.1.6-27.el5 set to be updated
--> Running transaction check
---> Package perl-DBI.x86_64 0:1.52-2.el5 set to be updated
--> Processing Conflict: mysql conflicts MySQL
--> Finished Dependency Resolution
mysql-5.0.77-4.el5_5.3.x86_64 from updates has depsolving problems
--> mysql conflicts with MySQL-server-community
Error: mysql conflicts with MySQL-server-community
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package

Any ideas to deal with it?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2010 10:19 am 
Offline

Joined: Tue May 19, 2009 5:20 pm
Posts: 31
nationals, I'm curious if your script is installing rpmforge package, why not just also install cacti+friends rpms from there? why go source tgz route?
as of right now rpmforge has
cacti-0.8.7g-2.el5.rf
cacti-spine-0.8.7a-1.el5.rf
cacti-docs-0.8.7g-2.el5.rf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 14, 2010 10:46 am 
Offline
Cacti User

Joined: Wed Aug 27, 2008 5:21 am
Posts: 64
Location: China
it is just a shell when I test before 87g publish.

and then use the friend rpm source site, it can not intall 87g.

so, it is just for reference.

:)


Top
 Profile  
 
 Post subject: Re: Installation cacti 0.8.7g on CentOS
PostPosted: Sat Jun 25, 2011 3:00 am 
Offline
Cacti User

Joined: Wed Aug 27, 2008 5:21 am
Posts: 64
Location: China
Code:
which wget
if [ $? != 0 ]; then
   echo pls install wget
   exit
fi
which patch
if [ $? != 0 ]; then
   echo pls install patch
   exit
fi

if [ ! -d  /usr/src/cacti ]; then
   mkdir /usr/src/cacti
fi
cd /usr/src/cacti

wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
wget http://www.cacti.net/downloads/pia/cacti-plugin-0.8.7g-PA-v2.9.tar.gz
wget http://www.cacti.net/downloads/patches/0.8.7g/data_source_deactivate.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/graph_list_view.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/html_output.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/ldap_group_authenication.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/script_server_command_line_parse.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/ping.patch
wget http://www.cacti.net/downloads/patches/0.8.7g/poller_interval.patch
tar zxvf cacti-0.8.7g.tar.gz
tar zxvf cacti-plugin-0.8.7g-PA-v2.9.tar.gz
cd cacti-0.8.7g
patch -p1 -N < ../data_source_deactivate.patch
patch -p1 -N < ../graph_list_view.patch
patch -p1 -N < ../html_output.patch
patch -p1 -N < ../ldap_group_authenication.patch
patch -p1 -N < ../script_server_command_line_parse.patch
patch -p1 -N < ../ping.patch
patch -p1 -N < ../poller_interval.patch
patch -p1 -N < ../cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.9.diff
cd ..
# install settings v0.7-1
wget http://docs.cacti.net/_media/plugin:settings-v0.7-1.tgz -O settings.tgz
tar zxvf settings*.tgz -C cacti-0.8.7g/plugins
# install clog v1.6-1
wget http://docs.cacti.net/_media/plugin:clog-v1.6-1.tgz -O clog.tgz
tar zxvf clog*.tgz -C cacti-0.8.7g/plugins
# install monitor v1.2-1
wget http://docs.cacti.net/_media/plugin:monitor-v1.2-1.tgz -O monitor.tgz
tar zxvf monitor*.tgz -C cacti-0.8.7g/plugins
# install thold v0.43
wget http://cactiusers.org/downloads/thold.tar.gz
tar zxvf thold*.tar.gz -C cacti-0.8.7g/plugins

_________________
BBM:22038F53


Top
 Profile  
 
 Post subject: Re: Installation cacti 0.8.7g on CentOS
PostPosted: Sat Jun 25, 2011 9:54 am 
Offline

Joined: Sat Jun 25, 2011 9:22 am
Posts: 8
Hi,
i am new to Cacti. i am configuring cacti by this links.

http://www.cyberciti.biz/faq/fedora-rhel-install-cacti-monitoring-rrd-software/

i am stuck at this command

#####################################
rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.7g/cacti.sql
#######################################


[root@localhost ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7g/cacti.sql
Enter password: PASSWORD
ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 6
############################################################################3

not able to understand whats this error is. please point me to right direction.

thanks


Top
 Profile  
 
 Post subject: Re: Installation cacti 0.8.7g on CentOS
PostPosted: Sat Jun 25, 2011 3:51 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Well, it does not help to crosspost multiple times.
R.

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group