Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jun 15, 2019 11:55 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Unable to move Cacti to new server
PostPosted: Wed Mar 13, 2019 8:35 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
We are running Cacti 1.2.2 and are trying to move it to a new server running CentOS 7. Both servers are running PHP 7.2.16, but the new server is running MySQL 8.0.15 where as the old one is running MySQL 5.7.23. When attempting to get to the Cacti interface we are seeing this message:

Code:
FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.

PHP MySQL module is installed and enabled, the DB is running, and the credentials are configured correctly in config.php.

What we have done so far regarding MySQL is this:
Run “mysqladmin --user root --password=InitialPW password NewPW”
mysqladmin -u root -p create cacti1x
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
(dump the DB on the old server) mysqldump -l -u cactiuser -p --add-drop-table cacti1x > /usr/local/cacti1.2.2.sql
(import the DB to the new server) mysql –u root –p cacti1x < /usr/local/cacti1.2.2.sql

Create the cactiuser
mysql -u root –p
create user 'cactiuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON cacti1x.* TO 'cactiuser'@'localhost';
GRANT SELECT ON mysql.time_zone_name to 'cactiuser'@'localhost';
flush privileges;


Last edited by stormonts on Wed Mar 13, 2019 3:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server running MySQL 8
PostPosted: Wed Mar 13, 2019 11:57 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
What do you have in your config.php file?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server running MySQL 8
PostPosted: Wed Mar 13, 2019 12:48 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
The exact same settings as in the config.php on the working server.
Code:
$database_type     = 'mysql';
$database_default  = 'cacti1x';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'password#';
$database_port     = '3306';
$database_ssl      = false;
$database_ssl_key  = '';
$database_ssl_cert = '';
$database_ssl_ca   = '';


I think this is a moot point though as we were also having an issue compiling Spine against that version of MySQL, so we are reverting back to version 5.7 on the new server.
Code:
[email protected]:/usr/local/src/cacti-spine-1.2.2> sudo make install
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c
sql.c: In function ‘db_connect’:
sql.c:232:2: error: unknown type name ‘my_bool’
  my_bool reconnect = 1;
  ^
make: *** [sql.o] Error 1


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Wed Mar 13, 2019 3:55 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
Sadly, MySQL is giving me issues on this new server as well. I am stuck with two things.

Click on Graphs and all graphs show "Website does not have write access to folder, may be unable to create/update RRDs: /rra/

That folder has the same permissions as the other server (website is running as nobody):
Code:
drwxrwxr--   2 nobody   wheel    839680 Mar 13 16:09 cacti_rra/


That error is also accompanied by "2019/03/13 16:48:38 - BOOST ERROR: Boost Cache Directory is not writable! Can not cache images" showing up in the logs. Permissions are set on the associated directory the same as the other server.
Code:
drwxrwxr-x  6 nobody  wheel   4096 Feb 24 09:52 cache/


The other issue is that I keep seeing "2019/03/13 16:50:03 - SPINE: Poller[Sterling] ERROR: Spine Timed Out While Waiting for Threads to End" in the logs. Again, spine permissions are set the same as the old server and all checkboxes next to anything with paths in the Cacti settings are showing up green.

We are running CentOS 7 without seLinux.


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Thu Mar 14, 2019 3:18 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
Well, that message would only appear for one of two reasons, the user the website runs as does not have the permission it's supposed to, or AppArmour/SELinux is in the way.

I did notice though, your folder was cacti_rra, not just rra.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Thu Mar 14, 2019 6:57 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
I'll keep digging on the permissions.

Meant to add a comment about the rra folder earlier; we have always symlinked /cacti/rra to a folder outside of the Cacti dir (/use/local/cacti_rra) to avoid having to move the folder with each upgrade. That is currently (and has always) worked on the old server.


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Thu Mar 14, 2019 8:25 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
Got past the previous permission issue, but now all of the graphs are showing this:

Attachment:
rrd.png
rrd.png [ 48.77 KiB | Viewed 177 times ]


Is it possible to move the RRAs from the existing server (like we did) or do new ones have to be created?

RRDtool is being detected.

Attachment:
rrdtool.png
rrdtool.png [ 4.55 KiB | Viewed 177 times ]


Digging deeper into that data source, the "Troubleshooting -> Data sources" returns all check marks. With the log set to debug, the rra is being updated fine.


2019/03/14 09:59:02 - SPINE: Poller[Sterling] Device[Summit-CV-Desktops] HT[1] Total Time: 0.24 Seconds
2019/03/14 09:59:02 - SPINE: Poller[Sterling] Device[Summit-CV-Desktops] HT[1] DS[Summit-CV-Desktops - Traffic - 2:37] Graphs[Summit-CV-Desktops - Traffic - StoneL - 2:37] SNMP: v3: Summit-CV-Desktops, dsname: traffic_in, oid: .1.3.6.1.2.1.31.1.1.1.6.2037, value: 2058940701
2019/03/14 09:59:02 - SPINE: Poller[Sterling] Device[Summit-CV-Desktops] HT[1] NOTE: There are '1' Polling Items for this Device
2019/03/14 09:59:02 - SPINE: Poller[Sterling] Device[Summit-CV-Desktops] HT[1] Device has no information for recache.


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Fri Mar 15, 2019 3:13 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
If you are getting an Unknown RRDTool error, the best thing to do is get the graph statement that would create the graph by using the Graph Debug mode, then running that command as your website user at the command line.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Unable to move Cacti to new server
PostPosted: Fri Mar 15, 2019 12:30 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 279
Yep, that was it. Saw the errors below and once those were fixed, things are now working Thanks!

Code:
(process:11367): GLib-CRITICAL **: 16:11:31.312: PCRE library is compiled without UTF8 support
(process:11367): GLib-CRITICAL **: 16:11:31.312: PCRE library is compiled without UTF8 properties support
ERROR: cannot compile RE: PCRE library is compiled with incompatible options


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: No registered users and 14 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