Skip to content

Instantly share code, notes, and snippets.

@Reetus
Created June 30, 2017 09:23
Show Gist options
  • Save Reetus/a3573d86253ae6bd1642569bf58203b1 to your computer and use it in GitHub Desktop.
Save Reetus/a3573d86253ae6bd1642569bf58203b1 to your computer and use it in GitHub Desktop.
docker-nagios4-arm64
FROM aarch64/debian:jessie
RUN apt-get -qy update
RUN apt-get -qy install nginx php5-fpm php5-mysqlnd php5-curl php5-gd php5-mcrypt php5-memcache php5-sqlite php5-cli php5-geoip
ENV CORE_FILENAME nagios-4.3.2
ENV PLUGINS_FILENAME nagios-plugins-2.2.1
RUN apt-get -qy install build-essential unzip openssl libssl-dev libgd2-xpm-dev wget fcgiwrap php5-gd libgd-dev apache2-utils net-tools
RUN useradd nagios && groupadd nagcmd
RUN cd /root && wget https://assets.nagios.com/downloads/nagioscore/releases/$CORE_FILENAME.tar.gz && tar -xzvf $CORE_FILENAME.tar.gz
RUN cd ~/$CORE_FILENAME && ./configure && make all
RUN cd /root && wget https://nagios-plugins.org/download/$PLUGINS_FILENAME.tar.gz && tar -xzvf $PLUGINS_FILENAME.tar.gz
RUN cd ~/$PLUGINS_FILENAME/build-aux && wget -O config.guess "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
RUN cd ~/$PLUGINS_FILENAME && ./configure && make && make install
RUN usermod -a -G nagcmd nagios
RUN cd ~/$CORE_FILENAME && make install && make install-config && make install-init && make install-commandmode
RUN sed -i "s/url_html_path=\/nagios/url_html_path=\//g" /usr/local/nagios/etc/cgi.cfg
ADD nginx.conf /etc/nginx/sites-enabled/nagios.conf
RUN htpasswd -cb /etc/nginx/htpasswd.users nagiosadmin shmoo
RUN apt-get install libio-socket-ssl-perl libnet-ssleay-perl perl
RUN cd /root/ && wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz && tar -zxvf sendEmail-v1.56.tar.gz && cp -a sendEmail-v1.56/sendEmail /usr/local/bin && chmod +x /usr/local/bin/sendEmail
ADD custom.cfg /usr/local/nagios/etc/objects/
RUN sed -i "s/cfg_file=\/usr\/local\/nagios\/etc\/objects\/localhost.cfg/cfg_file=\/usr\/local\/nagios\/etc\/objects\/custom.cfg/g" /usr/local/nagios/etc/nagios.cfg
RUN apt-get -qy install nano ssh
CMD /etc/init.d/nagios start && /etc/init.d/fcgiwrap start && /etc/init.d/php5-fpm start && /etc/init.d/nginx start && tail -f /var/log/nginx/error.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment