Version 15 (modified by 3 years ago) (diff) | ,
---|
OMD
ref from here
To allow menu to open a link and show in thruk frame, we need to config allowed_frame_links in
OMD[demo@a36aee5c525e]:~/etc/thruk$ pwd /omd/sites/demo/etc/thruk OMD[demo@a36aee5c525e]:~/etc/thruk$ cat thruk_local.conf allowed_frame_links = https://192.168.112.174:5688/ OMD[demo@a36aee5c525e]:~/etc/thruk$
Create menu_local.conf under /etc/thruk/
OMD[demo@a36aee5c525e]:~/etc/thruk$ pwd /omd/sites/demo/etc/thruk OMD[demo@a36aee5c525e]:~/etc/thruk$ cat menu_local.conf do '/usr/share/thruk/menu.conf'; remove_item('Reports'); remove_item('General', 'Panorama View'); remove_item('System', 'Configuration'); add_section('name' => 'General'); add_link('name' => 'Home', 'href' => '/thruk/main.html'); add_link('name' => 'Logout', 'href' => $c->config->{'logout_link'}, 'target' => "_parent") if($c->stash->{'cookie_auth'}); add_section('name' => 'Current Status'); add_link('name' => 'Hosts', 'href' => '/thruk/cgi-bin/status.cgi?hostgroup=all&style=hostdetail'); add_link('name' => 'Services', 'href' => '/thruk/cgi-bin/status.cgi?host=all'); add_search('name' => 'Quick Search:'); add_section('name' => 'Logs'); add_link('name' => 'Event Log', 'href' => '/thruk/cgi-bin/showlog.cgi'); add_link('name' => "Test submenu", 'href' => 'https://192.168.112.174:5688/demo/test3.html'); add_section('name' => 'System'); add_link('name' => 'Configuration', 'href' => '/thruk/cgi-bin/config.cgi') if has_role('authorized_for_system_information', 'authorized_for_configuration_information'); #insert_item('NewItem', { 'href' => '/thruk/frame.html/http://172.17.0.2', 'name' => 'Company' }, 'target' => '_parent'); OMD[demo@a36aee5c525e]:~/etc/thruk$
To allow only some contact group or user authorized_for_configuration_information to see some menu/submenu
[demo@669ee2143112 thruk]$ pwd /omd/sites/demo/etc/thruk [demo@669ee2143112 thruk]$ cat menu_local.conf remove_item('Reports'); remove_item('General', 'Panorama View'); remove_item('System', 'Configuration'); add_section('name' => 'General'); add_link('name' => 'Home', 'href' => '/thruk/main.html'); add_link('name' => 'Logout', 'href' => $c->config->{'logout_link'}, 'target' => "_parent") if($c->stash->{'cookie_auth'}); add_section('name' => 'Current Status'); add_link('name' => 'Hosts', 'href' => '/thruk/cgi-bin/status.cgi?hostgroup=all&style=hostdetail'); add_link('name' => 'Services', 'href' => '/thruk/cgi-bin/status.cgi?host=all'); add_search('name' => 'Quick Search:'); add_section('name' => 'Logs'); add_link('name' => 'Event Log', 'href' => '/thruk/cgi-bin/showlog.cgi'); add_link('name' => "Trac 10", 'href' => 'https://172.17.0.2/demo/test3.html'); add_section('name' => 'System'); add_link('name' => 'Configuration', 'href' => '/thruk/cgi-bin/config.cgi') if has_role('authorized_for_system_information', 'authorized_for_configuration_information'); insert_item('NewItem', { 'href' => 'https://172.17.0.2/demo/test2.html', 'name' => 'Company' }, 'target' => '_parent'); #if(has_group('demo')) { # insert_item('Demo Only', { 'href' => 'https://172.17.0.2/demo/test3.html', 'name' => 'Admin Link' }); #} if(has_role('authorized_for_configuration_information')) { insert_item('Auth configure', { 'href' => 'https://172.17.0.2/demo/test3.html', 'name' => 'Conf Link' }); } [demo@669ee2143112 thruk]$
Since the above test3.html and test2.html were refer from menu we can put those files in
[demo@669ee2143112 www]$ tree /omd/sites/demo/var/www/ /omd/sites/demo/var/www/ |-- test2.html `-- test3.html 0 directories, 3 files
Problem of PING
After clone the image, we might have problem of normal user cannot ping. We can solve in 2 ways.
- reinstall iputil-ping package
[root@BU debian]# dpkg -l | grep ping ii iputils-ping 3:20180629-2+deb10u2 armhf Tools to test the reachability of network hosts [root@BU debian]# apt install --reinstall iputils-ping
- chmod +s "$(which ping)" from this ref
before change
[root@BU debian]# ls -l /bin/ping -rwxr-xr-x 1 root root 47704 Mar 9 2021 /bin/ping
after change
[root@BU debian]# chmod +s "$(which ping)" [root@BU debian]# which ping /bin/ping [root@BU debian]# ls -l /bin/ping -rwsr-sr-x 1 root root 47704 Mar 9 2021 /bin/ping
Attachments (1)
- omd-labs-docker.tar.gz (17.0 MB) - added by 2 years ago.
Download all attachments as: .zip