Skip to content

Commit 5e3bfe5

Browse files
committed
- Enable cron to support bulk mails
- Redirect browser from blank root page to check_mk login
1 parent 593034c commit 5e3bfe5

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ RUN \
5454
samba-client
5555

5656
ADD bootstrap.sh /opt/
57+
ADD redirector.sh /opt/
5758
EXPOSE 5000/tcp
5859

5960
#VOLUME /opt/omd
@@ -66,10 +67,11 @@ RUN rpm -ivh https://mathias-kettner.de/support/${CMK_VERSION}/check-mk-raw-${CM
6667
RUN omd create ${CMK_SITE} || \
6768
omd config ${CMK_SITE} set DEFAULT_GUI check_mk && \
6869
omd config ${CMK_SITE} set TMPFS off && \
69-
omd config ${CMK_SITE} set CRONTAB off && \
70+
omd config ${CMK_SITE} set CRONTAB on && \
7071
omd config ${CMK_SITE} set APACHE_TCP_ADDR 0.0.0.0 && \
7172
omd config ${CMK_SITE} set APACHE_TCP_PORT 5000 && \
72-
ln -s "/omd/sites/${CMK_SITE}/var/log/nagios.log" /var/log/nagios.log
73+
ln -s "/omd/sites/${CMK_SITE}/var/log/nagios.log" /var/log/nagios.log && \
74+
/opt/redirector.sh ${CMK_SITE} > /omd/sites/${CMK_SITE}/var/www/index.html
7375

7476

7577
WORKDIR /omd

bootstrap.sh

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ chmod 640 $CFGFILE
1313
chown root:mail $CFGFILE
1414

1515

16+
# Start cron daemon
17+
/usr/sbin/crond
18+
1619
# Start check_mk
1720
omd start && tail -f /var/log/nagios.log
1821

redirector.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
sed "s/__DIR__/$1/g" << !!!
4+
<html>
5+
<head>
6+
<title>Redirect</title>
7+
<meta http-equiv="Refresh" content="0; url=/__DIR__/check_mk/" />
8+
</head>
9+
<body>
10+
<p>Please start here: <a href="/__DIR__/check_mk/">/__DIR__/check_mk/</a></p>
11+
</body>
12+
</html>
13+
!!!
14+

0 commit comments

Comments
 (0)