Setting up Nagios Core

nagios core install | nagios core | nagios plugins | nagios ssh

tested on debian12

Requirements

that libgd-dev package sometimes provoques conflicts so let’s install it first

apt install libgd-dev libjpeg-dev libpng-dev
# libpnglite-dev

we are trying NOT to install apache (got NGINX already)

#apt install apache2 php php-gd php-imap php-curl libapache2-mod-php
# php-mcrypt

apt install libxml-libxml-perl libnet-snmp-perl libperl-dev libnumber-format-perl libconfig-inifiles-perl libdatetime-perl libnet-dns-perl

Sysprep

groupadd -g 517 nagios
useradd -u 517 -g nagios --system -s /sbin/nologin -d /var/nagios nagios

groupadd -g 518 nagios-cmd
useradd -u 518 -g nagios-cmd --system -s /sbin/nologin -d /var/nagios nagios-cmd

there is a setgid in da place, we need either the same group, or enable that

usermod -aG nagios-cmd nagios

Install

no need to change ownerships, let install-config handle it more precisely

mkdir /etc/nagios/
mkdir /var/nagios/

grab the latest Core release

ver=4.4.13

wget https://github.com/NagiosEnterprises/nagioscore/archive/refs/tags/nagios-$ver.tar.gz
tar xzf nagios-$ver.tar.gz
cd nagioscore-nagios-$ver/

# otherwise goes to /usr/local/nagios/
./configure --prefix=/usr/local \
    --sysconfdir=/etc/nagios --localstatedir=/var/nagios \
    --with-gd-lib --with-gd-inc \
    --with-nagios-user=nagios --with-nagios-group=nagios \
    --with-command-user=nagios-cmd --with-command-group=nagios-cmd \
    --without-httpd-conf \
    --with-mail=/usr/sbin/sendmail

    #--with-httpd-conf=/etc/apache2/sites-enabled \

# CHECK THERE WAS NO LARGE WARNING ABOUT GD

echo $MAKEFLAGS
make all
make install
make install-init
make install-commandmode
make install-config

check

/usr/local/nagios/bin/nagios -v

Resources

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickstart.html

https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html#Debian

https://exchange.nagios.org/directory/Documentation/Nagios-Core-Documentation/Nagios-core-installation-guide-for-RED-HAT-and-CentOS-Systems/details

https://www.howtoforge.com/tutorial/how-to-install-nagios-on-ubuntu-2004/

https://linuxhint.com/install_nagios_ubuntu/

https://linuxize.com/post/how-to-install-nagios-on-ubuntu-20-04/ ==> htdigest

https://www.centlinux.com/2021/04/install-nagios-core-on-ubuntu-lts.html

https://kifarunix.com/install-and-setup-nagios-core-on-ubuntu-20-04/

https://www.scaleway.com/en/docs/tutorials/configure-nagios-monitoring/

install troubles

https://computingforgeeks.com/install-php-mcrypt-extension-on-ubuntu/

https://askubuntu.com/questions/1031921/php-mcrypt-package-missing-in-ubuntu-server-18-04-lts


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun