Action Menu

new in release v1.86

The Action Menu is a way to create custom icons and menus for every host or service. You may add multiple action icons or even multiple menus for each host or service. You can then open links or trigger server actions from that menu or icons.

Action Menu

Adding an Action Menu

There are 3 ways to add an action menu to a host or service.

  • set the menu directly by the _THRUK_ACTION_MENU custom variable

  • reference an existing menu from the action_menu_items by a _THRUK_ACTION_MENU custom variable

  • use apply rules from action_menu_apply

The are some examples in the configuration documentation.

Server Actions

Server Action can be triggered from icons or menu items by using a pseudo url like this in your action urls. See the configuration section on how and where to set this link.


To make this work, you need to define that scriptname in your thruk_local.conf:

      scriptname   = /usr/local/bin/ $HOSTNAME$ $SERVICEDESC$

When somebody clicks on that link, Thruk will start the script like:

    /usr/local/bin/ <hostname> <servicename> argument1 argument2

First it uses the complete commandline from the thruk_local.conf and replaces all available macros. Then it adds the arguments from the link configuration.

See Macros for a list of all available macros.


The scripts can do whatever they want. However you should consider a few things:

  • Make the script exit quickly. Thruk waits for the script to return. Long running tasks should be started in the background.

  • Give the user useful feedback on STDOUT

  • Exit codes should be zero if OK and greater than zero on errors.

script output

Script output will be displayed as user response which allows the script to give feedback to the user. HTML is allowed and will be used in the output.


The Script will be run when ever the user has access to the given host and service. If your script wants to do some further checking, it can use the $REMOTE_USER environment variable.


Panorama Dashboard

This is a small example script which uses perl to change the color of a shaped icon.

icon settings

Dashboard Icon

    switch_color    = .../ $DASHBOARD_ID$ $DASHBOARD_ICON$

just changes the color of the icon.


use warnings;
use strict;
use Thruk::Utils;

my $file  = 'var/panorama/'.$ARGV[0].'.tab';
my $data  = Thruk::Utils::read_data_file($file);
my $color = $data->{$ARGV[1]}->{'xdata'}->{'appearance'}->{'shapecolor_ok'};
if($color eq '#CA1414') {
    $color = '#199C0F';
} else {
    $color = '#CA1414';
$data->{$ARGV[1]}->{'xdata'}->{'appearance'}->{'shapecolor_ok'} = $color;
Thruk::Utils::write_data_file($file, $data);

print "switched color to $color\n";
Edit page on GitHub