Call to undefined function cacti_log_file on remote poller

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Call to undefined function cacti_log_file on remote poller

Post by antras »

I've upgraded successfully main cacti server from 1.1.38 to 1.2.10 and then installed new remote poller 1.2.10 from scratch.
Everything was fine before initial sync to remote poller. Right after that any query to remote poller return fatal error 500.

Code: Select all

PHP Fatal error: Call to undefined function cacti_log_file() in /usr/share/cacti/include/global.php on line 345
When I tried to look for cacti_log_file function I found that it has gone after sync from /usr/share/cacti/lib/functions.php file.

Is it bug that cacti_log_file function was removed from remote poller or it is working as expected?
If it's expected - how to fix the issue? What I'm doing wrong?
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Call to undefined function cacti_log_file on remote poller

Post by TheWitness »

If you a upgrade to 1.2.11, then all the remote pollers will self upgrade. You don't have to do anything.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Call to undefined function cacti_log_file on remote poller

Post by antras »

TheWitness wrote: Tue Apr 07, 2020 10:38 am If you a upgrade to 1.2.11, then all the remote pollers will self upgrade. You don't have to do anything.
So do you want to say there is a bug in 1.2.10 and cacti_log_file() function is removed on remote pollers from /usr/share/cacti/lib/functions.php file by mistake?
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Call to undefined function cacti_log_file on remote poller

Post by TheWitness »

It exists in lib/functions.php, which is included very early in global.php. So, it's already there. Line 245.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Call to undefined function cacti_log_file on remote poller

Post by antras »

TheWitness wrote: Wed Apr 08, 2020 8:11 pm It exists in lib/functions.php, which is included very early in global.php. So, it's already there. Line 245.
It exists until remote poller is fully sync'ed with main server. After full sync lib/functions.php on remote poller is rewritten and new lib/functions.php file does not contain cacti_log_file() function anymore.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Call to undefined function cacti_log_file on remote poller

Post by Osiris »

You must be attempting to downgrade then. That's a core file.
Before history, there was a paradise, now dust.
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Call to undefined function cacti_log_file on remote poller

Post by antras »

Looking further into the problem I've found that remote poller (as part of initial full sync from main poller) have got lib/functions.php file from cacti version 1.1.38. But main server was upgraded to version 1.2.10. How it can be?
Can somebody explain the mechanics of updating of php-files from cache on remote pollers?
Where the content of these files come from - is it from main server's mysql database or from main server's file system?
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Call to undefined function cacti_log_file on remote poller

Post by antras »

I've found the cause of problem - poller_resource_cache table on main server contained files from the past cacti versions (1.1.38 and so on). After initial sync remote pollers got wrong versions of files from that table and went to unreachable state because of that.
Solution is to 'Rebuild Resource Cache' (Utilities -> System Utilities -> Rebuild Resource Cache) on main server before to add any new remote pollers.
It's definitely gap of upgrade script and it should be addressed in future cacti versions.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Call to undefined function cacti_log_file on remote poller

Post by netniV »

That sounds like a bug if your cache isn't updating. Basically, it should be checking files and seeing a difference so putting them into the resources table.
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
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Call to undefined function cacti_log_file on remote poller

Post by TheWitness »

Yea, agree we should log a bug on this. There is a setting to disable, but it we do, we should also purge it. Also, the remote should not pluck the files if they are there.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests