ERROR PHP WARNING: Missing argument 24 for...

Support questions about the MAC Track plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
gundalba
Posts: 36
Joined: Mon Feb 23, 2009 12:15 pm

ERROR PHP WARNING: Missing argument 24 for...

#1 Post by gundalba » Tue Apr 17, 2018 6:38 pm

OS: CentOS 7
Cacti : 1.1.37
MACTrack: 4.2
--------------

Just got MACTrack (re)installed after Cacti upgrade (1.1.35 -> 1.1.37) and getting following errors.
Could anyone help me get this running?
Many thanks in advance..

2018/04/17 16:30:44 - ERROR PHP WARNING: Missing argument 24 for api_device_save(), called in /usr/share/cacti/plugins/mactrack/mactrack_actions.php on line 158 and defined in file: /usr/share/cacti/lib/api_device.php on line: 169
2018/04/17 16:30:44 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mactrack/mactrack_devices.php: 44 form_mactrack_save)(/plugins/mactrack/mactrack_devices.php: 95 api_mactrack_device_save)(/plugins/mactrack/mactrack_actions.php: 69 sync_mactrack_to_cacti)(/plugins/mactrack/mactrack_actions.php: 158 api_device_save)(/lib/api_device.php: 169 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/04/17 16:30:44 - ERROR PHP NOTICE: Undefined variable: device_threads in file: /usr/share/cacti/lib/api_device.php on line: 233
2018/04/17 16:30:44 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/mactrack/mactrack_devices.php: 44 form_mactrack_save)(/plugins/mactrack/mactrack_devices.php: 95 api_mactrack_device_save)(/plugins/mactrack/mactrack_actions.php: 69 sync_mactrack_to_cacti)(/plugins/mactrack/mactrack_actions.php: 158 api_device_save)(/lib/api_device.php: 233 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/04/17 16:30:45 - ERROR PHP ERROR: Call to undefined function api_data_source_cache_crc_update() in file: /usr/share/cacti/lib/utility.php on line: 658
2018/04/17 16:30:45 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4628 cacti_debug_backtrace)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: ERROR PHP WARNING: Missing argument 24 for...

#2 Post by Pucho » Tue Apr 17, 2018 9:02 pm

I'm running exactly the same versions without any issues.

I had MT installed from 1.1.21 and been upgrading Cacti without actually reinstalling MT so not sure about the setup part of it.

Sounds more like cacti related. When do you get that msg? right after installing it? or while trying to add/edit devices, etc?
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

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

Re: ERROR PHP WARNING: Missing argument 24 for...

#3 Post by netniV » Wed Apr 18, 2018 3:57 am

Parameter 24 is the number of device threads. It would appear that MacTrack has been broken in this regard for some time as its never passed that parameter.

I've checked the history of api_device_save() in lib/api_device.php and it's not changed in a year or more.
I've also checked the history of mactrack_api_device_save() in mactrack_actions.php and it's not changed since 2016!

So, could you do me a favour and report this over on https://github.com/cacti/plugin_mactrack/issues

gundalba
Posts: 36
Joined: Mon Feb 23, 2009 12:15 pm

Re: ERROR PHP WARNING: Missing argument 24 for...

#4 Post by gundalba » Wed Apr 18, 2018 1:19 pm

Issue has been open opened at GitHub...

In the mean time if there is anyone who found a walk around and post it, it will be much appreciated.

Regards,

gundalba
Posts: 36
Joined: Mon Feb 23, 2009 12:15 pm

Re: ERROR PHP WARNING: Missing argument 24 for...

#5 Post by gundalba » Wed Apr 18, 2018 1:29 pm

Pucho wrote:I'm running exactly the same versions without any issues.

I had MT installed from 1.1.21 and been upgrading Cacti without actually reinstalling MT so not sure about the setup part of it.

Sounds more like cacti related. When do you get that msg? right after installing it? or while trying to add/edit devices, etc?
Thanks and may be it is due to Cacti upgrade that was done.

I don't think I had that error when I installed MACTrack on 1.1.35 recently.
It is just after the upgrade to 1.1.37, I found all the plugins installed were gone and had to re-install them.
I began to see this error after this Cacti upgrade, plugin re-install.
BTW, the upgrade was done by yum... and I would see this error(cacti.log) when I try to configure and save a device in Device Tracking.

Regards,

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

Re: ERROR PHP WARNING: Missing argument 24 for...

#6 Post by netniV » Wed Apr 18, 2018 1:59 pm

The plugins were disabled I would imagine not uninstalled. Cacti does not uninstall a plugin automatically only disables them. If a package manager removed a plugin folder, that's beyond cacti's remit but you shouldn't have lost any data.

I will double check the 1.1.35 release and see if the same issue persists. It may be that changes to the error handlers is what is now showing up the issue where previously it was hidden.

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

Re: ERROR PHP WARNING: Missing argument 24 for...

#7 Post by netniV » Wed Apr 18, 2018 2:01 pm

So I've checked 1.1.35 and that should have had exactly the same issue. It expects device threads, which mactrack isn't providing. I will have to double check the mactrack code tomorrow and see if it can provide that, otherwise it'll have to default it to 1.

gundalba
Posts: 36
Joined: Mon Feb 23, 2009 12:15 pm

Re: ERROR PHP WARNING: Missing argument 24 for...

#8 Post by gundalba » Wed Apr 18, 2018 5:22 pm

netniV wrote:So I've checked 1.1.35 and that should have had exactly the same issue. It expects device threads, which mactrack isn't providing. I will have to double check the mactrack code tomorrow and see if it can provide that, otherwise it'll have to default it to 1.
If this helps in any way....

I went back and searched for the "Missing argu..." from older(prior to upgrade) log files which did not yield any.
It only begins to appear after the upgrade.

Regards,

Post Reply