Commit 1be7ac5a authored by Pascal Wiedenbeck's avatar Pascal Wiedenbeck
Browse files

Initial code commit

parent 91679e05
/docker-compose.override.yml
/data
/*.env
## Contributing A Patch
1. Submit an issue describing your proposed change to the repo in question.
1. I will respond to your issue promptly.
1. Fork the desired repo, develop and test your code changes.
1. Submit a pull request.
# Dockerfile for icinga2 with icingaweb2
# https://github.com/jjethwa/icinga2
# Extended with influxdb feature
FROM debian:stretch
MAINTAINER Jordan Jethwa
ENV APACHE2_HTTP=REDIRECT \
ICINGA2_FEATURE_GRAPHITE=false \
ICINGA2_FEATURE_GRAPHITE_HOST=graphite \
ICINGA2_FEATURE_GRAPHITE_PORT=2003 \
ICINGA2_FEATURE_GRAPHITE_URL=http://graphite \
ICINGA2_FEATURE_INFLUXDB=false \
ICINGA2_FEATURE_INFLUXDB_HOST=127.0.0.1 \
ICINGA2_FEATURE_INFLUXDB_PORT=8086 \
ICINGA2_FEATURE_INFLUXDB_DB=icinga2 \
ICINGA2_FEATURE_INFLUXDB_USER=icinga \
ICINGA2_USER_FULLNAME="Icinga2" \
ICINGA2_FEATURE_DIRECTOR="true" \
ICINGA2_FEATURE_DIRECTOR_KICKSTART="true" \
ICINGA2_FEATURE_DIRECTOR_USER="icinga2-director"
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
apache2 \
ca-certificates \
curl \
dnsutils \
gnupg \
influxdb-client \
locales \
lsb-release \
mailutils \
mariadb-client \
mariadb-server \
php-curl \
php-ldap \
php-mysql \
procps \
pwgen \
snmp \
ssmtp \
sudo \
supervisor \
unzip \
wget \
libdbd-mysql-perl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN export DEBIAN_FRONTEND=noninteractive \
&& curl -s https://packages.icinga.com/icinga.key \
| apt-key add - \
&& echo "deb http://packages.icinga.org/debian icinga-$(lsb_release -cs) main" > /etc/apt/sources.list.d/icinga2.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
icinga2 \
icinga2-ido-mysql \
icingacli \
icingaweb2 \
icingaweb2-module-doc \
icingaweb2-module-monitoring \
monitoring-plugins \
nagios-nrpe-plugin \
nagios-plugins-contrib \
nagios-snmp-plugins \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG GITREF_DIRECTOR=master
ARG GITREF_MODGRAPHITE=master
ARG GITREF_MODAWS=master
RUN mkdir -p /usr/local/share/icingaweb2/modules/ \
# Icinga Director
&& mkdir -p /usr/local/share/icingaweb2/modules/director/ \
&& wget -q --no-cookies -O - "https://github.com/Icinga/icingaweb2-module-director/archive/${GITREF_DIRECTOR}.tar.gz" \
| tar xz --strip-components=1 --directory=/usr/local/share/icingaweb2/modules/director --exclude=.gitignore -f - \
# Icingaweb2 Graphite
&& mkdir -p /usr/local/share/icingaweb2/modules/graphite \
&& wget -q --no-cookies -O - "https://github.com/Icinga/icingaweb2-module-graphite/archive/${GITREF_MODGRAPHITE}.tar.gz" \
| tar xz --strip-components=1 --directory=/usr/local/share/icingaweb2/modules/graphite -f - icingaweb2-module-graphite-${GITREF_MODGRAPHITE}/ \
# Icingaweb2 AWS
&& mkdir -p /usr/local/share/icingaweb2/modules/aws \
&& wget -q --no-cookies -O - "https://github.com/Icinga/icingaweb2-module-aws/archive/${GITREF_MODAWS}.tar.gz" \
| tar xz --strip-components=1 --directory=/usr/local/share/icingaweb2/modules/aws -f - icingaweb2-module-aws-${GITREF_MODAWS}/ \
&& wget -q --no-cookies "https://github.com/aws/aws-sdk-php/releases/download/2.8.30/aws.zip" \
&& unzip -d /usr/local/share/icingaweb2/modules/aws/library/vendor/aws aws.zip \
&& rm aws.zip \
&& true
ADD content/ /
# Final fixes
RUN true \
&& sed -i 's/vars\.os.*/vars.os = "Docker"/' /etc/icinga2/conf.d/hosts.conf \
&& mv /etc/icingaweb2/ /etc/icingaweb2.dist \
&& mkdir /etc/icingaweb2 \
&& mv /etc/icinga2/ /etc/icinga2.dist \
&& mkdir /etc/icinga2 \
&& usermod -aG icingaweb2 www-data \
&& usermod -aG nagios www-data \
&& rm -rf \
/var/lib/mysql/* \
&& chmod u+s,g+s \
/bin/ping \
/bin/ping6 \
/usr/lib/nagios/plugins/check_icmp
EXPOSE 80 443 5665
# Initialize and run Supervisor
ENTRYPOINT ["/opt/run"]
This diff is collapsed.
NameVirtualHost *:80
<VirtualHost *:80>
RewriteEngine On
RewriteRule "^/?(.*)" https://%{HTTP_HOST}/$1 [L]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/icinga2.crt
SSLCertificateKeyFile /etc/apache2/ssl/icinga2.key
SSLCertificateChainFile /etc/apache2/ssl/icinga2.chain
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
[icingaweb2]
backend = "db"
resource = "icingaweb_db"
[global]
show_stacktraces = "1"
config_backend = "db"
config_resource = "icingaweb_db"
module_path = "/etc/icingaweb2/userModules:/usr/share/icingaweb2/modules:/usr/local/share/icingaweb2/modules"
[logging]
log = "file"
level = "ERROR"
file = "/var/log/icingaweb2/icingaweb2.log"
[icingaweb2]
backend = "db"
resource = "icingaweb_db"
object ApiUser "director" {
password = "directorapi"
permissions = [ "*" ]
}
[config]
endpoint = changeme
host = 127.0.0.1
port = 5665
username = director
password = directorapi
[graphite]
web_url = http://my.graphite.web
[icinga]
type = "ido"
resource = "icinga_ido"
[icinga]
transport = "local"
path = "/var/run/icinga2/cmd/icinga2.cmd"
[security]
protected_customvars = "*pw*,*pass*,community"
[icingaweb_db]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icingaweb2"
username = "icingaweb2"
password = "icingaweb2_changeme"
prefix = "icingaweb_"
charset = "utf8"
persistent = "0"
[icinga_ido]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icinga2idomysql"
username = "icinga2-ido-mysq"
password = "icinga2-ido-mysq_changeme"
charset = "utf8"
persistent = "0"
[director]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "director"
username = "director"
password = "director_changeme"
charset = "utf8"
persistent = "0"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment