-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
67 lines (54 loc) · 2.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
## Configuration Editor Thruk Plugin for Icinga2
This plugin allows you to configure Icinga2 via the in built HTTP API.
This plugin is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.
Dependencies for ubuntu 16.04 is:
libcgi-pm-perl liblwp-protocol-https-perl
Install instructions:
cd plugins-available
git clone https://github.com/stockholmuniversity/thruk-plugin-configeditor.git configuration_editor
In order for the plugin to work it needs a config file in /etc/thruk/thruk_local.d/, e.g. /etc/thruk/thruk_local.d/icinga2_api.conf with the following example content:
icinga2_api_user = myuser
icinga2_api_password = secret
icinga2_api_realm = Icinga 2
icinga2_api_host = icinga.example.com
icinga2_api_port = 5665
icinga2_api_path = v1
If you want to get access to plugin actions from the action menu you can add this to thruk_local.conf:
<action_menu_apply>
hostmenu = .*;$ # matches all hosts only
servicemenu = .*;.+$ # matches all services on all hosts
</action_menu_apply>
You also need two files in /etc/thruk/action_menus: servicemenu.json and hostmenu.json.
This is /etc/thruk/action_menus/servicemenu.json:
{
"icon": "/thruk/themes/{{theme}}/images/dropdown.png",
"title": "Service Menu",
"menu": [{
"icon": "/thruk/themes/{{theme}}/images/delete.png",
"label": "Delete Service",
"action": "/thruk/cgi-bin/api_conf.cgi?page_type=services&mode=delete&host=$HOSTNAME$&service=$SERVICEDESC$"
}, {
"icon": "/thruk/themes/{{theme}}/images/edit.png",
"label": "Modify Service",
"action": "/thruk/cgi-bin/api_conf.cgi?page_type=services&mode=modify&host=$HOSTNAME$&service=$SERVICEDESC$"
}]
}
This is /etc/thruk/action_menus/hostmenu.json:
{
"icon": "/thruk/themes/{{theme}}/images/dropdown.png",
"title": "Host Menu",
"menu": [{
"icon": "/thruk/themes/{{theme}}/images/delete.png",
"label": "Delete Host",
"action": "/thruk/cgi-bin/api_conf.cgi?page_type=hosts&mode=delete&host=$HOSTNAME$"
}, {
"icon": "/thruk/themes/{{theme}}/images/add.png",
"label": "Add Service to Host",
"action": "/thruk/cgi-bin/api_conf.cgi?page_type=services&mode=create&host=$HOSTNAME$"
}, {
"icon": "/thruk/themes/{{theme}}/images/edit.png",
"label": "Modify Host",
"action": "/thruk/cgi-bin/api_conf.cgi?page_type=hosts&mode=modify&host=$HOSTNAME$"
}]
}