Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #6148] Config validator: Make sure that objects are not abstract. #1523

Closed
icinga-migration opened this issue May 8, 2014 · 15 comments

Comments

@icinga-migration
Copy link
Member

commented May 8, 2014

This issue has been migrated from Redmine: https://dev.icinga.com/issues/6148

Created by tobiasvdk on 2014-05-08 11:20:45 +00:00

Assignee: (none)
Status: Resolved (closed on 2014-05-09 17:45:03 +00:00)
Target Version: 0.0.11
Last Update: 2014-05-12 08:08:42 +00:00 (in Redmine)

Icinga Version: 0.0.10

Using icinga2-classicui on debian wheezy shows the following error message in the web ui:

Error: Could not read object configuration data!

Installed packages:

# dpkg -l | grep icinga
ii  icinga-cgi-bin                     1.11.1-1~debmon70+1                         amd64        host and network monitoring system - CGI scripts
ii  icinga2                            0.0.10~icingaautorelease201404291336~wheezy amd64        host and network monitoring system
ii  icinga2-bin                        0.0.10~icingaautorelease201404291336~wheezy amd64        host and network monitoring system - daemon
ii  icinga2-classicui                  0.0.10~icingaautorelease201404291336~wheezy all          host and network monitoring system - classic ui integration
ii  icinga2-common                     0.0.10~icingaautorelease201404291336~wheezy all          host and network monitoring system - common files
ii  icinga2-doc                        0.0.10~icingaautorelease201404291336~wheezy all          host and network monitoring system - documentation
ii  icinga2-ido-pgsql                  0.0.10~icingaautorelease201404291336~wheezy amd64        host and network monitoring system - IDO for PostgreSQL

cgi.cfg

# cat /etc/icinga2/classicui/cgi.cfg 
# Icinga 2 Classic UI configuration
#
# requires icinga-gui package
# check http://docs.icinga.org for option details
standalone_installation=1
physical_html_path=/usr/share/icinga
url_html_path=/icinga2-classicui
url_stylesheets_path=/icinga2-classicui/stylesheets
http_charset=utf-8
refresh_rate=30
refresh_type=1
escape_html_tags=1
result_limit=50
show_tac_header=1
use_pending_states=1
first_day_of_week=0
suppress_maintenance_downtime=0
action_url_target=main
notes_url_target=main
use_authentication=1
use_ssl_authentication=0
lowercase_user_name=0
authorized_for_system_information=icingaadmin
authorized_for_configuration_information=icingaadmin
authorized_for_full_command_resolution=icingaadmin
authorized_for_system_commands=icingaadmin
authorized_for_all_services=icingaadmin
authorized_for_all_hosts=icingaadmin
authorized_for_all_service_commands=icingaadmin
authorized_for_all_host_commands=icingaadmin
show_all_services_host_is_authorized_for=1
show_partial_hostgroups=0
show_partial_servicegroups=0
default_statusmap_layout=5
status_show_long_plugin_output=0
display_status_totals=0
highlight_table_rows=1
add_notif_num_hard=28
add_notif_num_soft=0
#use_logging=0
use_logging=1
cgi_log_file=/var/log/icinga/gui/icinga-cgi.log
cgi_log_rotation_method=d
cgi_log_archive_path=/var/log/icinga/gui
enforce_comments_on_actions=0
send_ack_notifications=1
persistent_ack_comments=0
lock_author_names=1
default_downtime_duration=7200
set_expire_ack_by_default=0
default_expiring_acknowledgement_duration=86400
default_expiring_disabled_notifications_duration=86400
tac_show_only_hard_state=0
show_tac_header_pending=1
exclude_customvar_name=PASSWORD,COMMUNITY
exclude_customvar_value=secret
extinfo_show_child_hosts=0
tab_friendly_titles=1
######################################
#    STANDALONE (ICINGA 2) OPTIONS
#    requires standalone_installation=1
######################################
object_cache_file=/var/cache/icinga2/objects.cache
status_file=/var/cache/icinga2/status.dat
resource_file=/etc/icinga/resource.cfg
command_file=/var/run/icinga2/cmd/icinga2.cmd
check_external_commands=1
interval_length=60
status_update_interval=10
log_file=/var/log/icinga2/compat/icinga.log
log_rotation_method=h
log_archive_path=/var/log/icinga2/compat/archives
date_format=us
#   EOF

Changesets

2014-05-09 17:40:56 +00:00 by gbeutner 0c31bae

Config validator: Make sure that objects are not abstract.

Fixes #6148

Relations:

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 8, 2014

Updated by mfriedrich on 2014-05-08 12:06:30 +00:00

  • Status changed from New to Closed

Get Classic UI 1.11.2 - #5940

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 11:52:17 +00:00

I updated to icinga-cgi-bin=1.11.2 but the errors still exist.

# dpkg -l | grep icinga-cgi-bin
ii  icinga-cgi-bin                     1.11.2-0pb1                                 amd64        host and network monitoring system - CGI scripts
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by mfriedrich on 2014-05-09 11:53:41 +00:00

  • Status changed from Closed to Feedback

set use_logging=1 in cgi.cfg and set the path to the cgi log file to an apache writable path. then post the output when triggering the error on the browser.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 12:20:31 +00:00

Thank you for your fast feedback!

Output from icinga-cgi.log:

# cat /var/log/icinga/gui/icinga-cgi.log 
[1399637789] Error: Service description, host name, or check command is NULL
[1399637789] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)
[1399637790] Error: Service description, host name, or check command is NULL
[1399637790] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)
[1399637793] Error: Service description, host name, or check command is NULL
[1399637793] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)
[1399637793] Error: Service description, host name, or check command is NULL
[1399637793] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)
[1399637824] Error: Service description, host name, or check command is NULL
[1399637824] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)
[1399637824] Error: Service description, host name, or check command is NULL
[1399637824] Error: Could not register service (config file '/var/cache/icinga2/objects.cache', starting on line 89)

In line 89 the following service definition starts:

define service {
        host_name       pserver101
        service_description     disk-var-partition
        display_name    disk-var-partition
        check_period    24x7
        check_interval  5.000000
        retry_interval  1.000000
        max_check_attempts      3
        active_checks_enabled   1
        passive_checks_enabled  1
        flap_detection_enabled  1
        is_volatile     0
        notifications_enabled   1
        notification_options    w,u,c,r,f,s
        notification_interval   30.000000
        notification_period     24x7
        event_handler_enabled   0
        contacts        icingaadmin
        contact_groups  icingaadmins
        initial_state   o
        low_flap_threshold      30.000000
        high_flap_threshold     30.000000
        process_perf_data       1
        check_freshness 1
        service_groups
        _disk   /var
        }
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by mfriedrich on 2014-05-09 12:33:25 +00:00

Ok. And now I want to see that config object in Icinga 2 for the involved host and service. Somehow the 'check_command' is not dumped.

Btw - any reason why to use the autorelease packages, and not snapshot as it's still in pre beta stage? That way you could test fixes more fast.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 12:46:56 +00:00

service config:

apply Service "disk-var-partition" to Host {
    import  "generic-service"

    check_command = "generic-disk-nrpe-check"
    vars.disk = "/var"

    assign where host.vars.has_var_partition
}

check command config:

template CheckCommand "generic-disk-nrpe-check" {
    import "plugin-check-command"

    command = PluginDir + "/check_nrpe"

        arguments = {
        "-u"
        "-H" = "$address$"
        "-t" = 20
        "-c" = "check_disk"
        "-a" = "$warning_threshold$ $critical_threshold$ $disk$"
        }

    vars.disk = "/"
    vars.warning_threshold = "20%"
    vars.critical_threshold = "10%"
}

dnsmichi wrote:

Btw - any reason why to use the autorelease packages, and not snapshot as it's still in pre beta stage?

No ... I will change apt config to use icinga-wheezy-snapshots.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 12:56:51 +00:00

Some background to my setup. I configured a clustered setup with two endpoints: one master and one slave (which is doing/should do the checks).

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 13:19:54 +00:00

Ohh, I upgraded to 0.0.10+icingasnap201405090855.020ca0b~wheezy and libcluster.so is missing!

[2014-05-09 15:08:40 +0200]  critical/config: 
Config error: ../../../lib/base/utility.cpp(386): Throw in function static void* icinga::Utility::LoadExtensionLibrary(const icinga::String&)
Dynamic exception type: boost::exception_detail::clone_impl >
std::exception::what: Could not load library 'libcluster.so': libcluster.so: cannot open shared object file: No such file or directory
[icinga::StackTrace*] = 
    (0) libbase.so: void boost::throw_exception >(boost::exception_detail::error_info_injector const&) (+0x4a) [0x7f38dd5c44ba] (??:0)
    (1) libbase.so: void boost::exception_detail::throw_exception_(std::runtime_error const&, char const*, char const*, int) (+0x54) [0x7f38dd5c4534] (??:0)
    (2) libbase.so: icinga::Utility::LoadExtensionLibrary(icinga::String const&) (+0x210) [0x7f38dd62d210] (??:0)
    (3) libconfig.so: yyparse(icinga::ConfigCompiler*) (+0x159a) [0x7f38dd2b47ba] (??:0)
    (4) libconfig.so: icinga::ConfigCompiler::Compile() (+0x76) [0x7f38dd2b9956] (??:0)
    (5) libconfig.so: icinga::ConfigCompiler::CompileStream(icinga::String const&, std::istream*) (+0xad) [0x7f38dd29dcbd] (??:0)
    (6) libconfig.so: icinga::ConfigCompiler::CompileFile(icinga::String const&) (+0x126) [0x7f38dd29e7f6] (??:0)
    (7) icinga2: Main() (+0x11b2) [0x4275f2] (??:0)
    (8) icinga2: main (+0x24) [0x425d34] (??:0)
    (9) libc.so.6: __libc_start_main (+0xfd) [0x7f38db890ead] (??:0)
    (10) /usr/sbin/icinga2() [0x425e2d]


[icinga::ContextTrace*] = 
    (0) Compiling configuration stream with name '/etc/icinga2/icinga2.conf'
    (1) Compiling configuration file '/etc/icinga2/icinga2.conf'


[2014-05-09 15:08:40 +0200]  critical/config: 1 errors, 0 warnings.
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by mfriedrich on 2014-05-09 14:16:00 +00:00

True. The cluster part is undergoing major changes in git next currently. Remove that configuration while testing this issue.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by tobiasvdk on 2014-05-09 14:46:24 +00:00

Is anything wrong with the service and check command configuration I did?

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by mfriedrich on 2014-05-09 16:30:21 +00:00

  • Target Version set to 0.0.11
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by gbeutner on 2014-05-09 17:35:52 +00:00

Hm, this seems to be a bug in the config validator. Your check command is a template: "template CheckCommand". Try changing that to "object CheckCommand" and see if that fixes the problem.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 9, 2014

Updated by gbeutner on 2014-05-09 17:45:03 +00:00

  • Status changed from Feedback to Resolved
  • Done % changed from 0 to 100

Applied in changeset 0c31bae.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2014

Updated by tobiasvdk on 2014-05-12 07:52:54 +00:00

Changing/correcting the config works. Thank you for the hint!

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2014

Updated by mfriedrich on 2014-05-12 08:08:42 +00:00

  • Subject changed from icinga2-classicui: Could not read object configuration data! to Config validator: Make sure that objects are not abstract.
  • Category set to Configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.