Cacti / plugin_mikrotik

Mikrotik Plugin for Cacti
GNU General Public License v2.0
60 stars 24 forks source link

ERROR PHP NOTICE in Plugin 'mikrotik': A non well formed numeric value encountered in file: /var/www/html/cacti/plugins/mikrotik/poller_mikrotik.php on line: 1517 #55

Closed mehdi-song closed 2 years ago

mehdi-song commented 2 years ago

ERROR PHP NOTICE in Plugin 'mikrotik': A non well formed numeric value encountered in file: /var/www/html/cacti/plugins/mikrotik/poller_mikrotik.php on line: 1517 CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/mikrotik/poller_mikrotik.php[138]:checkHost(), /plugins/mikrotik/poller_mikrotik.php[796]:collect_dhcp_details(), /plugins/mikrotik/poller_mikrotik.php[1302]:uptimeToSeconds(), /plugins/mikrotik/poller_mikrotik.php[1517]:CactiErrorHandler()) ERROR PHP NOTICE in Plugin 'mikrotik': A non well formed numeric value encountered in file: /var/www/html/cacti/plugins/mikrotik/poller_mikrotik.php on line: 1516 CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/mikrotik/poller_mikrotik.php[138]:checkHost(), /plugins/mikrotik/poller_mikrotik.php[796]:collect_dhcp_details(), /plugins/mikrotik/poller_mikrotik.php[1302]:uptimeToSeconds(), /plugins/mikrotik/poller_mikrotik.php[1516]:CactiErrorHandler())

TheWitness commented 2 years ago

Please update to the develop version of MicroTik and report back. This issue may have already be fixed. The line numbers for sure do not match. Thanks!

mehdi-song commented 2 years ago

CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mikrotik/poller_mikrotik.php[136]:getLatestVersion(), /plugins/mikrotik/poller_mikrotik.php[146]:file_get_contents(), CactiErrorHandler()) ERROR PHP WARNING in Plugin 'mikrotik': file_get_contents(http://upgrade.mikrotik.com/routeros/LATEST.6): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in file: /var/www/html/cacti/plugins/mikrotik/poller_mikrotik.php on line: 146 CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mikrotik/poller_mikrotik.php[136]:getLatestVersion(), /plugins/mikrotik/poller_mikrotik.php[146]:file_get_contents(), CactiErrorHandler()) ERROR PHP WARNING in Plugin 'mikrotik': file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in file: /var/www/html/cacti/plugins/mikrotik/poller_mikrotik.php on line: 146

TheWitness commented 2 years ago

Oh, that's interesting.

TheWitness commented 2 years ago

So, it would appear that the cacti install does not have access to the internet or an internet dns service?

mehdi-song commented 2 years ago

on cacti server i ping 8.8.8.8 and google.com , and that's work. but errors exist. CMDPHP PHP ERROR NOTICE Backtrace: (/script_server.php[191]:fputs(), CactiErrorHandler()) ERROR PHP NOTICE: fputs(): write of 53 bytes failed with errno=32 Broken pipe in file: /var/www/html/cacti/script_server.php on line: 191

TheWitness commented 2 years ago

Use spine instead of cmd.php and increase your threads. This is a sign that the script has timed out I think.

Did you update mikrotik?

mehdi-song commented 2 years ago

hi sorry , i install new cacti server and test develop version. it was ok thanks

mehdi-song commented 2 years ago

CMDPHP SQL Backtrace: (/cli/add_graphs.php[648]:db_fetch_assoc(), /lib/database.php[501]:db_fetch_assoc_prepared(), /lib/database.php[515]:db_execute_prepared())

TheWitness commented 2 years ago

That's more of a Cacti issue and likely a use problem with the CLI. I'm going to prevent it from logging the backtrace, but it's likely you are specifying the wrong values.

TheWitness commented 2 years ago

Going to close this one as you are mixing too many issues. You should open each issue separately in the appropriate location. Thanks though. The add_graphs.php bug needed to be taken care of. Note that MySQL/MariaDB regex's are not compatible with Perl regex's sadly.