Skip to content

Commit

Permalink
Merge pull request #36 from tronyx/ubuntu-24.04
Browse files Browse the repository at this point in the history
Ubuntu 24.04
  • Loading branch information
tronyx authored May 31, 2024
2 parents af7956d + bc1f699 commit fb69c00
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 69 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
branches:
- master
- develop
- ubuntu-24.04
pull_request:
branches:
- master
- develop
- ubuntu-24.04

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
architecture: [linux-amd64, linux-arm64, linux-arm-v7]
Expand Down Expand Up @@ -154,7 +156,7 @@ jobs:
${{ steps.prep.outputs.build-args }}
publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
registry: [docker.io, ghcr.io]
Expand Down
37 changes: 21 additions & 16 deletions Dockerfile.linux-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
ARG BUILDKIT_SBOM_SCAN_STAGE=true

FROM ubuntu:22.04
FROM ubuntu:24.04

LABEL name="Nagios"
LABEL nagiosVersion="4.5.2"
Expand Down Expand Up @@ -88,7 +88,7 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libnet-tftp-perl \
libnet-xmpp-perl \
libpq-dev \
libpython2-dev \
#libpython2-dev \
libpython3-dev \
libredis-perl \
librrds-perl \
Expand All @@ -97,13 +97,14 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libtext-glob-perl \
libwww-perl \
m4 \
netcat \
netcat-traditional \
openssh-client \
parallel \
php-cli \
php-gd \
postfix \
python2 \
#python2 \
python3-full \
python3-pip \
python3-nagiosplugin \
rsync \
Expand Down Expand Up @@ -220,30 +221,34 @@ RUN cd /tmp && \

# Install additional plugins
RUN cd /opt && \
wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python2 get-pip.py && \
pip install --no-cache-dir "pymssql<2.2.0" && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
#wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
#wget -q https://bootstrap.pypa.io/get-pip.py && \
#python2 get-pip.py && \
#python3 get-pip.py && \
#pip install --no-cache-dir "pymssql<2.2.0" && \
#pip3 install --no-cache-dir pymssql && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
git clone https://github.com/willixix/naglio-plugins.git WL-Nagios-Plugins && \
git clone https://github.com/JasonRivers/nagios-plugins.git JR-Nagios-Plugins && \
git clone https://github.com/justintime/nagios-plugins.git JE-Nagios-Plugins && \
git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
#git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
git clone https://github.com/danfruehauf/nagios-plugins.git DF-Nagios-Plugins && \
git clone https://github.com/jpmens/check-mqtt.git jpmens-mqtt && \
#git clone https://github.com/jpmens/check-mqtt.git jpmens-mqtt && \
chmod +x /opt/WL-Nagios-Plugins/check* && \
chmod +x /opt/JE-Nagios-Plugins/check_mem/check_mem.pl && \
chmod +x /opt/DF-Nagios-Plugins/check_sql/check_sql && \
chmod +x /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins && \
chmod +x /opt/DF-Nagios-Plugins/check_vpn/check_vpn && \
chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
#chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
cp /opt/JE-Nagios-Plugins/check_mem/check_mem.pl ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_sql/check_sql ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/
######cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/
#cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/

# Add check_apc.pl check
COPY plugins/check_apc.pl ${NAGIOS_HOME}/libexec/
Expand Down
58 changes: 31 additions & 27 deletions Dockerfile.linux-arm-v7
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
ARG BUILDKIT_SBOM_SCAN_STAGE=true

FROM ubuntu:22.04
FROM ubuntu:24.04

LABEL name="Nagios"
LABEL nagiosVersion="4.5.2"
Expand Down Expand Up @@ -55,7 +55,6 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
bsd-mailx \
build-essential \
ca-certificates \
curl \
dnsutils \
fping \
freetds-dev \
Expand All @@ -75,7 +74,6 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libdbi-dev \
libdbi-perl \
libdigest-hmac-perl \
libffi-dev \
libfreeradius-dev \
libgdchart-gd2-xpm-dev \
libradsec-dev \
Expand All @@ -90,7 +88,7 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libnet-tftp-perl \
libnet-xmpp-perl \
libpq-dev \
libpython2-dev \
#libpython2-dev \
libpython3-dev \
libredis-perl \
librrds-perl \
Expand All @@ -99,13 +97,14 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libtext-glob-perl \
libwww-perl \
m4 \
netcat \
netcat-traditional \
openssh-client \
parallel \
php-cli \
php-gd \
postfix \
python2 \
#python2 \
python3-full \
python3-pip \
python3-nagiosplugin \
rsync \
Expand Down Expand Up @@ -226,38 +225,42 @@ RUN cd /tmp && \

# Install additional plugins
RUN cd /opt && \
export RUSTUP_HOME=/root/.rustup && \
export CARGO_HOME=/root/.cargo && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sed 's#/proc/self/exe#\/bin\/sh#g' | sh -s -- --profile minimal -y && \
. "/root/.cargo/env" && \
export PATH="/root/.cargo/bin:$PATH" && \
wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python2 get-pip.py && \
echo "Cython==0.29.35" >> constraints.txt && \
export PIP_CONSTRAINT="$(pwd)/constraints.txt" && \
pip install --no-cache-dir "pymssql<2.2.0" && \
python3 -m pip install --upgrade pip && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt bcrypt && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
#export RUSTUP_HOME=/root/.rustup && \
#export CARGO_HOME=/root/.cargo && \
#curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sed 's#/proc/self/exe#\/bin\/sh#g' | sh -s -- --profile minimal -y && \
#. "/root/.cargo/env" && \
#export PATH="/root/.cargo/bin:$PATH" && \
#wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
#wget -q https://bootstrap.pypa.io/get-pip.py && \
#python2 get-pip.py && \
#python3 get-pip.py && \
#echo "Cython==0.29.35" >> constraints.txt && \
#export PIP_CONSTRAINT="$(pwd)/constraints.txt" && \
#pip install --no-cache-dir "pymssql<2.2.0" && \
#pip3 install --no-cache-dir pymssql && \
#python3 -m pip install --upgrade pip && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt bcrypt && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
git clone https://github.com/willixix/naglio-plugins.git WL-Nagios-Plugins && \
git clone https://github.com/JasonRivers/nagios-plugins.git JR-Nagios-Plugins && \
git clone https://github.com/justintime/nagios-plugins.git JE-Nagios-Plugins && \
git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
#git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
git clone https://github.com/danfruehauf/nagios-plugins.git DF-Nagios-Plugins && \
git clone https://github.com/jpmens/check-mqtt.git jpmens-mqtt && \
chmod +x /opt/WL-Nagios-Plugins/check* && \
chmod +x /opt/JE-Nagios-Plugins/check_mem/check_mem.pl && \
chmod +x /opt/DF-Nagios-Plugins/check_sql/check_sql && \
chmod +x /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins && \
chmod +x /opt/DF-Nagios-Plugins/check_vpn/check_vpn && \
chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
#chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
cp /opt/JE-Nagios-Plugins/check_mem/check_mem.pl ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_sql/check_sql ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/
#######cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/
#cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/

# Add check_apc.pl check
COPY plugins/check_apc.pl ${NAGIOS_HOME}/libexec/
Expand Down Expand Up @@ -350,9 +353,10 @@ RUN apt-get -qq -y remove software-properties-common && \
/var/lib/dpkg/status-old && \
true > /var/log/dpkg.log && \
true > /var/log/lastlog && \
true > /var/log/apt/term.log && \
####true > /var/log/apt/term.log && \
true > /var/log/apt/term.log
# Remove rust and all dependencies
echo y | /root/.cargo/bin/rustup self uninstall
#echo y | /root/.cargo/bin/rustup self uninstall

# Expose port 80 for the web UI
EXPOSE 80 5667
Expand Down
41 changes: 23 additions & 18 deletions Dockerfile.linux-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
ARG BUILDKIT_SBOM_SCAN_STAGE=true

FROM ubuntu:22.04
FROM ubuntu:24.04

LABEL name="Nagios"
LABEL nagiosVersion="4.5.2"
Expand Down Expand Up @@ -88,7 +88,7 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libnet-tftp-perl \
libnet-xmpp-perl \
libpq-dev \
libpython2-dev \
#libpython2-dev \
libpython3-dev \
libredis-perl \
librrds-perl \
Expand All @@ -97,13 +97,14 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libtext-glob-perl \
libwww-perl \
m4 \
netcat \
netcat-traditional \
openssh-client \
parallel \
php-cli \
php-gd \
postfix \
python2 \
#python2 \
python3-full \
python3-pip \
python3-nagiosplugin \
rsync \
Expand Down Expand Up @@ -224,32 +225,36 @@ RUN cd /tmp && \

# Install additional plugins
RUN cd /opt && \
wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python2 get-pip.py && \
echo "Cython==0.29.35" >> constraints.txt && \
export PIP_CONSTRAINT="$(pwd)/constraints.txt" && \
pip install --no-cache-dir "pymssql<2.2.0" && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
#wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
#wget -q https://bootstrap.pypa.io/get-pip.py && \
#python2 get-pip.py && \
#python3 get-pip.py && \
#echo "Cython==0.29.35" >> constraints.txt && \
#export PIP_CONSTRAINT="$(pwd)/constraints.txt" && \
#pip install --no-cache-dir "pymssql<2.2.0" && \
#pip3 install --no-cache-dir pymssql && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
#pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
git clone https://github.com/willixix/naglio-plugins.git WL-Nagios-Plugins && \
git clone https://github.com/JasonRivers/nagios-plugins.git JR-Nagios-Plugins && \
git clone https://github.com/justintime/nagios-plugins.git JE-Nagios-Plugins && \
git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
#git clone https://github.com/nagiosenterprises/check_mssql_collection.git nagios-mssql && \
git clone https://github.com/danfruehauf/nagios-plugins.git DF-Nagios-Plugins && \
git clone https://github.com/jpmens/check-mqtt.git jpmens-mqtt && \
#git clone https://github.com/jpmens/check-mqtt.git jpmens-mqtt && \
chmod +x /opt/WL-Nagios-Plugins/check* && \
chmod +x /opt/JE-Nagios-Plugins/check_mem/check_mem.pl && \
chmod +x /opt/DF-Nagios-Plugins/check_sql/check_sql && \
chmod +x /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins && \
chmod +x /opt/DF-Nagios-Plugins/check_vpn/check_vpn && \
chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
#chmod +x /opt/jpmens-mqtt/check-mqtt.py && \
cp /opt/JE-Nagios-Plugins/check_mem/check_mem.pl ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_database.py ${NAGIOS_HOME}/libexec/ && \
#cp /opt/nagios-mssql/check_mssql_server.py ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_sql/check_sql ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_jenkins/check_jenkins ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/
######cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/ && \
cp /opt/DF-Nagios-Plugins/check_vpn/check_vpn ${NAGIOS_HOME}/libexec/
#cp /opt/jpmens-mqtt/check-mqtt.py ${NAGIOS_HOME}/libexec/

# Add check_apc.pl check
COPY plugins/check_apc.pl ${NAGIOS_HOME}/libexec/
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Listing these as I wish to give the original users credit for their work.

Things that I have changed/updated/added to date:

* Updated the image to Ubuntu 22.04 LTS
* Updated the image to Ubuntu 24.04 LTS
* Updated Nagios Core to the current latest
* Updated Nagios Plugins to current latest
* Updated NRPE to current latest
Expand All @@ -33,7 +33,7 @@ Things that I have changed/updated/added to date:

## Information

Nagios Core running on Ubuntu 22.04 LTS with NagiosGraph, NRPE, NCPA, NSCA, and NagiosTV.
Nagios Core running on Ubuntu 24.04 LTS with NagiosGraph, NRPE, NCPA, NSCA, and NagiosTV.

| Product | Version |
| ------- | ------- |
Expand Down Expand Up @@ -61,9 +61,12 @@ docker pull ghcr.io/tronyx/nagios

#### Versions/Docker Tags

* Master (:latest) - Master branch that is known to be stable.
* Develop (:develop) - My testing/development branch for updates.
* Ubuntu-22.04 (:ubuntu-22.04) - Older Ubuntu base version that still has Python 2 and the plugins that require it. Will keep this as up-to-date as possible.
| Branch | Docker Tag | Notes |
| ------- | ------- | ------- |
| Master | `latest` | Master branch that is known to be stable. |
| Develop | `develop` | My testing/development branch for base image and component updates. |
| Ubuntu-22.04 | `ubuntu-22.04` | Older Ubuntu base version that still has Python 2 and the plugins that require it. Will keep this as up-to-date as possible. |


### Running

Expand Down Expand Up @@ -125,6 +128,5 @@ The default credentials for the web interface are:
* [WL-Nagios-Plugins](https://github.com/willixix/WL-NagiosPlugins) - Custom plugins from William Leibzon
* [JE-Nagios-Plugins](https://github.com/justintime/nagios-plugins) - Custom plugins from Justin Ellison
* [DF-Nagios-Plugins](https://github.com/danfruehauf/nagios-plugins) - Custom pluging for MSSQL monitoring from Dan Fruehauf
* [check-mqtt](https://github.com/jpmens/check-mqtt.git) - Custom plugin for mqtt monitoring from Jan-Piet Mens
* [NagiosTV](https://github.com/chriscareycode/nagiostv-react) - Monitor your Nagios server on a wall-mounted TV
* [check_apc](https://exchange.nagios.org/directory/Plugins/Hardware/UPS/APC/check_apc-2Epl/details) - Check APC for status, health, and load
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ services:
- customplugins:/opt/Custom-Nagios-Plugins
- nagiosgraphvar:/opt/nagiosgraph/var
- nagiosgraphetc:/opt/nagiosgraph/etc
- nagiosa2logs:/var/log/apache2

volumes:
# To change from Docker-managed volumes to bind mounts, add a driver_opts section as detailed here
# https://stackoverflow.com/questions/35841241/docker-compose-named-mounted-volume
nagiosetc:
nagiosvar:
customplugins:
nagiosgraphvar:
nagiosgraphetc:
nagiosa2logs:

0 comments on commit fb69c00

Please sign in to comment.