How to install Thruk

Introduction

Thruk is an independent multibackend monitoring webinterface which currently supports Nagios (Icinga and Shinken) as backend using the MKLivestatus addon.

Requirements

You need to install :

  • FAN 2.2

Installation

Download thruk to http://www.thruk.org/download.html. Use Centos 32bit or 64bit package.

The installation is runnning on FAN 2.2-rc1 64bit and using Thruk-1.1.4-x86_64-linux-thread-multi-5.8.8.tar.gz

# adduser thruk
# chmod +rx /home/thruk
# su - thruk
thruk~$ cd /home/thruk
thruk~$ tar xzf Thruk-1.1.4-x86_64-linux-thread-multi-5.8.8.tar.gz
thruk~$ ln -s Thruk-1.1.4 Thruk
thruk~$ cd Thruk
thruk~$ perl -I./local-lib/lib/perl5 Makefile.PL
thruk~$ make
thruk~$ cp thruk.conf thruk_local.conf

Edit thruk_local.conf file and replace this configuration :

use_frames          = 1
statusmap_default_type=circle
    <peer>  
        name   = Local Nagios
        type   = livestatus
        <options>
            peer          = /var/log/nagios/rw/live
            resource_file = /etc/nagios/resource.cfg
       </options>
    </peer>

Edit cgi.cfg file

default_user_name=nagiosadmin
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

As root, copy thruk daemon file in /etc/init.d

# cp script/thruk_fastcgi_server.sh /etc/init.d/

As root, run :

# chown -R nagios:nagios /home/thruk/Thruk-1.1.4

Modify file /etc/init.d/thruk_fastcgi_server.sh :

EXECUSER=nagios

 

Install mod_fastcgi for Apache

Download tar.gz file :

# wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz

 

Installation :

# yum install httpd-devel
# tar xzf mod_fastcgi-current.tar.gz
# cd mod_fastcgi-2.4.6
# apxs -i -I . -o mod_fastcgi.so -c *.c

 

Thruk config for Apache :

Edit the /etc/httpd/conf.d/thruk.conf file :

LoadModule fastcgi_module modules/mod_fastcgi.so
FastCGIExternalServer /tmp/thruk_fastcgi.fcgi -socket /tmp/thruk_fastcgi.socket -idle-timeout 120
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/thruk(.*)$ /tmp/thruk_fastcgi.fcgi/thruk$1 [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

<Directory /home/thruk/Thruk/root/>
    order allow,deny
    allow from all
    Options FollowSymLinks
    AllowOverride All
</Directory>

Alias /thruk/ /home/thruk/Thruk/root/thruk/

# Authorization
<Location "/thruk">
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios/htpasswd.users
    Order Allow,Deny
    Allow from all
    require valid-user
</Location>

 

Start Thruk

/etc/init.d/thruk_fastcgi_server.sh start

 

Restart Apache

/etc/init.d/httpd restart

 

Connect to http://@_IP_FAN_SERVER/thruk/ and use login/password : nagiosadmin/nagiosadmin

  • #1 written by san
    about 5 years ago

    I can’t access to Thruk after already install.
    No any error on this manula.

    ————————————-
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    Apache/2.2.3 (CentOS) Server at 192.168.1.122 Port 80

  • #2 written by lkco
    about 5 years ago

    Hi,
    maybe the errors come from fastcgi module. Try to run thruk manually : ./script/thruk_server.pl
    Open your browser and open http://:3000

  • #3 written by berlin
    about 5 years ago

    hello:
    I install thruk ,Open my browser and open http://my-ip/thruk,but There is a wrong
    internal server error

    i use thruk 1.4.4

    please help me!!!!!

  • #4 written by lkco
    about 5 years ago

    Hi Berlin,
    sorry, I have not tested the latest version of Thruk 1.1.4.
    I will try to update the documentation

  • #5 written by lkco
    about 5 years ago

    Hi Berlin,
    i just tested thruk 1.1.4, it works perfecty. I updated the documentation

  • #6 written by Zeed
    about 5 years ago

    I install Thruk. try to start and get this error. I follow all the steps but it not working. Any help?? I’m using Thruk 1.1.4.
    Try to run thruk manually : ./script/thruk_server.pl <– working
    Thanks

    /etc/init.d/thruk_fastcgi_server.sh start
    Starting/etc/rc.d/init.d/thruk_fastcgi_server.sh: line 80: cd: /home/thruk/Thruk: Permission denied

  • #7 written by lkco
    about 5 years ago

    Hi,
    try to set this permission :

    # chmod +rx /home/thruk/

    and verify the link /home/thruk/Thruk exist

Comments are closed.