Error on api_device.php

Beta testing discussion area

Moderators: Moderators, Developers

Post Reply
Author
Message
Rno
Cacti User
Posts: 325
Joined: Wed Dec 07, 2011 9:19 am

Error on api_device.php

#1 Post by Rno » Fri Oct 26, 2018 4:05 am

Hello,
I have an error on a call on api_device.php.
The call I made is on the stack trace, and it's to api_device_save
Here is the output:

Fatal error: Uncaught Error: Call to undefined function poller_push_to_remote_db_connect() in /usr/share/cacti/lib/api_device.php:658
Stack trace:
#0 /usr/share/cacti/plugins/linkdiscovery/findhosts.php(600): api_device_save('0', '6', 'se-ch9-40', 'se-ch9-40.recol...', 'telvlsn', '2', '', '', '161', '500', false, '2', '2', '23', '400', '1', 'Added by Link D...', '', '', '', '', '', 10, 1, 1, 0)
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3, Map 0.4

Test
Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

netniV
Cacti Guru User
Posts: 2686
Joined: Sun Aug 27, 2017 12:05 am

Re: Error on api_device.php

#2 Post by netniV » Fri Oct 26, 2018 7:30 am

The poller_push_to_remote_db_connect() function lives in lib/poller.php. lib/api_device.php itself does not include lib/poller.php does that function would not be found unless the plugin in question was also including lib/poller.php

Rno
Cacti User
Posts: 325
Joined: Wed Dec 07, 2011 9:19 am

Re: Error on api_device.php

#3 Post by Rno » Mon Oct 29, 2018 1:47 am

Well not sure to understand you point
But for me if api_device.php is using an external function, it has to include all the lib needed to be able to use it.
I will definitely not include poller.php into my plugin.

As for testing purpose, it's working if I declare poller.php int my file, but nothing special about that. And it's not the way to do it
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.3, Map 0.4

Test
Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

netniV
Cacti Guru User
Posts: 2686
Joined: Sun Aug 27, 2017 12:05 am

Re: Error on api_device.php

#4 Post by netniV » Mon Oct 29, 2018 7:21 am

If you have not already done so, feel free to open it as an issue on GitHub.

Post Reply