Thruk with Icinga 2 reports problems

  • Hi,


    I've setup Icinga 2 (2.6.0-1) system recently. After that I added Thruk (2.12-3) to create some reports. However, I have the following two problems:

    1. The reports for hosts are empty, the reports for services are O.K.

    2. The pnp graphs are not included in services reports


    I turned on the the debug logging and I see the following problem for graphs:

    [


    '1',


    '0',


    '/pnp4nagios/graph?host=$HOSTNAME$\' class=\'tips\' rel=\'/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_',


    '/pnp4nagios/graph?host=\' class=\'tips\' rel=\'/pnp4nagios/popup?host=&srv=_HOST_',


    '1',


    '10.12.3.11',


    'Test router1',


    'check_hostalive!',


    '1',


    '5',


    undef,


    It seems that the macro variables are not translated!?


    However I was not able to get any info why hosts reports are empty. It seems to me a little bit strange since Thruk should be supported with Icinga 2. Can anybody help?


    Stager

  • Yes, I tried and the generated URL is O.K.:

    + PNP_WGET='wget -q'

    + '[' '' '!=' '' ']'

    + '[' -e /root/.thruk ']'

    + '[' -e /root/.profile ']'

    + HOST=PCA1

    + SERVICE=temp

    + WIDTH=500

    + HEIGHT=100

    + START=1484890125

    + END=1484904525

    + PNPURL=http://10.1.10.5/pnp4nagios

    + TEMPFILE=/tmp/tt1

    + SOURCE=

    + '[' http://10.13.10.12/pnp4nagios '!=' '' ']'

    + PNPURL=http://10.13.10.12/pnp4nagios

    + export 'REQUEST_URI=image?host=PCA1&srv=temp&view=1&source=&graph_width=500&graph_height=100&start=1484890125&end=1484904525'

    + REQUEST_URI='image?host=PCA1&srv=temp&view=1&source=&graph_width=500&graph_height=100&start=1484890125&end=1484904525'

    + '[' http: '!=' http: -a http:/ '!=' https: ']'

    + wget -q -O /tmp/tt1 'http://10.1.10.5/pnp4nagios/image?host=PCA1&srv=temp&view=1&source=&graph_width=500&graph_height=100&start=1484890125&end=1484904525'


    The problem is in somewhere else. Have you seen my debug log, a very strange URL (host parameter is empty):

    '/pnp4nagios/graph?host=\' class=\'tips\' rel=\'/pnp4nagios/popup?host=&srv=_HOST_',


    and the problem with empty hosts report? Thank you.

  • It is not a remote location. All SW is on the same machine and it is a test system. O.K. I've debbuged a little bit and I found out that the roblemn might be because of the "action_url_expanded" parameter which "host" parameter is empty:


    PNP problem (Icinga 2 + Thruk):
    $VAR1 = {
    'accept_passive_checks' => '1',
    'acknowledged' => '0',
    'action_url' => '/pnp4nagios/graph?host=$HOSTNAME$\' class=\'tips\' rel=\'/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_',
    'action_url_expanded' => '/pnp4nagios/graph?host=\' class=\'tips\' rel=\'/pnp4nagios/popup?host=&srv=_HOST_',
    'active_checks_enabled' => '1',
    'address' => '10.12.3.11',
    'alias' => 'Test APC1',



    O.K. (OMD 2.10 with Icinga 1 Core):
    $VAR1 = {
    'accept_passive_checks' => 1,
    'acknowledged' => 0,
    'action_url' => '/mon7/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_\' class=\'tips\' rel=\'/mon7/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_',
    'action_url_expanded' => '/mon7/pnp4nagios/index.php/graph?host=CX4-240&srv=_HOST_\' class=\'tips\' rel=\'/mon7/pnp4nagios/index.php/popup?host=CX4-240&srv=_HOST_',
    'active_checks_enabled' => 1,
    'address' => '10.3.13.23',
    'alias' => 'CX4-240',


    I also found that the url problem is already in function "get_hosts":

    sub get_hosts {


    my($self, @args) = @_;


    already in $self variable. Now I am trying to found out from where the $self variable gets the values.


    If anybody can help?

  • Might be a problem Icinga 2 livestatus:

    GET hosts


    Columns: accept_passive_checks acknowledged action_url action_url_expanded active_checks_enabled address alias check_command check_freshness check_interval check_options check_period check_type checks_enabled childs comments current_attempt current_notification_number event_handler event_handler_enabled execution_time custom_variable_names custom_variable_values first_notification_delay flap_detection_enabled groups has_been_checked high_flap_threshold icon_image icon_image_alt icon_image_expanded is_executing is_flapping last_check last_notification last_state_change latency low_flap_threshold max_check_attempts name next_check notes notes_expanded notes_url notes_url_expanded notification_interval notification_period notifications_enabled num_services_crit num_services_ok num_services_pending num_services_unknown num_services_warn num_services obsess_over_host parents percent_state_change perf_data plugin_output process_performance_data retry_interval scheduled_downtime_depth state state_type modified_attributes_list last_time_down last_time_unreachable last_time_up display_name in_check_period in_notification_period


    Filter: name = APCA1


    OutputFormat: json


    ResponseHeader: fixed16
    200 733


    [[1.0,0.0,"/pnp4nagios/graph?host=$HOSTNAME$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_","/pnp4nagios/graph?host=' class='tips' rel='/pnp4nagios/popup?host=&srv=_HOST_",1.0,"10.12.3.11","Test APC1","check_hostalive!",1.0,5.0,null,"24x7",0.0,1.0,[],[],1.0,0.0,null,1.0,4.0277271270751953125,["os","sla"],["APC Klima","24x7"],"",0.0,["apc-klime"],1.0,30.0,"","",null,0.0,false,1485172954.0,0.0,1482920700.0,0.000731945037841796875,30.0,3.0,"APCA1",1485173250.0,"Test APC1","Test APC1","",null,1.0,"",1.0,0.0,2.0,0.0,0.0,0.0,2.0,0.0,[],0.0,"rta=4.048000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0","PING OK - Packet loss = 0%, RTA = 4.05 ms",0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1485172954.0,"Test APC1",1.0,0.0]]


    On OMD system I get the following output:

    GET hosts


    Columns: accept_passive_checks acknowledged action_url action_url_expanded active_checks_enabled address alias check_command check_freshness check_interval check_options check_period check_type checks_enabled childs comments current_attempt current_notification_number event_handler event_handler_enabled execution_time custom_variable_names custom_variable_values first_notification_delay flap_detection_enabled groups has_been_checked high_flap_threshold icon_image icon_image_alt icon_image_expanded is_executing is_flapping last_check last_notification last_state_change latency low_flap_threshold max_check_attempts name next_check notes notes_expanded notes_url notes_url_expanded notification_interval notification_period notifications_enabled num_services_crit num_services_ok num_services_pending num_services_unknown num_services_warn num_services obsess_over_host parents percent_state_change perf_data plugin_output process_performance_data retry_interval scheduled_downtime_depth state state_type modified_attributes_list last_time_down last_time_unreachable last_time_up display_name in_check_period in_notification_period


    Filter: name = localhost


    OutputFormat: json


    ResponseHeader: fixed16
    200 1065


    [[1,0,"/mon7/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/mon7/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_","/mon7/pnp4nagios/index.php/graph?host=localhost&srv=_HOST_' class='tips' rel='/mon7/pnp4nagios/index.php/popup?host=localhost&srv=_HOST_",1,"10.9.9.11","localhost","check-mk-host-ping!-w 200.00,80.00% -c 500.00,100.00%",0,1.0000000000e+00,0,"24X7",0,1,[],[],1,0,"",0,2.5840000000e-03,["FILENAME","ADDRESS_4","ADDRESS_6","ADDRESS_FAMILY","TAGS"],["/wato/linux/hosts.mk","10.9.9.11","","4","/wato/linux/ LJ cmk-agent ip-v4 ip-v4-only lan prod site:jb6 tcp wato"],0.0000000000e+00,1,["LJ"],1,0.0000000000e+00,"","","",0,0,1485173659,1481831655,1481831655,1.1147713661e-01,0.0000000000e+00,1,"localhost",1485173720,"","","ssh://$HOSTADDRESS$","ssh://10.9.9.11",0.0000000000e+00,"24X7",1,11,29,0,0,4,44,1,[],0.0000000000e+00,"rta=0.021ms;200.000;500.000;0; pl=0%;80;100;; rtmax=0.054ms;;;; rtmin=0.012ms;;;;","OK - 10.9.9.11: rta 0.021ms, lost 0%",1,1.0000000000e+00,0,0,1,[],1481831652,0,1485173660,"localhost",1,1]]


    Can that be a problem?