Graphs not being generated, empty graphs, mysql errors, misc

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

Moderators: Developers, Moderators

Post Reply
jaro06
Posts: 7
Joined: Thu Feb 08, 2018 7:16 pm

Graphs not being generated, empty graphs, mysql errors, misc

Post by jaro06 »

My cacti instance would not initially connect to mysql and after debugging to find that using php7.0 was the cause, setting apache2 to use php5.6, it was still generating empty graphs. I noticed the "- q" option and also that cacti was using /usr/bin/php in the following log output:

Code: Select all

2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cacti/cmd.php" --poller=1 --first=1 --last=1 --mibs]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cacti/cmd.php" --poller=1 --first=0 --last=0 --mibs]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/poller_maintenance.php]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/poller_automation.php -M]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/poller_spikekill.php]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/poller_reports.php]
2018-02-24 12:25:00 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/poller_boost.php]
2018-02-24 12:20:01 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cacti/cmd.php" --poller=1 --first=1 --last=1 --mibs]
2018-02-24 12:20:01 - POLLER: Poller[Main Poller] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cacti/cmd.php" --poller=1 --first=0 --last=0 --mibs]
So simply specifying the full path php5.6 in crontab didn't completely solve graphing issues. What follows shows how I updated cli using /etc/alternatives, and apache to use php5.6:

Apache:-

Code: Select all

sudo a2dismod php7.1
sudo a2enmod php5.6
sudo service apache2 restart
Command Line:-

Code: Select all

sudo update-alternatives --set php /usr/bin/php5.6
sudo update-alternatives --set phar /usr/bin/phar5.6
sudo update-alternatives --set phar.phar /usr/bin/phar.phar5.6
sudo update-alternatives --set phpize /usr/bin/phpize5.6
sudo update-alternatives --set php-config /usr/bin/php-config5.6
Ultimately, I also downloaded the latest version of cacti, 1.1.35 from cacti.net, and untared in into /var/www/html/cacti, disabling the version installed by apt using the apache 2 command, but I only did it for the latest version, it was not necessary for function.

Code: Select all

a2dissite cacti
The instance now works quite reliably with no errors or warning in the logs. It has been tested for the past week. I will re-post this solution referencing a few of the other database and php errors that were generated. Side note, cacti installs reliably and functioning in FreeBSD 11 using pkg.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs not being generated, empty graphs, mysql errors,

Post by netniV »

If you update the php being used in the cron tab, you should also update your settings within cacti to specify the full path to the correct version.

You seem to have gone through a lot of effort to get it working, only to downgrade when you shouldn't have needed to. What OS where you actually doing all this on, as you seem to mention using pkg's on FreeBSD, I'm thinking you did mean this was all done on there but it could also be read that you have installed under FreeBSD elsewhere without issue.
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
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests