This commit is contained in:
root 2024-11-25 01:35:17 +02:00
commit 50a4a3ea65
3 changed files with 59 additions and 0 deletions

57
install.sh Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Based on: https://reintech.io/blog/installing-configuring-nagios-monitoring-debian
NAGIOS_URL="$( head -1 nagios-latest.txt)"
NAGIOS_PLUGINS_URL="$( head -1 nagios-plugins-latest.txt )"
apt update && apt upgrade
apt install -y build-essential
apt install -y make curl wget unzip apache2 php libapache2-mod-php libgd-dev
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
wget "${NAGIOS_URL}" -O nagios.tar.gz
tar xzf nagios-*.tar.gz
cd nagios-*
./configure --with-nagios-group=nagios --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
## Simple password
htpasswd -b -c /usr/local/nagios/etc/htpasswd.users nagiosadmin admin
a2enmod rewrite cgi
systemctl restart apache2
wget "${NAGIOS_PLUGINS_URL}" -O "nagios-plugins.tar.gz"
tar xzf nagios-plugins-*.tar.gz
cd nagios-plugins-*
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make
make install
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
systemctl start nagios
systemctl enable nagios

1
nagios-latest.txt Normal file
View File

@ -0,0 +1 @@
https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.5.8/nagios-4.5.8.tar.gz

View File

@ -0,0 +1 @@
https://nagios-plugins.org/download/nagios-plugins-2.4.9.tar.gz