Install script : Cacti 0.8.7g, Spine, PA, Patches

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

User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Install script : Cacti 0.8.7g, Spine, PA, Patches

Post by DeeL »

The next version of CAIS will be available here soon : http://www.deelsystems.com
2011.wow.

EDIT : What's new in Version 0.40c - 2011 January 24th :
- A major bugFix for Ubuntu users
- Officially works with Ubuntu 10.10

What does this script do :
With this script you can quickly install the latest versions of Cacti, Spine, PIA and select which of the following plugins you want to install.
It works on any Debian Lenny box & Ubuntu (at least from 9.10 to 10.10) on which you've never installed cacti.
- Cacti 0.8.7g + latest patches (as of 01 jan 2011) <= happy New Year folks
- Spine0.8.7g + unified patch (released 31 aug 2010)
- PA v2.9
- Settings plugin v0.7-1 (released 20 jul 2010)
- Cycle plugin v1.2-1 (released 01 sept 2010)
- Realtime plugin v0.43-1 (released 01 sept 2010)
- LoginMod plugin v1.0 (released 07 sept 2008)
- Monitor plugin v1.2-1 (released 17 aug 2010)
- Nectar plugin v0.30 (released 30 dec 2010)
- SpikeKill plugin v1.2-1 (released 06 sept 2010)
- Thold plugin v0.43 (released 01 jan 2011)
- NetworkWeathermap plugin v0.97a (released 09 mar 2010)
- Clog plugin v1.6-1 (released 01 sep 2010)
- Apache ModSecurity v2.5.11
- Apache ModSecurity Core Rule Set v2.1.1

Usage :
READ this FILE !!! README_CAIS_v0.40c.TXT

Code: Select all

cd ~
wget http://forums.cacti.net/download/file.php?id=22710 -O cacti_autoinstall_v0.40c.sh
wget http://forums.cacti.net/download/file.php?id=22711 -O README_CAIS_v0.40c.txt
cat ./README_CAIS_v0.40c.txt
chmod a+x cacti_autoinstall_v0.40c.sh
./cacti_autoinstall_v0.40c.sh
TODO :
- Test if cacti has already been installed with apt-get
- Keep improving security
- Make it handle the different patches available/to come, or at least update it when needed.
- Make it install more common plugins

COMING SOON :
- Syslog plugin
Attachments
README_CAIS_v0.40c.TXT
(4.38 KiB) Downloaded 3266 times
cacti_autoinstall_v0.40c.sh
(18.52 KiB) Downloaded 3792 times
Last edited by DeeL on Fri Mar 27, 2015 11:06 am, edited 89 times in total.
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Error

Post by emerson.fp »

Error at script:

after pacthing...

patching file utilities.php
ERROR 1045 (28000): Access denied for user 'cactiuser'@'localhost' (using password: YES)
Restarting web server: apache2 ... waiting .
cactiserver:~# cd /var/www/cacti/

And the page at browser display this error:

FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Post by emerson.fp »

Another error:

cacti-0.8.7g/data_queries.php
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'cactiuser'@'localhost' (using password: YES)
Restarting network management services: snmpd.
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Re: Error

Post by DeeL »

Hi,

My guesses are :
1/ - you already had a cacti installed (you didn't change the default passwords in the script)
2/- you already had installed mysql (you didn't change the default root password of the script accordingly)
3/- you've changed both cactiuser and/or root MYSQL passwords (and used special characters in passwords) at the begining of the script, repairing might be tricky, but let's try.

I'll provide today or tomorow a version of the script that allows changing these two passwords when installing.

For choice 3 try this :

1/ Reset both MYSQL passwords (use standard characters, you'll change them later):

Code: Select all

/etc/init.d/mysqld stop
mysqld --skip-grant-tables &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('PASS_FOR_ROOT') WHERE User='root';
UPDATE mysql.user SET Password=PASSWORD('PASS_FOR_CACTIUSER') WHERE User='cactiuser';
FLUSH PRIVILEGES; 
exit
killall mysqld
/etc/init.d/mysql start
==> write down both passwords you'll use them soon

2/ Remove cacti database :

Code: Select all

mysql -u root -p
DROP DATABASE cacti;
exit
3/ Remove the cacti dir

Code: Select all

rm -rf /var/www/cacti
4/ Remove the CRON Entry

Code: Select all

rm -rf /etc/crond.d/cacti
5/ Comment with a # these 4 lines in the cacti_autoinstall.sh

Code: Select all

cd /etc/snmp/ 
sed -e 's/com2sec paranoid/#com2sec paranoid/g' snmpd.conf > snmpd.tmp && mv -f snmpd.tmp snmpd.conf 
sed -e 's/#com2sec readonly/com2sec readonly/g' snmpd.conf > snmpd.tmp && mv -f snmpd.tmp snmpd.conf 
/etc/init.d/snmpd restart 
6/ rerun the script

7/ edit the password in /var/www/cacti/include.php
$database_password = "cactiuser";

This should do the job.

regards,

Deel
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Post by emerson.fp »

I installed the script from a fresh install of Debian.
I made the changes and the users could install Cacti 0.8.7g, but I could not make the spine 0.8.7g running through it.
Study testing another method of installation.
Thanks!
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Post by DeeL »

Thanks for your feedback I fixed several things thanks to your post.

You're right I should provide two versions, one with poller.php, the other one with spine.

I'm working on the "changing passwords" thing right now :)

Regards,

DeeL
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Post by emerson.fp »

I installed a new server and the script worked perfect!!!
But I don't have sucess at install spine.
There this errors:
07/20/2010 02:15:01 PM - SYSTEM STATS: Time:299.2511 Method:spine Processes:1 Threads:1 Hosts:3 HostsPerProcess:3 DataSources:123 RRDsProcessed:0
07/20/2010 02:15:01 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.


*Sorry for the horrible english. My native language is Portuguese Brasilian...
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Post by DeeL »

did you apt-get to install spine ?

I'll probably provide a script version using spine tonight.
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Post by emerson.fp »

I downloaded directly from the page of Cacti, compiled and installed.

If I run apt-get install cacti-spine it requires that you install cacti with apt-get.
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Post by DeeL »

I've posted a new version of the script that installs spine too ^^

Regards,

Deel
emerson.fp
Posts: 8
Joined: Mon Jul 19, 2010 3:21 pm
Location: Brasil

Post by emerson.fp »

I used the new script and installed everything without mistakes!
Cacti and Spine working perfectly!
I installed other plugins (thold, settings, monitor, cycle) and everything is OK!
Congratulations for the great work!
Thank you!
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Post by DeeL »

Thanks for your feedback, I'm glad you find it usefull.

Regards,

Deel
redmenn
Posts: 4
Joined: Tue Jun 01, 2010 9:53 am

Plugin Option Missing

Post by redmenn »

Nice script, works fine (have only tried Cacti). Only thing I noticed is that I could not see the option to enable the plugins via user management. I had to download the architecture and import pa.sql. The option has now appeared, will test the plugins now. Using Ubuntu 10.x by the way.

Cheers :)
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

Post by DeeL »

Hi,

Thanks for your feedback :)

I don't get it, if you've only installed cacti (commenting all other functions at the end of the script) then it's normal you couldn't see the "PA Management" in "user management" tab.

Did I miss something ?

Regards,

Deel
User avatar
DeeL
Cacti User
Posts: 71
Joined: Thu May 14, 2009 5:12 pm
Location: Paris

What's new

Post by DeeL »

Hi guys,

Apart from the TODO list tasks that I'll fulfill soon, I was wondering if you were interested in.

1/ Make it use HTTPS
This new option raises several sub-subjects.

a/ Should it use the default snakeoil certificate.
b/ Should it generate a new certificate.
c/ How should be done the cert validation.
d/ Should Apache work with both HTTP and HTTPS.
e/ in case HTTP is kept, should apache rewrite URLS to avoid using cacti with HTTP.

2/ What about boxes that are not brand new debian boxes
This point mainly concerns Apache I guess.

3/ What about security
This v0.33 script version uses slightly better user rights but this is far from being a good job. there are several sub-subjects here too.

a/ Should I include a basic iptables installation option.
b/ Should I harden the Apache conf.
c/ Should I forget that, it's only a cacti installation script after all.

4/ What about building "everything" from sources
I've tried my best to make things the right way, but for now this script is still best suited for testing an up to date cacti installation, than for prod.
Nevertheless, it could be usefull that the script installs the latest versions of Apache, MySQL and RRDtool in order to validate a prod configuration.

For instance with this script installed versions are :
Apache 2.2.9
MySQL 5.0.51
RRDtools 1.3.1
Net-SNMP 5.4.1

Whereas Current versions are :
Apache 2.2.15
MySQL 5.1.49
RRDtools 1.4.4
Net-SNMP 5.5
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest