ERROR PHP WARNING: Missing argument 24 for...

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
gundalba
Posts: 46
Joined: Mon Feb 23, 2009 12:15 pm

ERROR PHP WARNING: Missing argument 24 for...

Post by gundalba »

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: 185
Joined: Wed Jul 20, 2016 8:00 pm

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

Post by Pucho »

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.2.15
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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

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
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
gundalba
Posts: 46
Joined: Mon Feb 23, 2009 12:15 pm

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

Post by gundalba »

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: 46
Joined: Mon Feb 23, 2009 12:15 pm

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

Post by gundalba »

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

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

Post by netniV »

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.
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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

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.
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
gundalba
Posts: 46
Joined: Mon Feb 23, 2009 12:15 pm

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

Post by gundalba »

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

Who is online

Users browsing this forum: No registered users and 0 guests