add grafana module
All checks were successful
build container icingaweb2 / build (push) Successful in 4m2s
All checks were successful
build container icingaweb2 / build (push) Successful in 4m2s
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -35,6 +35,17 @@ RUN ["bash", "-exo", "pipefail", "-c", "\
|
|||||||
apt clean all ; \
|
apt clean all ; \
|
||||||
rm -vrf /var/lib/apt/lists/* "]
|
rm -vrf /var/lib/apt/lists/* "]
|
||||||
|
|
||||||
|
## install module grafana
|
||||||
|
ARG MODULE_VERSION="3.0.0"
|
||||||
|
ARG ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
|
||||||
|
ARG REPO_URL="https://github.com/NETWAYS/icingaweb2-module-grafana"
|
||||||
|
ARG TARGET_DIR="${ICINGAWEB_MODULEPATH}/grafana"
|
||||||
|
ARG URL="${REPO_URL}/archive/v${MODULE_VERSION}.tar.gz"
|
||||||
|
RUN ["bash", "-exo", "pipefail", "-c", "\
|
||||||
|
install -d -m 0755 ${TARGET_DIR} ; \
|
||||||
|
wget -q -O - $URL | tar xfz - -C ${TARGET_DIR} --strip-components 1 ; \
|
||||||
|
"]
|
||||||
|
|
||||||
## create persistend data store
|
## create persistend data store
|
||||||
RUN ["bash", "-exo", "pipefail", "-c", "\
|
RUN ["bash", "-exo", "pipefail", "-c", "\
|
||||||
mkdir -p /data ; \
|
mkdir -p /data ; \
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -15,6 +15,7 @@ docker compose up -d
|
|||||||
|
|
||||||
For a full deployment see: [comming soon ...]()
|
For a full deployment see: [comming soon ...]()
|
||||||
|
|
||||||
|
If you run the setup without any environment vars the setup token will be printet in docker log!
|
||||||
|
|
||||||
## understand environment
|
## understand environment
|
||||||
For the configuration (primarily the initial setup) I use a similar method as: https://hub.docker.com/r/icinga/icingaweb2
|
For the configuration (primarily the initial setup) I use a similar method as: https://hub.docker.com/r/icinga/icingaweb2
|
||||||
@@ -66,16 +67,16 @@ ICINGAWEB2_GRAFANA_GRAPH | grafana | /etc/icingaweb2/modules/grafana/graphs.ini
|
|||||||
### static vars
|
### static vars
|
||||||
var | description
|
var | description
|
||||||
--- | ---
|
--- | ---
|
||||||
ICINGAWEB2_CONF_ONCE | if true: all configuration setups (above) run only on fist setup.
|
ICINGAWEB2_CONF_ONCE | if var exists: all configuration setups (above) run only on fist setup.
|
||||||
ICINGAWEB2_DB_RESOURCE_NAME | needed for setup scrip to know witch database is used for users
|
ICINGAWEB2_DB_RESOURCE_NAME | needed for setup script to know witch database is used for users
|
||||||
ICINGAWEB2_DEFAULT_ADMIN_USER | default admin username
|
ICINGAWEB2_DEFAULT_ADMIN_USER | default admin username addidional this var is primary identifier to run auto config
|
||||||
ICINGAWEB2_DEFAULT_ADMIN_PASS | default admin password
|
ICINGAWEB2_DEFAULT_ADMIN_PASS | default admin password
|
||||||
|
|
||||||
### easy setup
|
### easy setup
|
||||||
If you use the example, than you kan setup the `env.sample`.
|
If you use the example, than you can setup the `env.sample`.
|
||||||
All required variables are included and insert the values in the correct places.
|
All required variables are included and insert the values in the correct places.
|
||||||
|
|
||||||
Hint: in this file all vars dont have the `2` behind icingaweb2 or icinga.
|
Hint: in this file all vars dont have the `2` behind icingaweb2 or icinga2.
|
||||||
Vars for the container have the `2`
|
Vars for the container have the `2`
|
||||||
|
|
||||||
## example
|
## example
|
||||||
|
|||||||
@@ -133,6 +133,15 @@ def main():
|
|||||||
### commandtransports.ini : https://icinga.com/docs/icinga-db-web/latest/doc/03-Configuration/#command-transport-configuration
|
### commandtransports.ini : https://icinga.com/docs/icinga-db-web/latest/doc/03-Configuration/#command-transport-configuration
|
||||||
IniFile(ICINGADB_WEB_CONFDIR + 'commandtransports.ini', 'ICINGAWEB2_ICINGADB_API__')
|
IniFile(ICINGADB_WEB_CONFDIR + 'commandtransports.ini', 'ICINGAWEB2_ICINGADB_API__')
|
||||||
|
|
||||||
|
## icingaweb2 modul: grafana
|
||||||
|
ICINGAWEB_GRAFANA_DIR = ICINGAWEB_CONFDIR + 'modules/grafana/'
|
||||||
|
### config.ini : https://github.com/NETWAYS/icingaweb2-module-grafana/blob/main/doc/03-module-configuration.md
|
||||||
|
IniFile(ICINGADB_WEB_CONFDIR + 'config.ini', 'ICINGAWEB2_GRAFANA_CONF__')
|
||||||
|
### grafana.ini : https://github.com/NETWAYS/icingaweb2-module-grafana/blob/main/doc/02-installation.md
|
||||||
|
IniFile(ICINGADB_WEB_CONFDIR + 'grafana.ini', 'ICINGAWEB2_GRAFANA_AUTH__')
|
||||||
|
### graphs.ini : https://github.com/NETWAYS/icingaweb2-module-grafana/blob/main/doc/04-graph-configuration.md
|
||||||
|
IniFile(ICINGADB_WEB_CONFDIR + 'graph.ini', 'ICINGAWEB2_GRAFANA_GRAPH__')
|
||||||
|
|
||||||
## run db init
|
## run db init
|
||||||
InitDB()
|
InitDB()
|
||||||
|
|
||||||
|
|||||||
4
init.sh
4
init.sh
@@ -21,7 +21,9 @@ if [ -z "$(ls -A /data)" ]; then
|
|||||||
## enable modules
|
## enable modules
|
||||||
icingacli module enable icingadb
|
icingacli module enable icingadb
|
||||||
mkdir -p /etc/icingaweb2/modules/icingadb/
|
mkdir -p /etc/icingaweb2/modules/icingadb/
|
||||||
|
|
||||||
|
icingacli module enable grafana
|
||||||
|
mkdir -p /etc/icingaweb2/modules/grafana/
|
||||||
else
|
else
|
||||||
## print setup token because no auto deployment will run
|
## print setup token because no auto deployment will run
|
||||||
icingacli setup token create;
|
icingacli setup token create;
|
||||||
|
|||||||
Reference in New Issue
Block a user