Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Robvil
Posts: 28
Joined: Tue Oct 25, 2016 4:32 am

Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by Robvil »

Hi

Upgraded from 1.1.0 to 1.1.1 and got this:

2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1660 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1660 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1660 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1660 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
2017-03-28 10:48:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_json.php: 154 rrdtool_function_graph)(/lib/rrd.php: 1396 rrd_substitute_host_query_data)(/lib/rrd.php: 2237 substitute_host_data)(/lib/variables.php: 206 CactiErrorHandler)(/lib/functions.php: 4310 cacti_debug_backtrace)
2017-03-28 10:48:20 - ERROR PHP NOTICE: Undefined index: external_id in file: /var/www/html/lib/variables.php on line: 206
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by SpeedyGonzales »

Hi Robvil

how did you fix this?
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by TheWitness »

First of all, get off Cacti 1.1. Then, you can re-run the database upgrade through the CLI, or simply run the

audit_database.php --report

followed by

audit_database.php --repair
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?
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by SpeedyGonzales »

I am running Mint
1.1.38 is as high as they have gone with the upgrades

the problem points to /usr/share/cacti/site/lib/variables.php
lines with $replace[] = $_SESSION['sess_host_cache_array'][$host_id]

/* snmp system information */
215 $search[] = $l_escape_string . 'host_snmp_sysDescr' . $r_escape_string;
216 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysDescr'];
217 $search[] = $l_escape_string . 'host_snmp_sysObjectID' . $r_escape_string;
218 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysObjectID'];
219 $search[] = $l_escape_string . 'host_snmp_sysContact' . $r_escape_string;
220 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysContact'];
221 $search[] = $l_escape_string . 'host_snmp_sysLocation' . $r_escape_string;
222 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysLocation'];
223 $search[] = $l_escape_string . 'host_snmp_sysName' . $r_escape_string;
224 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysName'];
225 $search[] = $l_escape_string . 'host_snmp_sysUpTimeInstance' . $r_escape_string;
226 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['snmp_sysUpTimeInstance'];
227
228 $search[] = $l_escape_string . 'host_ping_retries' . $r_escape_string;
229 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['ping_retries'];
230 $search[] = $l_escape_string . 'host_max_oids' . $r_escape_string;
231 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['max_oids'];
232 $search[] = $l_escape_string . 'host_id' . $r_escape_string;
233 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['id'];
234
235 /* handle the external id */
236 $search[] = $l_escape_string . 'host_external_id' . $r_escape_string;
237 $replace[] = $_SESSION['sess_host_cache_array'][$host_id]['external_id'];

does this help?
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by SpeedyGonzales »

Also
any new devices show below

1 0 1 Up 0d:0h:0m N/A 0.04 1611914401263.8 1007446126141.1 100 %
2 0 0 Up 50d:10h:2m 0d:18h:40m 0 0.07 0.06 100 %
3 0 0 Up 0d:5h:2m N/A 0 1611914401264.2 1203370102.08 67.45 %

It shows big numbers but if I order them you can see it is actually only 16.11 or 10.07 16.11 and 12.03
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by SpeedyGonzales »

updated mint to 20
now running cacti 1.2.10 and spine 1.2.6

fixed those errors

now got

Log [Total Lines: 290298 - Admin view - Filter active]
2021/02/04 09:25:00 - CMDPHP PHP ERROR NOTICE Backtrace: (/poller.php[689]:snmpagent_poller_exiting(), /lib/snmpagent.php[303]:CactiErrorHandler())
2021/02/04 09:25:00 - ERROR PHP NOTICE: Trying to access array offset on value of type bool in file: /usr/share/cacti/site/lib/snmpagent.php on line: 303
2021/02/04 09:25:00 - CMDPHP PHP ERROR NOTICE Backtrace: (/poller.php[689]:snmpagent_poller_exiting(), /lib/snmpagent.php[302]:CactiErrorHandler())
2021/02/04 09:25:00 - ERROR PHP NOTICE: Trying to access array offset on value of type bool in file: /usr/share/cacti/site/lib/snmpagent.php on line: 302


/usr/share/cacti/site/lib/snmpagent.php


300 $varbinds = array(
301 'cactiApplPollerIndex' => $poller_index,
302 'cactiApplPollerHostname' => $poller['cactiApplPollerHostname'],
303 'cactiApplPollerIpAddress' => $poller['cactiApplPollerIpAddress']
304
cigamit
Developer
Posts: 3372
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Cacti 1.1.1 bug CMDPHP PHP ERROR NOTICE Backtrace

Post by cigamit »

Are you even using the snmpagent? If not, you might just want to disable its support under settings as you are still 7 versions behind (~326 entries in the ChangeLog since that version) .


Screenshot_3.png
Screenshot_3.png (23.42 KiB) Viewed 2944 times
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests