Mactrack not returning IPs, script stops after PHP warning

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
nrobbins
Posts: 3
Joined: Tue May 11, 2010 2:36 pm

Mactrack not returning IPs, script stops after PHP warning

Post by nrobbins »

Hello,

I'm having a problem with a new install of Mactrack where no IPs are being returned. I initially had the problem on a Cat6509 w/sup720, but to rule out device type, i also tried a 3800 router, and that had the same problem. I'm using the get_standard_arp_table function, and when running mactrack_scanner.php, i get an error "PHP Warning: Parameter 2 to get_standard_arp_table() expected to be a reference, value given in /usr/share/cacti/plugins/mactrack/mactrack_scanner.php on line 192". The last line of the debug results for both scans is "DEBUG: Scanning function is 'get_standard_arp_table'". I did try to downgrade the mactrack_cisco.php file to the one from mactrack v2.4 as mentioned in http://forums.cacti.net/about36226.html , however this didn't make a difference. I'll attach the debug results of the 6509 scan.

Thanks for your help,
Nick
Attachments
scanner.txt
Scanner debug output from Cat6509
(41.83 KiB) Downloaded 374 times
Panther_1
Posts: 28
Joined: Tue May 08, 2007 8:29 am
Location: NRW, Germany
Contact:

Post by Panther_1 »

I have the same Problem here with an linux router:


After I change

Code: Select all

function get_standard_arp_table($site, &$device) {
to

Code: Select all

function get_standard_arp_table($site, $device) {
I runs here fine
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

That's really odd. Have to see what is going wrong. There should be nothing wrong with that function declaration unless the $device is uninitialized.

What versions of PHP are you all running?
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?
nrobbins
Posts: 3
Joined: Tue May 11, 2010 2:36 pm

Post by nrobbins »

Installed via package manager in Ubuntu 10.


PHP 5.3.2-1ubuntu4 with Suhosin-Patch (cli) (built: Apr 9 2010 08:18:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
nrobbins
Posts: 3
Joined: Tue May 11, 2010 2:36 pm

Post by nrobbins »

I tried the same thing as Panther_1, removing the ampersand from in front of $device and now it's pulling IPs from all devices.

Not sure if this is breaking anything else, but thanks for the fix in the mean time!
Panther_1
Posts: 28
Joined: Tue May 08, 2007 8:29 am
Location: NRW, Germany
Contact:

Post by Panther_1 »

hy,

here ist is debian:

Code: Select all

root@lanmgr:[~] > php -v
PHP 5.3.2-1 with Suhosin-Patch (cli) (built: Mar 13 2010 22:18:25) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
root@lanmgr:[~] >
Could it an php5.3 issue?
laurel_wu
Posts: 1
Joined: Wed Jun 16, 2010 10:35 am

Post by laurel_wu »

Panther_1 wrote:I have the same Problem here with an linux router:


After I change

Code: Select all

function get_standard_arp_table($site, &$device) {
to

Code: Select all

function get_standard_arp_table($site, $device) {
I runs here fine
God!

i change "($site, $device)" to "($site, &$device)" and it works!


root@Cacti:/usr/share/cacti/site/plugins/mactrack# php -v
PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (cli) (built: May 13 2010 20:01:00)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
root@Cacti:/usr/share/cacti/site/plugins/mactrack#
MrRat
Cacti User
Posts: 136
Joined: Thu Jan 07, 2010 10:33 am

Post by MrRat »

Thanks guys, fixed for me too!

Code: Select all

# diff mactrack_functions.php.orig mactrack_functions.php
333c333
< function get_standard_arp_table($site, &$device) {
---
> function get_standard_arp_table($site, $device) {
2196c2196
< function get_netscreen_arp_table($site, &$device) {
---
> function get_netscreen_arp_table($site, $device) {
# php -v
PHP 5.3.2-pl0-gentoo (cli) (built: Jul 12 2010 23:45:52)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This will be fixed a little differently in 2.9.

TheWitness
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 3 guests