Unable to move Cacti to new server

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

Moderators: Moderators, Developers

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

Unable to move Cacti to new server

#1 Post by stormonts » Wed Mar 13, 2019 8:35 am

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.


stormonts
Cacti User
Posts: 302
Joined: Tue Mar 31, 2009 10:05 am

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

#3 Post by stormonts » Wed Mar 13, 2019 12:48 pm

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

[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

stormonts
Cacti User
Posts: 302
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

#4 Post by stormonts » Wed Mar 13, 2019 3:55 pm

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: 3130
Joined: Sun Aug 27, 2017 12:05 am

Re: Unable to move Cacti to new server

#5 Post by netniV » Thu Mar 14, 2019 3:18 am

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.

stormonts
Cacti User
Posts: 302
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

#6 Post by stormonts » Thu Mar 14, 2019 6:57 am

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: 302
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

#7 Post by stormonts » Thu Mar 14, 2019 8:25 am

Got past the previous permission issue, but now all of the graphs are showing this:
rrd.png
rrd.png (48.77 KiB) Viewed 600 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 600 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: 3130
Joined: Sun Aug 27, 2017 12:05 am

Re: Unable to move Cacti to new server

#8 Post by netniV » Fri Mar 15, 2019 3:13 am

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.

stormonts
Cacti User
Posts: 302
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

#9 Post by stormonts » Fri Mar 15, 2019 12:30 pm

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

#10 Post by 404needaname404 » Mon Nov 25, 2019 7:13 pm

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: 302
Joined: Tue Mar 31, 2009 10:05 am

Re: Unable to move Cacti to new server

#11 Post by stormonts » Tue Nov 26, 2019 1:43 pm

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

Post Reply