Thruk +Nagios + LiveStatus + pnp4nagios + multiple Nagios Backends

  • Hi,
    I have installed Thruk with Nagios + PNP4nagios + Livestatus on one machine and i have also connected multiple Nagios servers to Thruk via livestatus and all working fine.
    My last piece on the puzzle is to figure out how to show the graphs from the remotes Nagios servers.
    Will be glad to get some hints :-)


    Thanks alot!
    Amit

  • Hi Sni,
    thanks for your replay.


    you mean to do something like this on the remote Nagios server:


    define host {
    name host-pnp
    action_url 192.168.10.10/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
    register 0
    }


    define service {
    name srv-pnp
    action_url 192.168.10.10/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
    register 0
    }


    if so, it doesnt work...


    im getting this error on Thruk when trying to view th graph:
    The requested URL /thruk/cgi-bin/192.168.10.10/pnp4nagios/index.php/graph was not found on this server.


    how can i make Thruk go to this URL: 192.168.10.10/pnp4nagios/index.php/graph
    without the beginning? /thruk/cgi-bin

  • Hey,


    Change the action URL as follow :

    Code
    1. action_url http://12.34.45.67/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$


    http:// is required to set a full link and not a relative


    EDIT : A useful usage of this parameter is to set a template with the action_url in it for the service definition. In that way, if you need to install some new remote Nagios & Thruk servers, you will need to copy/paste the config file or whatever you want, and just need to change once the IP address of the service template. You will be able to use this template only for services that need the graph. In fact, if your remote Nagios server change of public IP, you will need to change all the action_url line for all service if you are doing it without template.

    The post was edited 3 times, last by Aclaudet ().

  • Cool, thanks for the replay.
    So now it's working smoothly for all the services( changed only the template)
    Now the only thing that doesn't work yet, is the graph popup (on the remote Nagios). the popup works on the local nagios.
    im getting this error: sorry, the contents could not be loaded.
    any idea how to fix it?

    The post was edited 1 time, last by amitw ().

  • my PNP4nagios configuration template looks like this:


    define host {
    name host-pnp
    action_url http://nagios.selftest/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
    register 0
    }


    define service {
    name srv-pnp
    action_url http://nagios.selftes/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
    register 0
    }



    Graphs are working fine only when i click the graph button near each service. the popup not working yet.

  • Hi sni,
    both action_url are already configured with absolute urls starting with http://......
    Have i missed something?

  • Hi,


    I think what Sni was telling you is to adjust the second URL in the same line. There is a rel parameter with an URL.


    replace

    Code
    1. action_url http://nagios.selftes/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$


    by this



    Code
    1. action_url http://nagios.selftes/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='http://nagios.selftes/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
  • I had this problem once with two different OMD sites.
    I was able to solve this with mod_rewrite.
    See here for a solution (soory but it is in German).

    ~~ Never touch a running system ~~
    ~~ Never run a touchy system ~~

  • I'll test it and update you.
    Thanks

    The post was edited 1 time, last by amitw ().

  • Hi,
    I couldn't mange to get it work =.
    I have tried to follow the thread in German (Translated it to English) but still, its not working.
    Any idea?

  • Please show the config and what link is displayed in the bottom left corner when you hoover over a charting icon

    ~~ Never touch a running system ~~
    ~~ Never run a touchy system ~~