Closed GrayFox14048 closed 1 year ago
@GrayFox14048, can you please do the following.
1) Update your branch to the latest. I usually simply delete the entire GitHub facing repository and then re-clone it. 2) Re-apply your patches 3) Re-create this pull request
The reason being is that you are applying this pull request from a very old MacTrack version. So, I can not see the forest from the tree's.
Thanks,
Larry
Find "function mactrack_process_mac_auth_report (in poller_mactrack.php) and replace:
`function mactrack_process_mac_auth_report($mac_auth_frequency, $last_macauth_time) { if ($mac_auth_frequency == 0) { $ports = db_fetch_assoc("SELECT mac_track_temp_ports., mac_track_sites.site_name FROM mac_track_temp_ports LEFT JOIN mac_track_sites ON mac_track_sites.site_id=mac_track_temp_ports.site_id WHERE authorized=0"); }else{ $ports = db_fetch_assoc("SELECT mac_track_ports., mac_track_sites.site_name FROM mac_track_ports LEFT JOIN mac_track_sites ON mac_track_sites.site_id=mac_track_temp_ports.site_id WHERE authorized=0"); }
}`
With
`function mactrack_process_mac_auth_report($mac_auth_frequency, $last_macauth_time) { / ############## Patch ############# / if ($mac_auth_frequency == 0) { $ports = db_fetch_assoc("SELECT mac_track_temp_ports., mac_track_sites.site_name FROM mac_track_temp_ports LEFT JOIN mac_track_sites ON mac_track_sites.site_id=mac_track_temp_ports.site_id WHERE authorized=0 ORDER BY mac_track_temp_ports.device_name,mac_track_temp_ports.port_number,mac_track_temp_ports.scan_date,mac_track_temp_ports.mac_address");
}else{ $ports = db_fetch_assoc("SELECT mac_track_ports., mac_track_sites.site_name FROM mac_track_ports LEFT JOIN mac_track_sites ON mac_track_sites.site_id=mac_track_ports.site_id WHERE authorized=0 ORDER BY mac_track_ports.device_name,mac_track_ports.port_number,mac_track_ports.scan_date,mac_track_ports.mac_address"); } / ################################ /
}`
Also find "function collect_mactrack_data ("in poller_mactrack.php) and replace
/* if it's time to e-mail */ if (($last_macauth_time + ($mac_auth_frequency*60) > time()) || ($mac_auth_frequency == 0)) { mactrack_process_mac_auth_report($mac_auth_frequency, $last_macauth_time); }
with
/* if it's time to e-mail */ /* ############## Patch ############# */ /* if (($last_macauth_time + ($mac_auth_frequency*60) > time()) || ($mac_auth_frequency == 0)) { mactrack_process_mac_auth_report($mac_auth_frequency, $last_macauth_time); } */ mactrack_debug("MACAUTH Time to mail report? " . $last_macauth_time . " + " . ($mac_auth_frequency*60) ." <= " . time()); if (($last_macauth_time + ($mac_auth_frequency*60) <= time()) || ($mac_auth_frequency == 0)) { mactrack_process_mac_auth_report($mac_auth_frequency, $last_macauth_time); set_config_option("mt_last_macauth_time",time()); } /* ############################### */
Tested by me in MACTRACK 4.5 on CACTI 1.2.23 Thanks to mf2hd for the solution, you saved our lifes! https://forums.cacti.net/viewtopic.php?p=252897