Closed jdcoats closed 5 months ago
Should be fixed now.
2024/06/17 15:24:00 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'mactrack'
2024/06/17 15:24:00 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
2024/06/17 15:24:00 - ERROR PHP ERROR in Plugin 'mactrack': Uncaught ValueError: substr_count(): Argument #2 ($needle) cannot be empty in /var/www/localhost/htdocs/cacti/plugins/mactrack/lib/mactrack_functions.php:345 Stack trace: #0 /var/www/localhost/htdocs/cacti/plugins/mactrack/lib/mactrack_functions.php(345): substr_count('.1.3.6.1.4.1.9....', '') #1 /var/www/localhost/htdocs/cacti/plugins/mactrack/mactrack_scanner.php(161): find_scanning_function(Array, Array) #2 {main} thrown in file: /var/www/localhost/htdocs/cacti/plugins/mactrack/lib/mactrack_functions.php on line: 345
@xxconn & @TheWitness okay so now we have this
2024/06/18 11:41:00 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mactrack/mactrack_utilities.php[88]:mactrack_display_run_status(), /plugins/mactrack/mactrack_utilities.php[248]:CactiErrorHandler())
2024/06/18 11:41:00 - ERROR PHP WARNING in Plugin 'mactrack': Trying to access array offset on value of type null in file: /var/www/localhost/htdocs/cacti/plugins/mactrack/mactrack_utilities.php on line: 248
Awesome Dan. Thanks for confirming.
What is the value of mt_collection_timing in your case?
I think the value of mt_collection_time is null at the first installation plugin and in PHP 8.1, it may raise this problem. I don't have PHP 8.1 runtime environment, so I cannot confirm the cause.
So, then we need a check and if null set_config_option() to the default.
Maybe a feature request to set all defaults, but that could be dangerous too.
dont know, it is still broken though, every time it starts a run it disables the plugin
SELECT * FROM settings WHERE name='mt_collection_timing;`
mt_collection_timing | 120 |
Refresh and try again.
okay next run time in 40min
looks good now. Thanks!
When I modify the code like this, I will show blank value in 'Poller Frequency' and write the error log:
2024-06-20 09:26:17 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mactrack/mactrack_utilities.php[88]:mactrack_display_run_status(), /plugins/mactrack/mactrack_utilities.php[248]:CactiErrorHandler()) 2024-06-20 09:26:17 - ERROR PHP WARNING in Plugin 'mactrack': Undefined array key 7200 in file: /usr/share/cacti/plugins/mactrack/mactrack_utilities.php on line: 248
I think the $seconds_offset should be still divided by 60 into minutes to get the right poller frequency.
@jdcoats
I have modified the new code, you could try it.
looks good, thanks!
Cool!!!