Compare commits
6 Commits
0.1.1-alpi
...
0.5
Author | SHA1 | Date | |
---|---|---|---|
a4e073b3ae | |||
1f7c040e57 | |||
9d8443680f | |||
6a64f09ea5 | |||
6a4fc4dea7 | |||
ed61e2563c |
18
Dockerfile
18
Dockerfile
@@ -1,13 +1,17 @@
|
||||
FROM alpine:latest
|
||||
RUN apk update && \
|
||||
apk add bash && \
|
||||
apk add icinga2 && \
|
||||
mkdir /run/icinga2 && chown icinga:icinga /run/icinga2 && \
|
||||
FROM debian:10-slim
|
||||
RUN apt-get update && apt-get install wget gnupg -y && \
|
||||
printf "deb http://packages.icinga.com/debian icinga-buster main\ndeb-src http://packages.icinga.com/debian icinga-buster main" > /etc/apt/sources.list.d/icinga2.list && \
|
||||
wget -O - https://packages.icinga.com/icinga.key | apt-key add - && \
|
||||
apt-get update && apt-get --no-install-recommends install icinga2 monitoring-plugins tzdata -y && \
|
||||
mkdir /run/icinga2 && chown nagios:nagios /run/icinga2 && \
|
||||
mkdir -p /var/lib/icinga2/certs && \
|
||||
chown -R icinga:icinga /var/lib/icinga2/certs
|
||||
chown -R nagios:nagios /var/lib/icinga2/certs && \
|
||||
apt-get remove -y wget gnupg && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean
|
||||
|
||||
COPY create-satellite.sh /create-satellite.sh
|
||||
COPY run-icinga.sh /run-icinga.sh
|
||||
RUN chmod +x /create-satellite.sh ; chmod +x /run-icinga.sh
|
||||
|
||||
EXPOSE 5665
|
||||
ENTRYPOINT ["/run-icinga.sh"]
|
||||
|
52
README.md
52
README.md
@@ -1,10 +1,40 @@
|
||||
# icinga-satellite
|
||||
An easy-to-use Dockerized Icinga2 satellite setup. It could be used as an
|
||||
Icinga2 agent aswell, but I don't think that would make much sense. The goal
|
||||
is instead to create an easy-to-deploy satellite Docker.
|
||||
is instead to create an easy-to-deploy satellite image.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Tags and their respective Dockerfile
|
||||
|
||||
### Main tags
|
||||
* [0.5, latest](https://github.com/jackbenny/icinga-satellite/blob/master/Dockerfile)
|
||||
* [0.4](https://github.com/jackbenny/icinga-satellite/blob/0.4/Dockerfile)
|
||||
* [0.3](https://github.com/jackbenny/icinga-satellite/blob/0.3/Dockerfile)
|
||||
* [0.2](https://github.com/jackbenny/icinga-satellite/blob/0.2/Dockerfile)
|
||||
* [0.1](https://github.com/jackbenny/icinga-satellite/blob/0.1/Dockerfile)
|
||||
|
||||
### Alpine tags (currently has some problems)
|
||||
* [0.1.1-alpine](https://github.com/jackbenny/icinga-satellite/blob/0.1.1-alpine/Dockerfile)
|
||||
* [0.1-alpine](https://github.com/jackbenny/icinga-satellite/blob/0.1-alpine/Dockerfile)
|
||||
|
||||
> **NOTE:** Currently there are some problems with the Alpine image.
|
||||
> Use the *main images* instead, tagged *0.n*.
|
||||
|
||||
There are two available images for you to choose from. The main images (0.*n*) are based on
|
||||
Debian 10-slim from tag 0.5 and up. Previous to 0.5 they were based on Ubuntu 18.04.
|
||||
The main images uses Icinga2 from Icingas official repository.
|
||||
|
||||
The other images (0.*n*-alpine) are based on Alpine with Icinga2 from Alpines repository.
|
||||
From 0.1.1-alpine and up, the Alpine images are built on the latest Alpine image. Previous to
|
||||
0.1.1 they were based on Alpine 3.11.
|
||||
|
||||
## Environment variables
|
||||
Everything is controlled using the follwing environment variables.
|
||||
Everything is controlled using the following environment variables.
|
||||
|
||||
* **CN** is the Common Name of the satellite
|
||||
* **ZONE** is the zone in which this satellite should be in. If no zone is specified
|
||||
@@ -17,15 +47,18 @@ Everything is controlled using the follwing environment variables.
|
||||
* **TICKET** is the ticket you get from the master (if you are using Director
|
||||
you find it under the Agent tab of the host).
|
||||
* **ACCEPT_CONFIG** takes a ***y*** or ***n*** value for yes or no. The default is
|
||||
***n***.
|
||||
***n***
|
||||
* **ACCEPT_COMMANDS** takes a ***y*** or ***n*** value for yes or no. The default is
|
||||
***n***.
|
||||
***n***
|
||||
* **DISABLE_CONFD** takes a ***y*** or ***n*** value for yes or no. The default is
|
||||
***y***. This should be a sane default for most people.
|
||||
* **LOCAL_TIMEZONE** sets the local timezone of the satellite. For example
|
||||
*Europe/Stockholm* or *America/New_York*
|
||||
|
||||
## Example usage
|
||||
```
|
||||
#> docker run -d --name my-icinga-sat \
|
||||
-p 5665:5665 \
|
||||
-e CN=icinga-sat02.local \
|
||||
-e PARENTHOST=icinga-master.local \
|
||||
-e PARENTCN=icinga-master.local \
|
||||
@@ -41,6 +74,9 @@ version: "3.8"
|
||||
services:
|
||||
my-icinga-sat:
|
||||
image: jackbenny/icinga-satellite
|
||||
ports:
|
||||
- 5665:5665
|
||||
restart:always
|
||||
environment:
|
||||
- CN=icinga-sat02.local
|
||||
- ZONE=icinga-sat02.local
|
||||
@@ -51,13 +87,7 @@ services:
|
||||
- ACCEPT_CONFIG=y
|
||||
- ACCEPT_COMMANDS=y
|
||||
- DISABLE_CONFD=y
|
||||
- LOCAL_TIMEZONE=Europe/Stockholm
|
||||
```
|
||||
|
||||
## Images
|
||||
There are two available images for you to choose from. The default one (0.*n*) is based on
|
||||
Debian 10, with Icinga2 from Icingas official repository. The other image (0.*n*-alpine) is
|
||||
based on Alpine latest, with Icinga2 from Alpines repository. The Alpine image is much
|
||||
smaller in size.
|
||||
|
||||
> **Note:** Version 0.1-alpine uses Alpine 3.11. Version 0.1.1-alpine and up uses Alpine
|
||||
> latest.
|
||||
|
@@ -37,6 +37,11 @@ else
|
||||
DISABLE_CONF=" "
|
||||
fi
|
||||
|
||||
# Set the local timezone
|
||||
if [ ! -z "$LOCAL_TIMEZONE" ]; then
|
||||
ln -sf /usr/share/zoneinfo/"$LOCAL_TIMEZONE" /etc/localtime
|
||||
fi
|
||||
|
||||
icinga2 pki new-cert --cn "$CN" \
|
||||
--key /var/lib/icinga2/certs/"${CN}".key \
|
||||
--cert /var/lib/icinga2/certs/"${CN}".crt
|
||||
|
Reference in New Issue
Block a user