Skip to content

Commit

Permalink
Merge in changes for PR JasonRivers#115
Browse files Browse the repository at this point in the history
  • Loading branch information
tronyx committed Dec 22, 2020
1 parent a4cc64c commit b481b73
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
25 changes: 21 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ ENV NAGIOS_HOME=/opt/nagios \
NAGIOS_BRANCH=nagios-4.4.6 \
NAGIOS_PLUGINS_BRANCH=release-2.3.3 \
NRPE_BRANCH=nrpe-4.0.2 \
NSCA_TAG=nsca-2.10.0
NSCA_TAG=nsca-2.10.0 \
MK_LIVESTATUS_VERSION=1.6.0p19

RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set-selections && \
echo postfix postfix/mynetworks string "127.0.0.0/8" | debconf-set-selections && \
Expand Down Expand Up @@ -86,7 +87,6 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
snmpd \
snmp-mibs-downloader \
unzip \
python2 \
xinetd && \
apt-get -qq clean && \
rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -178,6 +178,7 @@ RUN cd /tmp && \
cp sample-config/nsca.cfg ${NAGIOS_HOME}/etc/ && \
cp sample-config/send_nsca.cfg ${NAGIOS_HOME}/etc/

# Install additional plugins
RUN cd /opt && \
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python2 get-pip.py && \
Expand All @@ -193,6 +194,18 @@ RUN cd /opt && \
cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/

# Install mk-livestatus
RUN cd /tmp && \
wget https://mathias-kettner.de/download/mk-livestatus-${MK_LIVESTATUS_VERSION}.tar.gz && \
tar zxf mk-livestatus-${MK_LIVESTATUS_VERSION}.tar.gz && \
cd mk-livestatus-${MK_LIVESTATUS_VERSION} && \
./configure --with-nagios4 && \
make && \
make install

RUN mkdir -p /usr/local/nagios/var/rw && \
chown ${NAGIOS_USER}:${NAGIOS_GROUP} /usr/local/nagios/var/rw

RUN sed -i.bak 's/.*\=www\-data//g' /etc/apache2/envvars

#RUN export DOC_ROOT="DocumentRoot $(echo ${NAGIOS_HOME}/share)" && \
Expand Down Expand Up @@ -270,13 +283,17 @@ RUN apt-get -qq -y autoremove && \
nagios-plugins \
nrpe \
nagiosgraph \
nsca && \
nsca \
mk-livestatus-${MK_LIVESTATUS_VERSION}* && \
# Remove some other files and dirs
rm -rf /opt/nagiosgraph/etc/fix-nagiosgraph-multiple-selection.sh \
/opt/get-pip.py

# Expose port 80 for the web UI
# Expose ports
# 80 for the web UI
EXPOSE 80
# 6557 for mk-livestatus
EXPOSE 6557

# Specify volumes
VOLUME "${NAGIOS_HOME}/var" "${NAGIOS_HOME}/etc" "/var/log/apache2" "/opt/Custom-Nagios-Plugins" "/opt/nagiosgraph/var" "/opt/nagiosgraph/etc"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Fork of [JasonRivers Docker Nagios image](https://github.com/JasonRivers/Docker-
* [#101](https://github.com/JasonRivers/Docker-Nagios/pull/101) - Fixes to allow building on ARM aarch64 architecture (@garethrandall)
* [#110](https://github.com/JasonRivers/Docker-Nagios/pull/110) - Update to Ubuntu 18.04 LTS (@asimzeeshan)
* [#112](https://github.com/JasonRivers/Docker-Nagios/pull/112) - Add python3-nagiosplugin for plugins that need it (@davralin)
* [#115](https://github.com/JasonRivers/Docker-Nagios/pull/115) - Add mk_livestatus allowing it to work w/ Thruk (@mmerian)
* [#116](https://github.com/JasonRivers/Docker-Nagios/pull/116) - Update Nagios to 4.4.6 (@mmerian)
* [#120](https://github.com/JasonRivers/Docker-Nagios/pull/120) - Add NSCA (@mmerian)

Expand All @@ -25,7 +26,7 @@ Things that I have changed/updated so far:

## Information

Nagios Core 4.4.6 running on Ubuntu 18.04 LTS with NagiosGraph, NRPE, & NSCA.
Nagios Core 4.4.6 running on Ubuntu 20.04 LTS with NagiosGraph, NRPE, & NSCA.

### Configurations

Expand Down
14 changes: 14 additions & 0 deletions overlay/etc/xinetd.d/livestatus
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
service livestatus
{
type = UNLISTED
port = 6557
socket_type = stream
protocol = tcp
wait = no
cps = 100 3
flags = NODELAY
user = nagios
server = /usr/local/bin/unixcat
server_args = /usr/local/nagios/var/rw/live
disable = no
}
1 change: 1 addition & 0 deletions overlay/opt/nagios/etc/nagios.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ event_broker_options=-1
#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0

broker_module=/usr/local/lib/mk-livestatus/livestatus.o /usr/local/nagios/var/rw/live event_broker_options=-1


# LOG ROTATION METHOD
Expand Down

0 comments on commit b481b73

Please sign in to comment.