Unable to move Cacti to new server

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

Moderators: Developers, Moderators

Post Reply
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Unable to move Cacti to new server

Post by stormonts »

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: Select all

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.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Unable to move Cacti to new server running MySQL 8

Post by netniV »

What do you have in your config.php file?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server running MySQL 8

Post by stormonts »

The exact same settings as in the config.php on the working server.

Code: Select all

$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: Select all

zzhoppy@cacti-st-01:/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
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

Post by stormonts »

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: Select all

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: Select all

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.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Unable to move Cacti to new server

Post by netniV »

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.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

Post by stormonts »

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.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

Post by stormonts »

Got past the previous permission issue, but now all of the graphs are showing this:
rrd.png
rrd.png (48.77 KiB) Viewed 1681 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.
rrdtool.png
rrdtool.png (4.55 KiB) Viewed 1681 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.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Unable to move Cacti to new server

Post by netniV »

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.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

Post by stormonts »

Yep, that was it. Saw the errors below and once those were fixed, things are now working Thanks!

Code: Select all

(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
404needaname404
Posts: 2
Joined: Mon Nov 11, 2019 3:54 pm

Re: Unable to move Cacti to new server

Post by 404needaname404 »

Who were you replying to, when you said found it? What did you find? What's the fix? Having the same issue. Thanks for your help.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

Post by stormonts »

PCRE library had to be re-compiled with the UTF8 and UTF8 properties support.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests