Cacti / plugin_gexport

Cacti Graph Export Plugin
GNU General Public License v2.0
12 stars 9 forks source link

Cacti Version 1.1.35 - Develop Branch gexport #23

Closed anarkia1976 closed 6 years ago

anarkia1976 commented 6 years ago

I'm tring to use plugin, but i can't save export definition:

2018/02/21 09:01:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 56 export_edit)(/plugins/gexport/gexport.php: 345 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:01:10 - ERROR PHP NOTICE in Plugin 'gexport': Undefined index: name in file: /usr/share/cacti/plugins/gexport/gexport.php on line: 345 2018/02/21 09:01:10 - DBCALL ERROR: SQL Save Failed for Table 'graph_exports'. SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'on', 'modern', '', '', 300, 100, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 09:06:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 09:01:10 - CMDPHP SQL Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 1001 _db_replace)(/lib/database.php: 948 db_execute)(/lib/database.php: 135 db_execute_prepared)(/lib/database.php: 208 cacti_debug_backtrace) 2018/02/21 09:01:10 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'export_private_key_path' in 'field list' 2018/02/21 09:01:10 - DBCALL ERROR: A DB Exec Failed!, Error:1054, SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'on', 'modern', '', '', 300, 100, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 09:06:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 09:01:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 978 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:01:10 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 978 2018/02/21 09:01:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 977 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:01:10 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 977 2018/02/21 09:01:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 976 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:01:10 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 976 2018/02/21 09:01:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 975 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:01:10 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 975 2018/02/21 09:00:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 56 export_edit)(/plugins/gexport/gexport.php: 345 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:00:33 - ERROR PHP NOTICE in Plugin 'gexport': Undefined index: name in file: /usr/share/cacti/plugins/gexport/gexport.php on line: 345 2018/02/21 09:00:33 - DBCALL ERROR: SQL Save Failed for Table 'graph_exports'. SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'on', 'modern', '2', '', 300, 100, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 09:05:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 09:00:33 - CMDPHP SQL Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 1001 _db_replace)(/lib/database.php: 948 db_execute)(/lib/database.php: 135 db_execute_prepared)(/lib/database.php: 208 cacti_debug_backtrace) 2018/02/21 09:00:33 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'export_private_key_path' in 'field list' 2018/02/21 09:00:33 - DBCALL ERROR: A DB Exec Failed!, Error:1054, SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'on', 'modern', '2', '', 300, 100, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 09:05:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 09:00:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 978 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:00:33 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 978 2018/02/21 09:00:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 977 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:00:33 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 977 2018/02/21 09:00:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 976 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:00:33 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 976 2018/02/21 09:00:33 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 975 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 09:00:33 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 975

netniV commented 6 years ago

I will take a look in a bit, has the table graphs_exports been created and graph_exports_tasks ?

can you paste their definitions using show create tables <tablename>\G

(yes, \G was on purpose 👍 )

anarkia1976 commented 6 years ago

I can't see "graphs_exports*" tables into cacti database. :(

netniV commented 6 years ago

No s on graphs

netniV commented 6 years ago

Do you have the create table statements?

anarkia1976 commented 6 years ago

I don't have "graphs_exports or graph_exports_task" tables in the cacti database. sorry.

netniV commented 6 years ago

What version does your plugin say it is?

anarkia1976 commented 6 years ago

Gexport | Graph Export Package for Cacti | Active | The Cacti Group | 1.4 |

netniV commented 6 years ago

OK, Perform the following steps:

  1. Navigate to the Graph Exports list page
  2. Goto MySQL and run the following code:
    UPDATE plugin_config SET version = '1.0' where directory = 'gexport'
  3. Refresh the list page

This should make the code go through hoops to upgrade you.

anarkia1976 commented 6 years ago

MariaDB [cacti]> UPDATE plugin_config SET version = '1.0' where directory = 'gexport'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0

I have made alla steps, but when i create esport about a specific tree nothing happen:

2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 56 export_edit)(/plugins/gexport/gexport.php: 345 CactiErrorHandler)(/lib/functions.php: 4624 2018/02/21 12:41:43 - ERROR PHP NOTICE in Plugin 'gexport': Undefined index: name in file: /usr/share/cacti/plugins/gexport/gexport.php on line: 345 2018/02/21 12:41:43 - DBCALL ERROR: SQL Save Failed for Table 'graph_exports'. SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'off', 'modern', '2', '', 400, 150, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 12:46:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 12:41:43 - CMDPHP SQL Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 1001 _db_replace)(/lib/database.php: 948 db_execute)(/lib/database.php: 135 db_execute_prepared)(/lib/database.php: 208 cacti_debug_backtrace) 2018/02/21 12:41:43 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'export_private_key_path' in 'field list' 2018/02/21 12:41:43 - DBCALL ERROR: A DB Exec Failed!, Error:1054, SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'off', 'modern', '2', '', 400, 150, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 12:46:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 978 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 978 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 977 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 977 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 976 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 976 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 975 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 975 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 56 export_edit)(/plugins/gexport/gexport.php: 345 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE in Plugin 'gexport': Undefined index: name in file: /usr/share/cacti/plugins/gexport/gexport.php on line: 345 2018/02/21 12:41:43 - DBCALL ERROR: SQL Save Failed for Table 'graph_exports'. SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'off', 'modern', '2', '', 400, 150, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 12:46:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 12:41:43 - CMDPHP SQL Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 1001 _db_replace)(/lib/database.php: 948 db_execute)(/lib/database.php: 135 db_execute_prepared)(/lib/database.php: 208 cacti_debug_backtrace) 2018/02/21 12:41:43 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'export_private_key_path' in 'field list' 2018/02/21 12:41:43 - DBCALL ERROR: A DB Exec Failed!, Error:1054, SQL:'INSERT INTO graph_exports (id, name, export_type, enabled, export_presentation, export_effective_user, export_expand_hosts, export_theme, graph_tree, graph_site, graph_width, graph_height, graph_thumbnails, graph_perpage, graph_columns, graph_max, export_args, export_clear, export_thumbs, export_directory, export_temp_directory, export_timing, export_threads, export_skip, export_hourly, export_daily, export_sanitize_remote, export_host, export_port, export_passive, export_user, export_password, export_private_key_path, next_start) VALUES (0, 'FS360', 'local', 'on', 'tree', 1, 'off', 'modern', '2', '', 400, 150, '', 20, 2, 2000, '-zav', '', '', '/tmp', '/tmp/', 'periodic', 0, 1, '00', '00:00', '', '', '', '', '', '', '', '2018-02-21 12:46:00') ON DUPLICATE KEY UPDATE name=VALUES(name), export_type=VALUES(export_type), enabled=VALUES(enabled), export_presentation=VALUES(export_presentation), export_effective_user=VALUES(export_effective_user), export_expand_hosts=VALUES(export_expand_hosts), export_theme=VALUES(export_theme), graph_tree=VALUES(graph_tree), graph_site=VALUES(graph_site), graph_width=VALUES(graph_width), graph_height=VALUES(graph_height), graph_thumbnails=VALUES(graph_thumbnails), graph_perpage=VALUES(graph_perpage), graph_columns=VALUES(graph_columns), graph_max=VALUES(graph_max), export_args=VALUES(export_args), export_clear=VALUES(export_clear), export_thumbs=VALUES(export_thumbs), export_directory=VALUES(export_directory), export_temp_directory=VALUES(export_temp_directory), export_timing=VALUES(export_timing), export_threads=VALUES(export_threads), export_skip=VALUES(export_skip), export_hourly=VALUES(export_hourly), export_daily=VALUES(export_daily), export_sanitize_remote=VALUES(export_sanitize_remote), export_host=VALUES(export_host), export_port=VALUES(export_port), export_passive=VALUES(export_passive), export_user=VALUES(export_user), export_password=VALUES(export_password), export_private_key_path=VALUES(export_private_key_path), next_start=VALUES(next_start)' 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 978 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 978 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 977 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 977 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 976 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 976 2018/02/21 12:41:43 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/gexport/gexport.php: 46 export_form_save)(/plugins/gexport/gexport.php: 135 sql_save)(/lib/database.php: 975 CactiErrorHandler)(/lib/functions.php: 4624 cacti_debug_backtrace) 2018/02/21 12:41:43 - ERROR PHP NOTICE: Undefined index: export_private_key_path in file: /usr/share/cacti/lib/database.php on line: 975

netniV commented 6 years ago

OK, something strange there. The code does have that field in it. But as we never set it, it's never been an issue (since SSH will default to the store in the home directory of the user you are with). I'll create a patch for this.

Some how between versions, and I really don't understand how I managed this, but I renamed the field in the CREATE TABLE statement. I think I must have deleted part of the text and though 'oops' and put back what I thought was there maybe.

To fix, run this SQL statement:

alter table graph_exports change column `export_index_key_path` `export_private_key_path` varchar(255);
netniV commented 6 years ago

Did you manage to resolve this @anarkia1976 ?

anarkia1976 commented 6 years ago

Sorry, i'm on vacancy .... :) i can test your latest patch tomorrow.

PAOK1926 commented 6 years ago

i second to anarkia1976 that it doesn't work.. downloaded again a few seconds ago, uninstalled, installed, no good..

netniV commented 6 years ago

Was that with or without the pull request ? https://github.com/Cacti/plugin_gexport/pull/25

PAOK1926 commented 6 years ago

i dont know..

netniV commented 6 years ago

I'm adding some more functionality today, I'll let you know once it's completed and in the develop branch. That will make life easier for you.

netniV commented 6 years ago

New version available.

netniV commented 6 years ago

Can you confirm that the error has now gone away?

PAOK1926 commented 6 years ago

installed version 1.4.1 now i can save the export. but it is never executed... so, no export.. :(

screen shot 2018-02-27 at 20 43 16

netniV commented 6 years ago

Do you have any logs showing that the export has been attempted at all? Or any errors?

netniV commented 6 years ago

@PAOK1926 Can you create your own issue for the problem you are having? And when you do, do you have any logs of that? Also can you do the following:

SHOW TABLES LIKE 'graph_exports%';
SHOW CREATE TABLE graph_exports \G
netniV commented 6 years ago

@anarkia1976 Can we close this issue now?

anarkia1976 commented 6 years ago

closed, thanks a lot for your hard work! :+1:

netniV commented 6 years ago

No worries, glad it's work for you 👍 🔨