quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

nationals
Cacti User
Posts: 76
Joined: Wed Aug 27, 2008 5:21 am
Location: China
Contact:

quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by nationals »

we should put less time on the installation, and more time for cacti application.

Code: Select all

#!/bin/sh
# Testing script for install cacti 0.8.7i and spine 0.8.7i on Centos Linux Release 6.x
# Version : 1.0.4
# Make by Patrick.Ru @ China
# E-Mail : patrick.ru@hotmail.com
# Date : 28-Dec-2011


chkconfig iptables off
service iptables stop
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
/usr/sbin/setenforce 0

yum update -y
yum install -y wget
mkdir -p /usr/src/cacti
cd /usr/src/cacti
yum install -y httpd
chkconfig httpd on
service httpd start
yum install -y mysql-server
chkconfig mysqld on
service mysqld start
mysqladmin -u root password dbadmin
yum install -y php php-gd php-mysql php-cli php-ldap php-snmp php-mbstring php-mcrypt
service httpd restart
yum install -y rrdtool 
yum install -y net-snmp-utils 
yum install -y tftp-server
chkconfig xinetd on
service xinetd start
wget http://www.cacti.net/downloads/cacti-0.8.7i-PIA-3.1.tar.gz
tar zxvf cacti-0.8.7i-PIA-3.1.tar.gz
wget http://www.cacti.net/downloads/patches/0.8.7i/settings_checkbox.patch
cd cacti-0.8.7i-PIA-3.1
patch -p1 -N < ../settings_checkbox.patch
cd ..
mv -f cacti-0.8.7i-PIA-3.1/* /var/www/html/
rm -rf cacti-0.8.7i-PIA-3.1
chown -R apache:apache /var/www/html/
service httpd restart
mysql -u root -pdbadmin -e 'CREATE DATABASE `cacti` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;'
mysql -u root -pdbadmin -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
mysql -u root -pdbadmin -e 'GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'localhost';'
mysql -u cactiuser -pcactiuser cacti < /var/www/html/cacti.sql
echo "*/5 * * * * apache /usr/bin/php /var/www/html/poller.php > /dev/null 2>&1" > /etc/cron.d/cacti
yum install -y gcc gcc-c++ make automake patch libtool net-snmp-devel openssl-devel mysql mysql-devel
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7i.tar.gz
tar zxvf cacti-spine-0.8.7i.tar.gz
cd cacti-spine-0.8.7i
./configure 
make && make install
cp /usr/local/spine/etc/spine.conf.dist  /usr/local/spine/etc/spine.conf
cd /usr/src/cacti
wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz -O settings.tgz
tar zxvf settings*.tgz -C /var/www/html/plugins
chown -R apache:apache /var/www/html/plugins/settings
wget http://docs.cacti.net/_media/plugin:clog-v1.7-1.tgz -O clog.tgz 
tar zxvf clog*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/clog
wget http://docs.cacti.net/_media/plugin:thold-v0.4.9-3.tgz -O thold.tgz 
tar zxvf thold*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/thold
wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz -O monitor.tgz
tar zxvf monitor*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/monitor
wget http://docs.cacti.net/_media/plugin:realtime-v0.5-1.tgz -O realtime.tgz
tar zxvf realtime*.tgz -C /var/www/html/plugins
mkdir -p /var/www/html/plugins/realtime/cache
chown -R apache:apache /var/www/html/plugins/realtime
bedro
Posts: 1
Joined: Fri Oct 01, 2010 4:39 am

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by bedro »

Excellent script!!! Thank you!!!
jcb
Posts: 29
Joined: Thu May 19, 2011 10:14 pm

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by jcb »

Very, very good. Thank you, it will facilitate our life! I suggest a small amendment already that when spun at turn the script, he has not installed the rrdtool. Then:

wget http://packages.sw.be/rpmforge-release/ ... f.i386.rpm
rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
yum install rrdtool rrdtool-devel -y
hanizam
Posts: 1
Joined: Fri Jan 06, 2012 3:14 am

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by hanizam »

Hi...

I really new to cacti and centos...

I don't know how to run this script.. and what i do is type/paste the command one by one (every row) on my terminal...
And thanks alot it works!...

The only problem is...
My graph didn't plot any data...

Can anyone help me...
dboillot
Posts: 5
Joined: Wed Apr 28, 2010 1:50 pm

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by dboillot »

Anyway to make this install to a /var/www/html/cacti folder?
kercring
Posts: 1
Joined: Fri Feb 17, 2012 3:46 pm

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by kercring »

Excellent script!
Thanks so much.
For newbies like me. When you attempt to login to cacti you'll be asked for a username and password. Try the default
admin
admin
dexx
Posts: 28
Joined: Thu Jan 13, 2011 12:45 am

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by dexx »

If there are any refinements to this excellent script, please dont hesitate to post.
ssanders
Posts: 1
Joined: Fri Mar 09, 2012 2:29 pm

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by ssanders »

Worked wonderful but it didn't add

*/5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1

to /etc/crontab

Thanks for the script, saved me some time. :)
nationals
Cacti User
Posts: 76
Joined: Wed Aug 27, 2008 5:21 am
Location: China
Contact:

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by nationals »

hope it is really helpful for you.

BTW, rrdtool is include in the source of centos 6.x.

fix a mistake and reupload the sh file.

Code: Select all

echo >> /etc/cron.d/cacti <<EOF
*/5 * * * * apache /usr/bin/php /var/www/html/poller.php > /dev/null 2>&1"
to:

Code: Select all

cat > /etc/cron.d/cacti <<EOF
*/5 * * * * apache /usr/bin/php /var/www/html/poller.php > /dev/null 2>&1

Code: Select all

#!/bin/sh
# Testing script for install cacti 0.8.7i and spine 0.8.7i on Centos Linux Release 6.x
# Version : 1.0.5
# Make by Patrick.Ru @ China
# E-Mail : patrick.ru@hotmail.com
# Date : 10-Mar-2011


chkconfig iptables off
service iptables stop
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
/usr/sbin/setenforce 0

yum update -y
yum install -y wget
mkdir -p /usr/src/cacti
cd /usr/src/cacti
yum install -y httpd
chkconfig httpd on
service httpd start
yum install -y mysql-server
chkconfig mysqld on
service mysqld start
mysqladmin -u root password dbadmin
yum install -y php php-gd php-mysql php-cli php-ldap php-snmp php-mbstring php-mcrypt
service httpd restart
yum install -y rrdtool 
yum install -y net-snmp-utils 
yum install -y tftp-server
chkconfig xinetd on
service xinetd start
wget http://www.cacti.net/downloads/cacti-0.8.7i-PIA-3.1.tar.gz
tar zxvf cacti-0.8.7i-PIA-3.1.tar.gz
wget http://www.cacti.net/downloads/patches/0.8.7i/settings_checkbox.patch
cd cacti-0.8.7i-PIA-3.1
yum install -y patch
patch -p1 -N < ../settings_checkbox.patch
cd ..
mv -f cacti-0.8.7i-PIA-3.1/* /var/www/html/
rm -rf cacti-0.8.7i-PIA-3.1
chown -R apache:apache /var/www/html/
service httpd restart
mysql -u root -pdbadmin -e 'CREATE DATABASE `cacti` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;'
mysql -u root -pdbadmin -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
mysql -u root -pdbadmin -e 'GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'localhost';'
mysql -u cactiuser -pcactiuser cacti < /var/www/html/cacti.sql
cat > /etc/cron.d/cacti <<EOF
*/5 * * * * apache /usr/bin/php /var/www/html/poller.php > /dev/null 2>&1
EOF
yum install -y gcc gcc-c++ make automake patch libtool net-snmp-devel openssl-devel mysql mysql-devel
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7i.tar.gz
tar zxvf cacti-spine-0.8.7i.tar.gz
cd cacti-spine-0.8.7i
./configure 
make && make install
cp /usr/local/spine/etc/spine.conf.dist  /usr/local/spine/etc/spine.conf
cd /usr/src/cacti
wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz -O settings.tgz
tar zxvf settings*.tgz -C /var/www/html/plugins
chown -R apache:apache /var/www/html/plugins/settings
wget http://docs.cacti.net/_media/plugin:clog-v1.7-1.tgz -O clog.tgz 
tar zxvf clog*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/clog
wget http://docs.cacti.net/_media/plugin:thold-v0.4.9-3.tgz -O thold.tgz 
tar zxvf thold*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/thold
wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz -O monitor.tgz
tar zxvf monitor*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/monitor
wget http://docs.cacti.net/_media/plugin:realtime-v0.5-1.tgz -O realtime.tgz
tar zxvf realtime*.tgz -C /var/www/html/plugins
mkdir -p /var/www/html/plugins/realtime/cache
chown -R apache:apache /var/www/html/plugins/realtime
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/
chown -R apache:apache /var/www/html/plugins/weathermap
wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz -O mactrack.tgz
tar zxvf mactrack*.tgz -C /var/www/html/plugins 
chown -R apache:apache /var/www/html/plugins/mactrack
wget http://docs.cacti.net/_media/plugin:syslog-v1.22-2.tgz -O syslog.tgz
tar zxvf syslog*.tgz -C /var/www/html/plugins
chown -R apache:apache /var/www/html/plugins/syslog
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 -p /var/www/html/plugins/routerconfigs/backups
chown -R apache:apache /var/www/html/plugins/routerconfigs
wget http://docs.cacti.net/_media/plugin:docs-v0.4-1.tgz -O docs.tgz
tar zxvf docs*.tgz -C /var/www/html/plugins 
mv -f /var/www/html/plugins/docs* /var/www/html/plugins/docs
chown -R apache:apache /var/www/html/plugins/docs
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 
chown -R apache:apache /var/www/html/plugins/reportit
wget http://docs.cacti.net/_media/plugin:rrdclean-v0.41.tgz -O rrdclean.tgz 
tar zxvf rrdclean*.tgz -C /var/www/html/plugins
chown -R apache:apache /var/www/html/plugins/rrdclean
wget http://docs.cacti.net/_media/plugin:discovery-v1.5-1.tgz -O discovery.tgz
tar zxvf discovery*.tgz -C /var/www/html/plugins
chown -R apache:apache /var/www/html/plugins/discovery
if [ "$HOSTTYPE" == "x86_64" ]; then
wget http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/wmi-1.3.14-2.el6.art.x86_64.rpm
rpm -Uvh wmi-1.3.14-2.el6.art.x86_64.rpm
elif [ "$HOSTTYPE" == "i386" ]; then
wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/wmi-1.3.14-2.el6.art.i686.rpm
rpm -Uvh wmi-1.3.14-2.el6.art.i686.rpm
fi
wget http://svn.parkingdenied.com/CactiWMI/trunk/wmi.php -O /var/www/html/scripts/wmi.php
chown -R apache:apache /var/www/html/scripts/wmi.php
service httpd restart
Attachments
cacti_0.8.7i@CentOS6.sh
(4.97 KiB) Downloaded 622 times
Last edited by nationals on Sun Mar 11, 2012 8:58 am, edited 10 times in total.
nationals
Cacti User
Posts: 76
Joined: Wed Aug 27, 2008 5:21 am
Location: China
Contact:

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by nationals »

ssanders wrote:Worked wonderful but it didn't add

*/5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1

to /etc/crontab

Thanks for the script, saved me some time. :)

it will create in a new file : /etc/cron.d/cacti
nationals
Cacti User
Posts: 76
Joined: Wed Aug 27, 2008 5:21 am
Location: China
Contact:

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by nationals »

jcb wrote:Very, very good. Thank you, it will facilitate our life! I suggest a small amendment already that when spun at turn the script, he has not installed the rrdtool. Then:

wget http://packages.sw.be/rpmforge-release/ ... f.i386.rpm
rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
yum install rrdtool rrdtool-devel -y
rrdtool is include in the source of centos 6.x.

install rrdtool in centos 6.x, it can just use yum install to install it.

:)
nationals
Cacti User
Posts: 76
Joined: Wed Aug 27, 2008 5:21 am
Location: China
Contact:

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by nationals »

tools I modify.

think somebody has the need as mine.

:)

http://forums.cacti.net/viewtopic.php?t ... 35#p224135
shani4u
Posts: 1
Joined: Mon Jun 25, 2012 1:45 am

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by shani4u »

Hi experts...am new in linux & did installation of Cacti in CentOS.

But Graphs are not displayed..

i dodn't know y..? some body plz help on thisss....
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by gandalf »

shani4u wrote:Hi experts...am new in linux & did installation of Cacti in CentOS.

But Graphs are not displayed..

i dodn't know y..? some body plz help on thisss....
Please open a new thread and be more specific concerning your issue
R.
asapHO
Posts: 3
Joined: Wed Aug 08, 2012 5:38 am

Re: quick install cacti 0.8.7i and PIA 3.1 on CentOS 6.x

Post by asapHO »

Hi there,

I found that script and gave it a try. It worked pretty well and I am able to get a CACTI Installation up and running. Nevertheless, there are a few things, that I cannot explain right now. I've attached an output log on this post... don't be irritated from "already existing" messages because I tried to do a reinstall (dropping database, removing anything below /var/www/html)

PIA seems installed, but I cannot manage/activate any plugins, because the menu item is missing/not installed. Any ideas? (see screenshot)

I think it is worth to mention, that SPINE must be configured under settings -> Paths -> Spine Poller Path ( = /usr/local/spine/bin/spine ) and adjusted in Settings -> Poller

The Linux version I was trying to do the install is (Centos 6 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux)
Attachments
cactiinstall.zip
zipped logfile
(11.9 KiB) Downloaded 276 times
screenshot with missing plugins item
screenshot with missing plugins item
screenshot1.JPG (89.61 KiB) Viewed 17962 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest