Skip to content

Commit

Permalink
Changed to compile from source
Browse files Browse the repository at this point in the history
Changed build.sh to include additional packages
Updated README

Signed-off-by: Todd Campbell <todd@sensu.io>
  • Loading branch information
Todd Campbell committed Apr 2, 2020
1 parent 69b7bb9 commit 7edbb0d
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 30 deletions.
11 changes: 10 additions & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /

RUN apk --update add bash coreutils libintl curl gcc g++ make openssl-dev net-snmp-tools linux-headers procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apk --update add bash monitoring-plugins coreutils libintl
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
13 changes: 11 additions & 2 deletions Dockerfile.amazon1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/
WORKDIR /

RUN yum groupinstall -y "Development Tools" && yum install -y curl expat-devel openssl openssl-devel net-snmp-utils bind-utils && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN yum-config-manager --enable epel && yum install -y which tar nagios-plugins-all
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.amazon2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/
WORKDIR /

RUN yum groupinstall -y "Development Tools" && \
yum install -y curl expat-devel openssl openssl-devel net-snmp-utils bind-utils which procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN amazon-linux-extras install -y epel && yum install -y which tar nagios-plugins-all
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
13 changes: 12 additions & 1 deletion Dockerfile.centos6
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@ ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/

RUN yum install -y epel-release which && yum install -y nagios-plugins-all
WORKDIR /

RUN yum groupinstall -y "Development Tools" && yum install -y curl expat-devel openssl openssl-devel net-snmp-utils bind-utils && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/
WORKDIR /

RUN yum groupinstall -y "Development Tools" && \
yum install -y curl expat-devel openssl openssl-devel net-snmp-utils bind-utils which procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN yum install -y epel-release which && yum install -y nagios-plugins-all
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
16 changes: 14 additions & 2 deletions Dockerfile.centos8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib64/nagios/plugins/
WORKDIR /

RUN rm -rf /var/cache/dnf && \
dnf -y upgrade && \
dnf groupinstall -y "Development Tools" && \
dnf install -y curl expat-devel openssl openssl-devel net-snmp-utils bind-utils which procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN yum install -y epel-release which && yum --enablerepo=PowerTools install -y nagios-plugins-all
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.debian10
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib/nagios/plugins/
WORKDIR /

RUN apt-get update && \
apt-get install -y build-essential curl libexpat1-dev openssl libssl-dev libz-dev snmp dnsutils procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apt-get update && apt-get install -y monitoring-plugins-basic
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.debian8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib/nagios/plugins/
WORKDIR /

RUN apt-get update && \
apt-get install -y build-essential curl libexpat1-dev openssl libssl-dev libz-dev snmp dnsutils && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apt-get update && apt-get install -y monitoring-plugins-basic
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.debian9
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib/nagios/plugins/
WORKDIR /

RUN apt-get update && \
apt-get install -y build-essential curl libexpat1-dev openssl libssl-dev libz-dev snmp dnsutils procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apt-get update && apt-get install -y monitoring-plugins-basic
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.ubuntu1604
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib/nagios/plugins/
WORKDIR /

RUN apt-get update && \
apt-get install -y build-essential curl libexpat1-dev openssl libssl-dev libz-dev snmp dnsutils procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apt-get update && apt-get install -y monitoring-plugins-basic
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
14 changes: 12 additions & 2 deletions Dockerfile.ubuntu1804
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ ARG PLUGINS="check_http"

ADD create-sensu-asset /usr/bin/create-sensu-asset

WORKDIR /usr/lib/nagios/plugins/
WORKDIR /

RUN apt-get update && \
apt-get install -y build-essential curl libexpat1-dev openssl libssl-dev libz-dev snmp dnsutils procps && \
curl -s -L -O https://www.monitoring-plugins.org/download/monitoring-plugins-2.2.tar.gz && \
tar xzf monitoring-plugins-2.2.tar.gz && \
cd monitoring-plugins-2.2 && \
./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins && \
make && \
make install

WORKDIR /usr/lib/monitoring-plugins/

RUN apt-get update && apt-get install -y monitoring-plugins-basic
RUN create-sensu-asset -a $SENSU_GO_ASSET_NAME -b $PLUGINS -v $SENSU_GO_ASSET_VERSION -o /
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ creating a Sensu Go Asset containing the C plugins.

## Goal

The goal of this project is to provide Sensu Go Assets for CentOS/RHEL Linux (6, 7, and 8), Debian Linux (8, 9, and 10), Ubuntu Linux (16.04 and 18.04), and Alpine Linux containing all of the plugins from the Monitoring Plugins project.
The goal of this project is to provide Sensu Go Assets for CentOS/RHEL Linux
(6, 7, and 8), Debian Linux (8, 9, and 10), Ubuntu Linux (16.04 and 18.04),
Amazon Linux (1 and 2), and Alpine Linux containing a good subset of the
plugins from the Monitoring Plugins project.

### Current Status

Expand All @@ -18,28 +21,32 @@ Currently, This project will attempt to provide support for the following plugin
- `check_disk`
- `check_dns`
- `check_http`
- `check_load`
- `check_log`
- `check_mailq`
- `check_ntp`
- `check_ntp_peer`
- `check_ntp_time`
- `check_ping`
- `check_procs`
- `check_smtp`
- `check_snmp`
- `check_ssh`
- `check_swap`
- `check_tcp`
- `check_time`
- `check_users`

### Next Steps

In no particular order:
### Caveats

- Add support for platform-specific exclusions in the build script (i.e. if
`check_snmp` is available for CentOS and Debian, but not for Alpine, just skip
it on Alpine?)
- Build the plugins from scratch instead of installing the distribution packages
(which are inconsistent between Alpine, Debian, and CentOS)
- Hook up a CI pipeline to automate the builds
Several plugins, though compiled binaries, require that certain commands be available from the OS.

Examples (not exhaustive):

* check_snmp requires snmpget
* check_procs requires ps
* check_dns requires nslookup

## Build

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

export PLUGINS="check_disk,check_http,check_ntp,check_ntp_peer,check_ntp_time,check_ping,check_procs,check_smtp,check_ssh,check_swap,check_tcp,check_time,check_users"
export PLUGINS="check_disk,check_http,check_ntp,check_ntp_peer,check_ntp_time,check_ping,check_procs,check_smtp,check_ssh,check_swap,check_tcp,check_time,check_users,check_snmp,check_dns,check_mailq,check_log,check_load"
export SENSU_GO_ASSET_VERSION=$(git describe --abbrev=0 --tags)

mkdir assets/
Expand Down

0 comments on commit 7edbb0d

Please sign in to comment.