HowTo: Cacti 8.8 Source Install on CentOS

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

Hi all! Finally I'm able to give something back to the community :)

Before I begin though, I must admit that I cannot take all of the credit for this "How To". I've only added small bits and pieces to a great "How To" I found on the internet, but can no longer find the original source unfortunately.

Please Note: I am not a Linux nor a Cacti expert, so if there are any unnecessary steps/installations, please let me know so that I can edit this How To accordingly. For example, I don't know if all of the packages listed below are required... I've basically put them together from several guides based on several different versions of Cacti and RRDTool.

Also Note: This is on a clean install which is why packages like gcc and nano are in the package install list.

Anyway, here goes :)


***************************************************
Step One:
***************************************************


Install packages for Cacti & RRDTool:

Code: Select all

yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils nano cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel gcc

yum update
***************************************************
Step Two:
***************************************************


Download Cacti & move it to your web server directory:

Code: Select all

cd /tmp
wget http://www.cacti.net/downloads/cacti-0.8.8.tar.gz
tar zxvf cacti-0.8.8.tar.gz
mv /tmp/cacti-0.8.8 /var/www/html/cacti
***************************************************
Step Three:
***************************************************


Reconfigure include/config.php path. Change it from / to /cacti/.

Note: Be sure to uncomment this line too by removing the //, as per the before and after example below.

Code: Select all

nano /var/www/html/cacti/include/config.php
FROM:

Code: Select all

//$url_path = "/";
TO:

Code: Select all

$url_path = "/cacti/";

***************************************************
Step Four:
***************************************************


Add a new user and then change the ownership and permissions of the rra and log directories.

Code: Select all

adduser cactiuser
chown -R cactiuser /var/www/html/cacti/rra
chown -R cactiuser /var/www/html/cacti/log
chmod 777 -R /var/www/html/cacti/rra
chmod 777 -R /var/www/html/cacti/log
***************************************************
Step Four:
***************************************************


Download and install RRDTool.

Code: Select all

cd /tmp
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar zxvf rrdtool.tar.gz

cd rrdtool-1.4.7

./configure

make prefix=/usr/local/ all

make prefix=/usr/local/ install
***************************************************
Step Five:
***************************************************


Start MySQL, Sendmail, snmpd and Apache, and make sure they start on boot:

Code: Select all

chkconfig httpd on --levels 235
chkconfig mysqld on --levels 235
chkconfig sendmail on --levels 235
chkconfig snmpd on --levels 235
service mysqld start
service httpd start
service sendmail start
service snmpd start 
***************************************************
Step Six:
***************************************************


Configuring MySQL

Code: Select all

/usr/bin/mysql_secure_installation
Then, you will be asked a few questions. Provide the following responses:

Code: Select all

current root password is <LEAVE BLANK>
set root password to: <ENTER PASSWORD>
remove anonymous users <YES>
disallow remote root login <YES>
remove test database <YES>
reload privilege tables <YES>
***************************************************
Step Seven:
***************************************************


Create the Cacti Database:

Code: Select all

mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
mysql -u root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser';
flush privileges;
exit
***************************************************
Step Eight:
***************************************************


Set up Cacti via the web interface:

Code: Select all

http://<ip_address>/cacti

***************************************************
Step Nine:
***************************************************


Add a cron job to make the Cacti poll every 5 minutes. Note: The username used here must be the same as the one created in Step 4.

Code: Select all

nano /etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
***************************************************
Step Ten:
***************************************************


If your "Localhost" is staying in the "Unknown" state and is not transitioning to the "Up" state, turn on SNMPv1 in its "Device Configuration" and change its "Downed Device Detection" to "SNMP Uptime".

***************************************************
Step Eleven:
***************************************************


Due to a bug in 8.8 (which will be resolved in 8.8a), users cannot import templates (see http://forums.cacti.net/viewtopic.php?f=2&t=47018 for more information). To resolve this issue, download global_arrays.php from the SVN here and put it in your <cacti_dir>/include/ directory.

***************************************************
All Done!
***************************************************


And now your done! :)

As mentioned above, if there are any unnecessary packages or if you have any suggestions, please let me know and I'll be happy to make the corrections.
Last edited by Voiper99 on Sun Apr 15, 2012 6:26 pm, edited 2 times in total.
User avatar
_raindrop18
Cacti User
Posts: 194
Joined: Thu Jan 29, 2009 5:52 pm
Location: US

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by _raindrop18 »

thanks for info. I am interested how you evaluate the new version. is there any issue experience and do you suggest for ready for production server? I am preparing to build new production Cacti server and I need some feedback. is there any hardware suggestion? I am planning to run on Cisco UCS server. any feedback from any one highly appreciated .
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

Not a problem at all.

In response to your question, I haven't used 8.8 enough to give you an informed answer, sorry. You would be better off speaking to others who have already done this. Perhaps start a new thread asking peoples' advice?

Good luck!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by gandalf »

Due to some issues, we are currently preparing a 088a version.
In case you're running 088 on linux and do use spine087i, all should be fine
R.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

Thanks for the information Gandalf. Just out of curiosity, any ideas when 88a will be released?
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

Just an FYI, I have added Step 11 to the tutorial above.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by gandalf »

Voiper99 wrote:Thanks for the information Gandalf. Just out of curiosity, any ideas when 88a will be released?
Soon :roll:
R.
stextor
Posts: 21
Joined: Thu May 10, 2007 12:01 pm

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by stextor »

In noticed that you too do the following setup:

adduser cactiuser ( I swear I never used to do this before, but now it seems necessary .. any feedback?)
chown -R cactiuser /var/www/html/cacti/rra ( I do this per documentation)
chown -R cactiuser /var/www/html/cacti/log
chmod 777 -R /var/www/html/cacti/rra ( I also do this because it seems to solve a lot of nan issues but it seems dangerous .. anyone know the correct way?)
chmod 777 -R /var/www/html/cacti/log (same here, I can't purge my log files unless I do this. I'm sure it's overkill .. anyone know the correct way?)

I ask these questions because I've had my rrd's eaten before out of the /var/www/cacti/rra folder and had to start over.

P.S. what do the --levels 235 options do?
Diddo
Posts: 1
Joined: Tue Oct 09, 2012 7:42 am

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Diddo »

Voiper99 wrote:Also Note: This is on a clean install which is why packages like gcc and nano are in the package install list.
If it is clean install you need to add some info about httpd.conf and also (I think) cacti.conf - I just followed your guide and Cacti (on latest Centos, just installed to test it) doesn't work. All steps were without errors, just in my browser after pointing to localhost/cacti/ I can see only info about lack of permissions. I am looking now for help in my case. Would be great If you could add missing steps to your quite nice how to :) Thanks in advance!
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

Thanks for the reply.

It has been a while since I've done a Cacti install, but I'm almost certain this guide works as I don't recall doing anything extra to get my setups working apart from what I have described above.
Diddo wrote: If it is clean install you need to add some info about httpd.conf and also (I think) cacti.conf
I have seen some people perform config changes for httpd, but I don't.

In regards to cacti.conf, take another look at Step Three and make sure you've made the /cacti/ change.
Diddo wrote: I can see only info about lack of permissions.
I don't recall ever seeing any "lack of permissions" errors. Perhaps take a look at Step Four above for permissions changes.

Or, if you have made httpd.conf changes before, perhaps you will need to make changes to allow users to access the Cacti web directory.

Sorry if my help isn't all that great, unfortunately I am not a Linux expert :(

Good luck though, and please feel free to post back if your still having trouble. I will see if I am able to assist further.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: HowTo: Cacti 8.8 Source Install on CentOS

Post by Voiper99 »

I did some searching and found this thread.

Changing the config slightly, you may find this works for you:

Code: Select all

nano /etc/httpd/conf.d/cacti.conf

    #
    # Cacti: An rrd based graphing tool
    #
    <Directory /var/www/html/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from all </Directory> 
However, as mentioned above I am no Linux expert, so if this doesn't fix your issue, delete the file.

If it doesn't work, can you please post the error message your seeing?

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests