Cacti / plugin_reportit

ReportIt Plugin for Cacti
GNU General Public License v2.0
7 stars 9 forks source link

Error [] operator not supported for strings #43

Closed vishnubraj closed 5 years ago

vishnubraj commented 6 years ago

i am using the latest plugin from the git.. Creating report is not a problem, whenever i run the script i get the below error:

2018/09/07 09:56:50 - ERROR PHP ERROR in  Plugin 'reportit': Uncaught Error: [] operator not supported for strings in /var/www/cacti/plugins/reportit/reports.php:1199
Stack trace:
#0 /var/www/cacti/plugins/reportit/reports.php(39): form_actions()
#1 {main}
  thrown in file: /var/www/cacti/plugins/reportit/reports.php on line: 1199
2018/09/07 09:56:50 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4628 cacti_debug_backtrace)
2018/09/07 09:56:53 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'reportit'
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 28
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 28 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_validate.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 28
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 28 include_once)(/plugins/reportit/reports.php: 28 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_validate.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 28
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 28 include_once)(/plugins/reportit/reports.php: 28 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 29
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 29 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_online.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 29
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 29 include_once)(/plugins/reportit/reports.php: 29 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_online.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 29
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 29 include_once)(/plugins/reportit/reports.php: 29 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 30
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 30 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/const_runtime.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 30
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 30 include_once)(/plugins/reportit/reports.php: 30 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/const_runtime.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 30
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 30 include_once)(/plugins/reportit/reports.php: 30 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 31
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 31 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/const_reports.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 31
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 31 include_once)(/plugins/reportit/reports.php: 31 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/const_reports.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 31
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 31 include_once)(/plugins/reportit/reports.php: 31 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 32
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 32 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_shared.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 32
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 32 include_once)(/plugins/reportit/reports.php: 32 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_shared.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 32
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 32 include_once)(/plugins/reportit/reports.php: 32 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP NOTICE in  Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/reports.php  on line: 33
2018/09/07 09:56:53 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/reports.php: 33 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_html.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/reports.php  on line: 33
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 33 include_once)(/plugins/reportit/reports.php: 33 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP WARNING in  Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_html.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/reports.php  on line: 33
2018/09/07 09:56:53 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/reports.php: 33 include_once)(/plugins/reportit/reports.php: 33 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/07 09:56:53 - ERROR PHP ERROR in  Plugin 'reportit': Uncaught Error: [] operator not supported for strings in /var/www/cacti/plugins/reportit/reports.php:1199
Stack trace:
#0 /var/www/cacti/plugins/reportit/reports.php(39): form_actions()
#1 {main}
  thrown in file: /var/www/cacti/plugins/reportit/reports.php on line: 1199
2018/09/07 09:56:53 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4628 cacti_debug_backtrace)
2018/09/07 09:56:53 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'reportit'

below is the mysql output..

MariaDB [cacti]> select * from plugin_hooks where name = 'reportit';
+-----+----------+-----------------------+-----------+-------------------------------+--------+
| id  | name     | hook                  | file      | function                      | status |
+-----+----------+-----------------------+-----------+-------------------------------+--------+
|  98 | reportit | top_header_tabs       | setup.php | reportit_show_tab             |      0 |
|  99 | reportit | top_graph_header_tabs | setup.php | reportit_show_tab             |      0 |
| 100 | reportit | draw_navigation_text  | setup.php | reportit_draw_navigation_text |      0 |
| 101 | reportit | config_arrays         | setup.php | reportit_config_arrays        |      0 |
| 102 | reportit | config_settings       | setup.php | reportit_config_settings      |      0 |
| 103 | reportit | poller_bottom         | setup.php | reportit_poller_bottom        |      0 |
+-----+----------+-----------------------+-----------+-------------------------------+--------+
6 rows in set (0.00 sec)

MariaDB [cacti]>
vishnubraj commented 5 years ago

Hi. did any one get a chance to check this. Please let me know if i can be any helpful to fix this...

netniV commented 5 years ago

I think @browniebraun will be looking into it. I haven't had a chance myself due to the main 1.2 upgrade QA that I'm doing.

netniV commented 5 years ago

Hi @vishnubraj if you have the latest release, this doesn't seem to be an issue. If you are still having issues, please let me know and the version of cacti that you are using.

vishnubraj commented 5 years ago

no @netniV i am still getting the uncaught error when i run the report.. Yes i just downloaded the latest version again and tried. Cacti version: 1.1.38


2018/09/22 05:28:48 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'reportit'
--
2018/09/22 05:28:48 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4628 cacti_debug_backtrace)
thrown in file: /var/www/cacti/plugins/reportit/view.php on line: 125
#1 {main}
#0 /var/www/cacti/plugins/reportit/view.php(64): standard()
Stack trace:
2018/09/22 05:28:48 - ERROR PHP ERROR in Plugin 'reportit': Uncaught Error: Call to undefined function my_id() in /var/www/cacti/plugins/reportit/view.php:125
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 36 include_once)(/plugins/reportit/view.php: 36 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/const_view.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 36
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 36 include_once)(/plugins/reportit/view.php: 36 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/const_view.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 36
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 36 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 36
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 35 include_once)(/plugins/reportit/view.php: 35 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_export.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 35
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 35 include_once)(/plugins/reportit/view.php: 35 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_export.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 35
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 35 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 35
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 34 include_once)(/plugins/reportit/view.php: 34 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_online.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 34
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 34 include_once)(/plugins/reportit/view.php: 34 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_online.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 34
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 34 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 34
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 33 include_once)(/plugins/reportit/view.php: 33 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_html.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 33
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 33 include_once)(/plugins/reportit/view.php: 33 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_html.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 33
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 33 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 33
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 32 include_once)(/plugins/reportit/view.php: 32 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_shared.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 32
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 32 include_once)(/plugins/reportit/view.php: 32 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_shared.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 32
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 32 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 32
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 31 include_once)(/plugins/reportit/view.php: 31 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(): Failed opening 'REPORTIT_BASE_PATH/lib/funct_validate.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in file: /var/www/cacti/plugins/reportit/view.php on line: 31
2018/09/22 05:28:48 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/reportit/view.php: 31 include_once)(/plugins/reportit/view.php: 31 CactiErrorHandler)(/lib/functions.php: 4585 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP WARNING in Plugin 'reportit': include_once(REPORTIT_BASE_PATH/lib/funct_validate.php): failed to open stream: No such file or directory in file: /var/www/cacti/plugins/reportit/view.php on line: 31
2018/09/22 05:28:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/reportit/view.php: 31 CactiErrorHandler)(/lib/functions.php: 4590 cacti_debug_backtrace)
2018/09/22 05:28:48 - ERROR PHP NOTICE in Plugin 'reportit': Use of undefined constant REPORTIT_BASE_PATH - assumed 'REPORTIT_BASE_PATH' in file: /var/www/cacti/plugins/reportit/view.php on line: 31
netniV commented 5 years ago

OK, i'll test against my 1.1.38 system.

netniV commented 5 years ago

Just to clarify, where did you download from and what version/commit reference are you on for ReportIT?

vishnubraj commented 5 years ago

i did a git clone of "https://github.com/Cacti/plugin_reportit.git" URL.. i believe this default download the develop branch..

netniV commented 5 years ago

And you did a refresh clone, or have you done a git pull recently to update it?

vishnubraj commented 5 years ago

i deleted the old folder and did a git clone and installed it again..

netniV commented 5 years ago

OK, that is strange. I'll do a fresh 1.1.38 install and try again.

netniV commented 5 years ago

You know... I just realised that what I missed was the very first issue... you had a string that was trying to be used as an array... I've fixed that now... the other issues of REPORTIT_BASE_PATH are because the plugin became disabled due to the first error.

vishnubraj commented 5 years ago

Awesome!! Thanks for the fix @netniV . It works fine now.. I am able to generate reports.

One last thing is, there used to be a option to view the report in chart format. But i dont see the option now. Does that got removed?

screen shot 2018-09-24 at 2 36 04 pm

netniV commented 5 years ago

That I couldn't possible say. I can search the code for 'chart' but since I am technically a first time user, I wouldn't know about historic things 👍

netniV commented 5 years ago

Just so you are aware, I have found and corrected other instances of this same issue.