diff --git a/docs/documentation/plugins.asciidoc b/docs/documentation/plugins.asciidoc index 44ea691909..f21bdfe561 100644 --- a/docs/documentation/plugins.asciidoc +++ b/docs/documentation/plugins.asciidoc @@ -57,7 +57,7 @@ Agents The agent plugin creates and manages the naemon configuration for link:https://github.com/ConSol-Monitoring/snclient[SNClient] agents. -A detailed documention is available on the link:plugins/agents/[Agents plugin] page. +A detailed documention is available on the link:plugins/agents/[agents plugin] page. ++++ agents plugin @@ -149,7 +149,7 @@ The editor plugin allows you to edit all types of text files. And provides a way to define further custom actions for each file type, like syntax check etc... -A detailed documention is available on the link:plugins/editor/[Editor plugin] page. +A detailed documention is available on the link:plugins/editor/[editor plugin] page. ++++ editor plugin @@ -199,6 +199,8 @@ The node control plugin allows you to control omd nodes and install/update new omd versions. The plugin also supports installing os updates and shows a brief summary of the main node ressouces. +A detailed documention is available on the link:plugins/node-control/[node-control plugin] page. + ++++ reporting reporting diff --git a/docs/documentation/plugins/node-control/index.asciidoc b/docs/documentation/plugins/node-control/index.asciidoc new file mode 100644 index 0000000000..18678cb2ae --- /dev/null +++ b/docs/documentation/plugins/node-control/index.asciidoc @@ -0,0 +1,118 @@ +--- +layout: docs +title: Node-Control Plugin +breadcrumb: [ "plugins.html", "Plugins" ] +lightbox: true +--- + +## Node Control Thruk Plugin + +This plugin allows you to control nodes (OMD / OS) from within Thruk. + +++++ +node-control plugin +
+++++ + +### Features + +- OMD installation +- OMD site updates +- OMD cleanup old unused versions +- OMD services start/stop +- OS Updates + +### Installation + +This plugin requires OMD (link:https://omd.consol.de[omd.consol.de]). + +This is a core plugin, so it is shipped with Thruk and can simply +be enabled by running: `thruk plugins enable node-control` or +from the plugins section in the config tool. + +It worked if you have a new menu item under `System` -> `Node Control`. + +### Setup + +The controlled sites need to have (optional) sudo permissions for omd and their package +manager. + +- Debian: `siteuser ALL=(ALL) NOPASSWD: /usr/bin/omd, NOPASSWD:SETENV: /usr/bin/apt-get` +- Centos: `siteuser ALL=(ALL) NOPASSWD: /usr/bin/omd, NOPASSWD: /usr/bin/dnf` + +(replace siteuser with the actual site user name) + +Optional ssh login helps starting services if http connection does not work, for +ex. because the site is stopped. + +Without sudo permissions you can only update to existing omd versions. + +### Configuration + +................................... + + # command will be run on the local node prior the update. Exit code != 0 will abort the update + #hook_update_pre_local = + + # command will be run on the remote node prior the update. Exit code != 0 will abort the update + #hook_update_pre = if [ $(git status --porcelain 2>&1 | wc -l) -gt 0 ]; then echo "omd home not clean"; git status --porcelain 2>&1; exit 1; fi + + # command will be run on the remote node after the update + #hook_update_post = git add . && git commit -a -m "update to omd $(omd version -b)" + + # command will be run on the local node after the update. + #hook_update_post_local = + + # set to 0 to disable ssh fallback in case http connection fails + #ssh_fallback = 1 + + # set to 0 to disable os updates + #os_updates = 1 + + # set to 0 to disable pkg installation + #pkg_install = 1 + + # set to 0 to disable pkg cleanup + #pkg_cleanup = 1 + + # set to 0 to hide 'all' buttons + #all_button = 1 + + cmd_omd_cleanup = sudo -n omd cleanup + + cmd_yum_pkg_install = sudo -n yum install -y %PKG + cmd_dnf_pkg_install = sudo -n dnf install -y %PKG + cmd_apt_pkg_install = DEBIAN_FRONTEND=noninteractive sudo -En apt-get install -y %PKG + + cmd_yum_os_update = sudo -n yum upgrade -y + cmd_dnf_os_update = sudo -n dnf upgrade -y + cmd_apt_os_update = DEBIAN_FRONTEND=noninteractive sudo -En apt-get upgrade -y + + cmd_yum_os_sec_update = sudo -n yum upgrade -y --security + cmd_dnf_os_sec_update = sudo -n dnf upgrade -y --security + cmd_apt_os_sec_update = DEBIAN_FRONTEND=noninteractive sudo -En apt-get upgrade -y + +................................... + +Configure hooks to automatically checkin the version update into git. Requires +git and the omd site in a git repository. + +### Hooks + +Hooks will be run in this order: + +- `hook_update_pre_local`: command will be run on the **local** node **prior** the update. +- `hook_update_pre`: command will be run on the **remote** node **prior** the update. +- `hook_update_post`: command will be run on the **remote** node **after** the update. +- `hook_update_post_local`: command will be run on the **local** node **after** the update. + +The pre hooks can abort the update process by exiting != 0. + +All hooks can make use of the following environment variables: + +- `PEER_NAME`: name of the backend as set in the thruk.conf. +- `PEER_KEY`: internal id of the backend. +- `HOST_NAME`: remote host name of this backend. +- `OMD_SITE`: site name which will be updated. +- `OMD_VERSION`: current omd version that site is running. +- `OMD_UPDATE`: omd version that'll be used for the update. diff --git a/docs/documentation/plugins/node-control/index.md b/docs/documentation/plugins/node-control/index.md deleted file mode 100644 index 476c5f7ed3..0000000000 --- a/docs/documentation/plugins/node-control/index.md +++ /dev/null @@ -1,105 +0,0 @@ -# Node Control Thruk Plugin - -This plugin allows you to control nodes (OMD / OS) from within Thruk. - -![Thruk Node Control Plugin](preview.png "Thruk Node Control Plugin") - -## Features - -- OMD installation -- OMD site updates -- OMD cleanup old unused versions -- OMD services start/stop -- OS Updates - -## Installation - -This plugin requires OMD ([omd.consol.de](https://omd.consol.de)). - -This is a core plugin, so it is shipped with Thruk and can simply -be enabled by running: `thruk plugins enable node-control` or -from the plugins section in the config tool. - -It worked if you have a new menu item under `System` -> `Node Control`. - -## Setup - -The controlled sites need to have (optional) sudo permissions for omd and their package -manager. - -- Debian: `siteuser ALL=(ALL) NOPASSWD: /usr/bin/omd, NOPASSWD:SETENV: /usr/bin/apt-get` -- Centos: `siteuser ALL=(ALL) NOPASSWD: /usr/bin/omd, NOPASSWD: /usr/bin/dnf` - -(replace siteuser with the actual site user name) - -Optional ssh login helps starting services if http connection does not work, for -ex. because the site is stopped. - -Without sudo permissions you can only update to existing omd versions. - -## Configuration - - - # command will be run on the local node prior the update. Exit code != 0 will abort the update - #hook_update_pre_local = - - # command will be run on the remote node prior the update. Exit code != 0 will abort the update - #hook_update_pre = if [ $(git status --porcelain 2>&1 | wc -l) -gt 0 ]; then echo "omd home not clean"; git status --porcelain 2>&1; exit 1; fi - # command will be run on the remote node after the update - #hook_update_post = git add . && git commit -a -m "update to omd $(omd version -b)" - - # command will be run on the local node after the update. - #hook_update_post_local = - - # set to 0 to disable ssh fallback in case http connection fails - #ssh_fallback = 1 - - # set to 0 to disable os updates - #os_updates = 1 - - # set to 0 to disable pkg installation - #pkg_install = 1 - - # set to 0 to disable pkg cleanup - #pkg_cleanup = 1 - - # set to 0 to hide 'all' buttons - #all_button = 1 - - cmd_omd_cleanup = sudo -n omd cleanup - - cmd_yum_pkg_install = sudo -n yum install -y %PKG - cmd_dnf_pkg_install = sudo -n dnf install -y %PKG - cmd_apt_pkg_install = DEBIAN_FRONTEND=noninteractive sudo -En apt-get install -y %PKG - - cmd_yum_os_update = sudo -n yum upgrade -y - cmd_dnf_os_update = sudo -n dnf upgrade -y - cmd_apt_os_update = DEBIAN_FRONTEND=noninteractive sudo -En apt-get upgrade -y - - cmd_yum_os_sec_update = sudo -n yum upgrade -y --security - cmd_dnf_os_sec_update = sudo -n dnf upgrade -y --security - cmd_apt_os_sec_update = DEBIAN_FRONTEND=noninteractive sudo -En apt-get upgrade -y - - -Configure hooks to automatically checkin the version update into git. Requires -git and the omd site in a git repository. - -## Hooks - -Hooks will be run in this order: - -- `hook_update_pre_local`: command will be run on the **local** node **prior** the update. -- `hook_update_pre`: command will be run on the **remote** node **prior** the update. -- `hook_update_post`: command will be run on the **remote** node **after** the update. -- `hook_update_post_local`: command will be run on the **local** node **after** the update. - -The pre hooks can abort the update process by exiting != 0. - -All hooks can make use of the following environment variables: - -- `PEER_NAME`: name of the backend as set in the thruk.conf. -- `PEER_KEY`: internal id of the backend. -- `HOST_NAME`: remote host name of this backend. -- `OMD_SITE`: site name which will be updated. -- `OMD_VERSION`: current omd version that site is running. -- `OMD_UPDATE`: omd version that'll be used for the update. diff --git a/docs/documentation/plugins/node-control/node-control.png b/docs/documentation/plugins/node-control/node-control.png new file mode 100644 index 0000000000..1958625f05 Binary files /dev/null and b/docs/documentation/plugins/node-control/node-control.png differ