Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined array key 2 in file: mactrack_functions.php on line: 753 #205

Closed
jdcoats opened this issue Feb 14, 2024 · 5 comments
Closed

Undefined array key 2 in file: mactrack_functions.php on line: 753 #205

jdcoats opened this issue Feb 14, 2024 · 5 comments

Comments

@jdcoats
Copy link

jdcoats commented Feb 14, 2024

2024/02/14 14:51:25 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mactrack/mactrack_scanner.php[171]:get_IOS_dot1dTpFdbEntry_ports(), /plugins/mactrack/lib/mactrack_cisco.php[301]:build_InterfacesTable(), /plugins/mactrack/lib/mactrack_functions.php[753]:CactiErrorHandler())
2024/02/14 14:51:25 - ERROR PHP WARNING in Plugin 'mactrack': Undefined array key 2 in file: /var/www/localhost/htdocs/cacti/plugins/mactrack/lib/mactrack_functions.php on line: 753
@jdcoats
Copy link
Author

jdcoats commented Feb 14, 2024

and then a pile of these probably the reason for #204

2024/02/14 15:09:43 - CMDPHP SQL Backtrace: (/plugins/mactrack/mactrack_scanner.php[171]:get_IOS_dot1dTpFdbEntry_ports(), /plugins/mactrack/lib/mactrack_cisco.php[483]:db_store_device_port_results(), /plugins/mactrack/lib/mactrack_functions.php[2302]:db_execute_prepared())
2024/02/14 15:09:43 - CMDPHP ERROR: A DB Exec Failed!, Error: MySQL server has gone away
2024/02/14 15:09:43 - CMDPHP SQL Backtrace: (/plugins/mactrack/mactrack_scanner.php[171]:get_IOS_dot1dTpFdbEntry_ports(), /plugins/mactrack/lib/mactrack_cisco.php[483]:db_store_device_port_results(), /plugins/mactrack/lib/mactrack_functions.php[2274]:db_check_auth(), /plugins/mactrack/lib/mactrack_functions.php[2317]:db_fetch_cell_prepared(), /lib/database.php[598]:db_execute_prepared())
2024/02/14 15:09:43 - CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away

@xmacan
Copy link
Member

xmacan commented Feb 15, 2024

Error: MySQL server has gone away - It isn't cacti issue.
check mysql server log
SHOW GLOBAL VARIABLES LIKE 'max_connections';
SHOW GLOBAL STATUS LIKE 'max_used%';

@jdcoats
Copy link
Author

jdcoats commented Feb 15, 2024

Its a mactrack problem, mysql isnt really going away.

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'max_connections';
SHOW GLOBAL STATUS LIKE 'max_used%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 1000  |
+-----------------+-------+
1 row in set (0.001 sec)

+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| Max_used_connections | 498   |
+----------------------+-------+
1 row in set (0.000 sec)

@xmacan
Copy link
Member

xmacan commented Feb 19, 2024

Try to change in lib/mactrack_functions.php ling 753:
if ($ifOperStatus[$ifIndex] == 1) {
to
if (isset($ifOperStatus[$ifIndex]) && $ifOperStatus[$ifIndex] == 1) {

Do you have php 8.x?

@TheWitness
Copy link
Member

I think we need a wrapper function to accommodate the unset variables since @ does not work like it used to. That's a fairly big project.

xmacan added a commit to xmacan/plugin_mactrack that referenced this issue Mar 5, 2024
@xmacan xmacan closed this as completed Mar 5, 2024
TheWitness pushed a commit that referenced this issue Mar 5, 2024
* fix php8 issues - undefined variables, missing array keys

* update

* fix issue #205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants