General
What is Thruk?
Thruk is a Webgui for Nagios (and compatible) based on the Livestatus API. It’s capable of merging multiple cores into a single display while being much faster than the original cgis. In addition there have been tons of usability improvments and there are plenty of useful addons included like a dashboard, business process addons, a configuration interface and many more…
Is Thruk an Abbreviation? What does Thruk mean?
Thruk is just a random word and has no meaning. Pronounce it like Truck.
Where is the statusmap?
The statusmap got replaced by a own variant which is more scalable in large environments. Its shipped as Thruk addon, but enabled by default. See the plugins page for details and screenshots.
Authorization/Authentication is not working
Authentication is done by the webserver, so authentication is only available with the fastcgi version.
All dates and times are displayed with the wrong timezone
Try to set the use_timezone configuration option in your thruk_local.conf
Usage
How do i select hosts/services on the status page?
Just click on the empty table row when the row is highlighted. This only works if you do not click on a link.
Where can i see the full command line for a host or servicecheck?
You have to enable the option set show_full_commandline. It’s disabled for security reasons by default. So be careful to not display any passwords though the webinterface.
Customization
How to change the side menu
The main left menu is highly editable through menu_local.conf. It is recommended apply changes only to your menu_local.conf in order to avoid conflicts on updating Thruk.
Open your menu_local.conf (create one if it does not exists) with your preferred text editor and check the config.
Adding new Section
You can add new sections with:
add_section('name' => 'General');
Adding a new Link
To add a new link use the following syntax:
add_link('name' => 'Home', 'href' => '/thruk/main.html');
-
name: This is how the link is called in the web front end.
-
href: This is the destination link optional you can add.
-
target: If Link shall open in a new window.
-
icon: Used for themes which support icons.
Then the config looks like this:
add_link('name' => 'Nagios, 'href' => '/nagios', 'target' => '_new');
add_link always adds the new link to the last section. Use insert_item to add a link to any section.
Including original side navigation
You can include the main menu config with the perl do statement. Ex.: If you just want to add a new link to your config menu, your menu_local.conf could look like this:
do $ENV{'OMD_ROOT'}.'/share/thruk/menu.conf'; add_link('name' => 'Wato', 'href' => '/'.$ENV{'OMD_SITE'}.'/check_mk/wato.py?filename=wato.mk');
This example just puts the Wato link from check_mks Multisite in your config section. Replace the ENV part with a proper path if you do not use OMD.
Inserting item in existing Section
Adding Items to existing sections can also be achieved by insert_item:
do $ENV{'OMD_ROOT'}.'/share/thruk/menu.conf'; insert_item('General', { 'href' => 'http://your-company.com', 'name' => 'Company' });
Removing item in existing Section
Existing Items can be removed with the remove_item function:
do $ENV{'OMD_ROOT'}.'/share/thruk/menu.conf'; remove_item('Reports', 'Availability');
Make item available for some groups only
Just wrap your changes in a has_group.
if(has_group($c, 'Admins')) { add_section('name' => 'Admins Only'); add_link('name' => 'Admin Link', 'href' => '.../only_for_admins.html'); }
Make item available for some roles only
Just wrap your changes in a has_role.
if(has_role($c, 'authorized_for_configuration_information')) { add_section('name' => 'Some Roles Only'); add_link('name' => 'Admin Link', 'href' => '.../only_for_some_roles.html'); }
How can i integrate Nagvis Maps
Integrating Nagivs is currently only possible when frames are enabled. So first step is editing the thruk_local.conf and set
use_frames = 1
Integration is easy. Just copy and edit your menu_local.conf. For Nagvis 1.4 add something like:
add_section('name' => 'Nagvis'); add_link('name' => "Nagvis", 'href' => '/nagvis/frontend/nagvis-js/index.php'); add_sub_link('name' => "demo", 'href' => '/nagvis/index.php?Map=demo'); add_sub_link('name' => "demo-map2", 'href' => '/nagvis/index.php?Map=demo-map2');
For Nagvis 1.5:
add_section('name' => 'Nagvis'); add_link('name' => "Nagvis", 'href' => '/nagvis/frontend/nagvis-js/index.php'); add_sub_link('name' => "demo", 'href' => '/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=demo'); add_sub_link('name' => "demo-map2", 'href' => '/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=demo-map2');
Thruk has to be restarted.
How can i integrate Nagvis Maps in the Panorama Dashboard
Choose Generic Url Panlet from the New Panlet list. Then enter the following url:
/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=demo-automap
Replace demo-automap with the name of your map. If you use OMD, you have to prepend the site name to the url.
|
nagvis panel
There is a dedicated nagvis panel since Thruk release 1.78. |
How can i add more themes?
Themes are located under themes. Just copy and modify the one you like. See the themes page for details.
How can i disable themes?
Themes can be disabled by removing the symlink from your themes/themes-enabled directory. See the themes page for details.
How can i customize reports?
Customizing reports is coverd in the official documenation.
Why are the PNP graphs missing in my reports?
First you need a working PNP installation. Then check the official documenation.
If nothing helps, add some debug output to the script which is responsible for the pnp export (experienced users only).
Add these lines to plugins/plugins-available/reports2/script/pnp_export.sh.
exec >/tmp/pnp.log 2>&1 set -x
Then regenerate a report and investigate that new logfile.
How can i create a readonly Panorama dashboard for my boss
In combination with the user specific settings, this can easily be achieved in your thruk_local.conf:
<User boss> <Component Thruk::Plugin::Panorama> default_view = /var/lib/thruk/panorama_view.boss readonly = 1 </Component> </User>
The default view can be exported from the Settings menu inside the panorama dashboard.
How can i set custom page titles
There are few ways to do this. The first way is you can turn on the use_bookmark_titles in your thruk_local.conf:
use_bookmark_titles = 1
Now anytime you go to one of your Thruk bookmarks the name of that bookmark will be used as the page title. The second option is on most pages adding title=your title here to the url will set a custom title
How can i enable form based authentication
In order to use the form or cookie based authentication like demo.thruk.org does, you have to do two small changes in your apache configuration. Get thruk_cookie_auth.example and put everything except the RewriteLock into the virtualhost of your choice. The RewriteLock must be outside any virtualhost. After that, restart the apache.
Installation
Is it possible to operate Thruk in a cluster?
Yes, just put a load balancer before 2 (or more) Thruk installations and make sure the var_path directory is shared between all instances ( by NFS, DRBD or similar ). There is usually not much traffic in this folder.
How can i enable the business process addon.
It works out of the box with OMD. If not using OMD, some manual steps are required which are described in the official documenation.
Hacking Thruk
Within OMD
If you are using OMD, then you just might want to follow this guide: https://github.com/sni/omd_utils/tree/master/thruk_developer Which connects a test OMD site to the git version of Thruk. This works quite well as long as there are only small changes in the perl module dependencies.
The installer adds a new OMD daemon which restarts Thruk whenever you change a perl file or template.
Install Test Environment from Source
-
First get a fresh copy of the sources:
/tmp %> git clone git://github.com/sni/Thruk.git
-
Create a .author file which prevents some caching mechanisms.
/tmp %> cd Thruk && touch .author
-
use perl dependencies from existing installation.
/tmp/Thruk %> export PERL5LIB=/usr/lib/thruk/perl5
Refer to the official documentation on how to install Thruk: http://www.thruk.org/documentation.html#_installation
-
start development server
/tmp/Thruk %> ./script/thruk_server.pl -r HTTP::Server::PSGI: Accepting connections at http://0:3000/
-
hack Thruk…
-
create a git patch
review and commit your changes, then create a patch file which can be sent upstream to the author.
/tmp/Thruk %> git commit -av /tmp/Thruk %> git format-patch -o /tmp/ --signoff -1
Errors
Backend not available
The socat solution for using livestatus with SSL does not longer work due to problems with socat and json data. If you see errors like:
[ERROR][Thruk.Controller.Root] Caught exception in Thruk::Controller::status->index "socket error at thruk/script/../lib/Monitoring/Livestatus/Class/Base/Table.pm line 186" [ERROR][Thruk.Controller.error] internal server error
and you use socat for livestatus over ssl, please change to stunnel or ssh with the normal xinetd solution.
undefined symbol: Perl_Istack_sp_ptr
You will get perl errors about undefined symbols when you try to install a debian package on ubuntu or a ubuntu 11 deb file on ubuntu 12 or any package on a different platform than the package was build for.
/usr/bin/perl: symbol lookup error: /usr/lib/thruk/perl5/x86_64-linux-gnu-thread-multi/auto/List/Util/Util.so: undefined symbol: Perl_Istack_sp_ptr
The solution is simple: use the right package for your distribution. If there is no package is available for your platform, use the source installation.
Broken PDF Reports in Centos/Rhel 5
PDF reports won’t work with libcairo < 1.8.8. Therefor you may use the prepared packages for cairo 1.8.8 on rhel/centos 5 on the download page.
The new reports2 module should work fine, even on older Redhat boxes.
Premature end of script headers: fcgid_env.sh
A few things to check:
-
check the apache error log for more details.
-
check the thruk logfile, usually located in /var/log/thruk/error.log
-
if you are using Redhat/Centos, check if you have SELinux enabled:
#>getenforce Disabled
Enforcing means SELinux is enable. Details can be found in the audit log: /var/log/audit/audit.log. SELinux can be disabled in /etc/selinux/config (you will have to reboot once to make the changes active).
SELINUX=disabled
Read more about SELinux on http://wiki.centos.org/HowTos/SELinux