PDA

View Full Version : Problem importing nagios.cfg


attagis
07-28-2008, 06:43 PM
Hi everybody! I'm trying to import configuration from Nagios 3.0 to Centreon v2 b5. And when I try to load nagios.cfg I get this SQL error and the loading fails:

DB Error : INSERT INTO cfg_nagios (`nagios_id` , `nagios_name` , `nagios_server_id`, `log_file` , `cfg_dir` , `object_cache_file` , `temp_file` , `status_file` , `p1_file`, `aggregate_status_updates` , `status_update_interval` , `nagios_user` , `nagios_group` , `enable_notifications` , `execute_service_checks` , `accept_passive_service_checks` , `execute_host_checks` , `accept_passive_host_checks` , `enable_event_handlers` , `log_rotation_method` , `log_archive_path` , `check_external_commands` , `command_check_interval` , `command_file` , `downtime_file` , `comment_file` , `lock_file` , `retain_state_information` , `state_retention_file` , `retention_update_interval` , `use_retained_program_state` , `use_retained_scheduling_info` , `use_syslog` , `log_notifications` , `log_service_retries` , `log_host_retries` , `log_event_handlers` , `log_initial_states` , `log_external_commands` , `log_passive_checks` , `global_host_event_handler` , `global_service_event_handler` , `sleep_time` , `service_inter_check_delay_method` , `host_inter_check_delay_method` , `service_interleave_factor` , `max_concurrent_checks` , `max_service_check_spread` , `max_host_check_spread` , `service_reaper_frequency` , `interval_length` , `auto_reschedule_checks` , `auto_rescheduling_interval` , `auto_rescheduling_window` , `use_agressive_host_checking` , `enable_predictive_host_dependency_checks`, `enable_flap_detection` , `low_service_flap_threshold` , `high_service_flap_threshold` , `low_host_flap_threshold` , `high_host_flap_threshold` , `soft_state_dependencies` ,`enable_predictive_service_dependency_checks` , `service_check_timeout` , `host_check_timeout` , `event_handler_timeout` , `notification_timeout` , `ocsp_timeout` , `ochp_timeout` , `perfdata_timeout` , `obsess_over_services` , `ocsp_command` , `obsess_over_hosts` , `ochp_command` , `process_performance_data` , `host_perfdata_command` , `service_perfdata_command` , `host_perfdata_file` , `service_perfdata_file` , `host_perfdata_file_template` , `service_perfdata_file_template` , `host_perfdata_file_mode` , `service_perfdata_file_mode` , `host_perfdata_file_processing_interval` , `service_perfdata_file_processing_interval` , `host_perfdata_file_processing_command` , `service_perfdata_file_processing_command` , `check_for_orphaned_services` , `check_service_freshness` , `service_freshness_check_interval` , `cached_host_check_horizon`, `cached_service_check_horizon` , `additional_freshness_latency` , `check_host_freshness` , `host_freshness_check_interval` , `date_format` , `illegal_object_name_chars` , `illegal_macro_output_chars` ,`use_large_installation_tweaks` , `free_child_process_memory` , `child_processes_fork_twice` , `debug_file` , `debug_level` , `debug_verbosity` , `max_debug_file_size` , `enable_environment_macros` , `use_regexp_matching` , `use_true_regexp_matching` , `admin_email` , `admin_pager` , `nagios_comment` , `nagios_activate`, `broker_module`, `event_broker_options` , `enable_embedded_perl` , `use_embedded_perl_implicitly` ) VALUES (NULL, 'nagios.cfg 28 07 2008 - 17:37:09', NULL, '/usr/local/nagios/var/nagios.log', '/usr/local/nagios/etc/', '/usr/local/nagios/var/objects.cache', '/usr/local/nagios/var/nagios.tmp', '/usr/local/nagios/var/status.dat', '/usr/local/nagios/bin/p1.pl', '2', '10', 'nagios', 'nagios', '1', '1', '1', '1', '1', '1', 'd', '/usr/local/nagios/var/archives', '1', '-1', '/usr/local/nagios/var/rw/nagios.cmd', NULL, NULL, '/usr/local/nagios/var/nagios.lock', '1', '/usr/local/nagios/var/retention.dat', '60', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', NULL, NULL, '0.25', 's', 's', 's', '0', '30', '30', NULL, '60', '0', '30', '180', '2', '1', '1', '5.0', '20.0', '5.0', '20.0', '0', '1', '60', '30', '30', '30', '5', NULL, '5', '0', NULL, '0', NULL, '1', NULL, NULL, NULL, '/home/nagios/nagiosgraph/log/perfdata.log', NULL, '$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$S ERVICEOUTPUT$||$SERVICEPERFDATA$', NULL, 'a', NULL, '30', NULL, '167', '1', '1', '60', '15', '15', '15', '0', '60', 'euro', '`~!$%^&*|'"<>?,()=', '`~$&|'"<>', '0', '2', '2', '/usr/local/nagios/var/nagios.debug', '0', '1', '1000000', '1', '0', '0', 'nagios@localhost', 'pagenagios@localhost', 'nagios.cfg 28/07/2008 - 17:37:09', '0','/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg', '-1') '2', '2' ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2', '2' )' at line 1]

Nagios 3.0 works fine with this nagios.cfg file and all seems right. What could be the reason of this problem??

Thank you very much

attagis
07-28-2008, 08:38 PM
Well it's seems it's a problem with the SQL sentence INSERT...There are some sintax errors that I don't know why appear. For example...there is a ')' at the end of the sentence, when the `enable_embedded_perl` , `use_embedded_perl_implicitly` attributes are being inserted. There is another error when the attributes `illegal_object_name_chars` and `illegal_macro_output_chars` are being inserted. There are some character like ' and " that causes the sentence to cash. I've managed to insert the data manually, but of course, that's not the right way.

Is it any kind of bug solved in the new beta release or is it something i'm doing in the wrong way??

Thanks again

inot
08-04-2008, 03:15 PM
got the same error, any updates?

DB Error : INSERT INTO cfg_nagios (`nagios_id` , `nagios_name` , `nagios_server_id`, `log_file` , `cfg_dir` , `object_cache_file` , `temp_file` , `status_file` , `p1_file`, `aggregate_status_updates` , `status_update_interval` , `nagios_user` , `nagios_group` , `enable_notifications` , `execute_service_checks` , `accept_passive_service_checks` , `execute_host_checks` , `accept_passive_host_checks` , `enable_event_handlers` , `log_rotation_method` , `log_archive_path` , `check_external_commands` , `command_check_interval` , `command_file` , `downtime_file` , `comment_file` , `lock_file` , `retain_state_information` , `state_retention_file` , `retention_update_interval` , `use_retained_program_state` , `use_retained_scheduling_info` , `use_syslog` , `log_notifications` , `log_service_retries` , `log_host_retries` , `log_event_handlers` , `log_initial_states` , `log_external_commands` , `log_passive_checks` , `global_host_event_handler` , `global_service_event_handler` , `sleep_time` , `service_inter_check_delay_method` , `host_inter_check_delay_method` , `service_interleave_factor` , `max_concurrent_checks` , `max_service_check_spread` , `max_host_check_spread` , `service_reaper_frequency` , `interval_length` , `auto_reschedule_checks` , `auto_rescheduling_interval` , `auto_rescheduling_window` , `use_agressive_host_checking` , `enable_predictive_host_dependency_checks`, `enable_flap_detection` , `low_service_flap_threshold` , `high_service_flap_threshold` , `low_host_flap_threshold` , `high_host_flap_threshold` , `soft_state_dependencies` ,`enable_predictive_service_dependency_checks` , `service_check_timeout` , `host_check_timeout` , `event_handler_timeout` , `notification_timeout` , `ocsp_timeout` , `ochp_timeout` , `perfdata_timeout` , `obsess_over_services` , `ocsp_command` , `obsess_over_hosts` , `ochp_command` , `process_performance_data` , `host_perfdata_command` , `service_perfdata_command` , `host_perfdata_file` , `service_perfdata_file` , `host_perfdata_file_template` , `service_perfdata_file_template` , `host_perfdata_file_mode` , `service_perfdata_file_mode` , `host_perfdata_file_processing_interval` , `service_perfdata_file_processing_interval` , `host_perfdata_file_processing_command` , `service_perfdata_file_processing_command` , `check_for_orphaned_services` , `check_service_freshness` , `service_freshness_check_interval` , `cached_host_check_horizon`, `cached_service_check_horizon` , `additional_freshness_latency` , `check_host_freshness` , `host_freshness_check_interval` , `date_format` , `illegal_object_name_chars` , `illegal_macro_output_chars` ,`use_large_installation_tweaks` , `free_child_process_memory` , `child_processes_fork_twice` , `debug_file` , `debug_level` , `debug_verbosity` , `max_debug_file_size` , `enable_environment_macros` , `use_regexp_matching` , `use_true_regexp_matching` , `admin_email` , `admin_pager` , `nagios_comment` , `nagios_activate`, `broker_module`, `event_broker_options` , `enable_embedded_perl` , `use_embedded_perl_implicitly` ) VALUES (NULL, 'nagios.cfg 04 08 2008 - 16:10:24', NULL, '/usr/local/nagios/var/nagios.log', '/usr/local/nagios/etc/', '/usr/local/nagios/var/objects.cache', '/usr/local/nagios/var/nagios.tmp', '/usr/local/nagios/var/status.dat', NULL, '1', '15', 'nagios', 'nagios', '1', '1', '1', '1', '0', '1', 'd', '/usr/local/nagios/var/archives', '1', '-1', '/usr/local/nagios/var/rw/nagios.cmd', '/usr/local/nagios/var/downtime.dat', '/usr/local/nagios/var/comments.dat', '/usr/local/nagios/var/nagios.lock', '1', '/usr/local/nagios/var/retention.dat', '60', '1', '0', '1', '1', '1', '1', '1', '0', '1', '0', NULL, NULL, '0.25', 'n', 'n', '1', '50', '1', '30', '10', '60', '2', '30', '180', '1', '2', '2', '5.0', '20.0', '5.0', '20.0', '2', '2', '60', '30', '30', '30', '5', NULL, '5', '2', NULL, '2', NULL, '1', '44', '45', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', '1', NULL, NULL, NULL, NULL, '0', '60', 'euro', NULL, NULL, '2', '2', '2', NULL, NULL, '2', NULL, '2', '2', '2', 'nagios@netcracker.com', 'pagenagios', 'nagios.cfg 04/08/2008 - 16:10:24', '0','/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg', '-1') '2', '2' ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2', '2' )' at line 1]