sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
409 stars 149 forks source link

Thruk fails to start on fresh install #621

Closed furiml closed 8 years ago

furiml commented 8 years ago

Hi there, I've installed Thruk to use it with Shinken. I've been through the Shinken & Thruk documentation to setup everything, but I had a problem when adding my first backend. Shinken and Thruk both run on the same machine, but I get a "failed to connect - Connection refused (127.0.0.1:50000)" when I try to add the shinken backend.

I believe livestatus is configured and enabled... Being new to monitoring, I'm not sure. But I think I got it right. Here's my /etc/shinken/modules/livestatus.cfg

define module {
    module_name     livestatus
    module_type     livestatus
    host            *           ; * = listen on all configured IP addresses
    port            50000       ; port to listen
    #socket          /usr/local/shinken/var/rw/live  ; If a Unix socket is required
    ## Available modules:
    # - logstore-sqlite: send historical logs to a local sqlite database
    # - logstore-mongodb: send historical logs to a mongodb database
    # - logstore-null : send historical logs to a black hole
    modules         logstore-sqlite
    #debug           /tmp/ls.debug   ; Enable only for debugging this module
    #debug_queries   0   ; Set to 1 to dump queries/replies too (very verbose)
}

I added livestatus to the module in the /etc/shinken/brokers/broker-master.cfg :

define broker {
    broker_name     broker-master
    address         localhost
    port            7772
    spare           0

    ## Optional
    manage_arbiters     1   ; Take data from Arbiter. There should be only one
                            ; broker for the arbiter.
    manage_sub_realms   1   ; Does it take jobs from schedulers of sub-Realms?
    timeout             3   ; Ping timeout
    data_timeout        120 ; Data send timeout
    max_check_attempts  3   ; If ping fails N or more, then the node is dead
    check_interval      60  ; Ping node every N seconds

    ## Modules
    # Default: None
    # Interesting modules that can be used:
    # - simple-log              = just all logs into one file
    # - livestatus              = livestatus listener
    # - tondodb-mysql           = NDO DB support (deprecated)
    # - npcdmod                 = Use the PNP addon
    # - graphite                = Use a Graphite time series DB for perfdata
    # - webui                   = Shinken Web interface
    # - glpidb                  = Save data in GLPI MySQL database
    modules     livestatus

    # Enable https or not
    use_ssl               0
    # enable certificate/hostname check, will avoid man in the middle attacks
    hard_ssl_name_check   0

    ## Advanced
    realm   All
}

Finaly, my /etc/thruk/thruk_local.conf looks like this

enable_shinken_features = 1
<Component Thruk::Backend>
    <peer>
        name    = livestatus
        type    = livestatus
        <options>
            peer          = 127.0.0.1:50000
        </options>
    </peer>
</Component>

Am I doing something wrong ?

Edit : on advice of one of my colleagues, i dug into shinken logs. Seems like the logstore-sqlite module had trouble during installation... Reinstalled it, reviewed configurations, crossed the finger... And now it works.

sni commented 8 years ago

thanks for the update

Monchxa commented 6 years ago

define module{ module_name Livestatus module_type livestatus host * port 50000 ; port to listen database_file /var/lib/shinken/livestatus.dbx }