Should be final build.sh for bare -> Nagios core
This commit is contained in:
@@ -38,7 +38,7 @@ sudo usermod -aG nagcmd nagios
|
||||
sudo usermod -aG nagcmd www-data
|
||||
cd /tmp
|
||||
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.5.12.tar.gz
|
||||
tar -xzf nagios-4.5.12.tar.gz
|
||||
tar -xzf nagios-4.5.12.tar.gz && rm nagios-4.5.12.tar.gz
|
||||
cd nagios-4.5.12
|
||||
./configure --with-command-group=nagcmd
|
||||
make all
|
||||
@@ -55,7 +55,7 @@ do_done
|
||||
do_msg "Installing Nagios plugins"
|
||||
cd /tmp
|
||||
wget https://nagios-plugins.org/download/nagios-plugins-2.4.11.tar.gz
|
||||
tar -xzf nagios-plugins-2.4.11.tar.gz
|
||||
tar -xzf nagios-plugins-2.4.11.tar.gz && rm nagios-plugins-2.4.11.tar.gz
|
||||
cd nagios-plugins-2.4.11
|
||||
./configure --with-nagios-user=nagios --with-nagios-group=nagios
|
||||
make
|
||||
@@ -73,26 +73,29 @@ do_done
|
||||
### Installing NCPA and the like, getting the box to monitor itself via NCPA
|
||||
# Install check_ncpa (C code from beta test)
|
||||
do_msg "Installing NCPA"
|
||||
###
|
||||
##
|
||||
# FIX
|
||||
##
|
||||
###
|
||||
sudo wget -O /usr/local/nagios/libexec/check_ncpa https://git.everwatch.global/eloyd/NWC2026-Fusion/raw/branch/main/check_ncpa
|
||||
sudo chown nagios:nagios /usr/local/nagios/libexec/check_ncpa
|
||||
sudo chmod 755 /usr/local/nagios/libexec/check_ncpa
|
||||
arch=$(uname -m)
|
||||
file="check_ncpa.${arch}"
|
||||
if [ -r "$file" ]; then
|
||||
echo "Will install $file, since it's here..."
|
||||
echo "==> Installing ${file} to /usr/local/nagios/libexec..."
|
||||
sudo install -d /usr/local/nagios/libexec
|
||||
sudo install -m 0755 ${file} /usr/local/nagios/libexec/check_ncpa
|
||||
echo "==> Installation complete!"
|
||||
echo "Installed to: /usr/local/nagios/libexec/check_ncpa"
|
||||
else
|
||||
echo ""
|
||||
echo "### IMPORTANT:"
|
||||
echo "### You must extract, compile, and install the check_ncpa_c.2.Mar-05-26.tgz beta code to /usr/local/nagios/libexec"
|
||||
echo "### Failure to do so will result in service check failures that may be hard to diagnose."
|
||||
echo ""
|
||||
fi
|
||||
### Verify
|
||||
/usr/local/nagios/libexec/check_ncpa --version
|
||||
### Output: check_ncpa.c, Version 1.2.4
|
||||
|
||||
# Install NCPA Agent
|
||||
###
|
||||
##
|
||||
# FIX
|
||||
##
|
||||
###
|
||||
sudo wget -O /tmp/ncpa_3.3.1-1_armhf.deb /tmp https://git.everwatch.global/eloyd/NWC2026-Fusion/raw/branch/main/ncpa_3.3.1-1_armhf.deb
|
||||
sudo apt install /tmp/ncpa_3.3.1-1_armhf.deb
|
||||
cd ~/NWC2026-Fusion
|
||||
sudo apt install ./ncpa_3.3.1-1_armhf.deb
|
||||
### Verify
|
||||
/usr/local/nagios/libexec/check_ncpa -H localhost -t mytoken -M system/version
|
||||
### Output: OK: Version was #1 SMP Raspbian 1:6.12.75-1+rpt1 (2026-03-11) | 'version'=#1 SMP Raspbian 1:6.12.75-1+rpt1 (2026-03-11);;;
|
||||
@@ -104,13 +107,7 @@ cd /usr/local/nagios/etc/
|
||||
sudo mkdir EWG && sudo chown nagios:nagios EWG
|
||||
sudo /bin/sh -c 'grep -q "cfg_dir=/usr/local/nagios/etc/EWG" nagios.cfg && echo "cfg_dir line already added." || echo "cfg_dir=/usr/local/nagios/etc/EWG" >> nagios.cfg'
|
||||
cd EWG
|
||||
###
|
||||
##
|
||||
# FIX
|
||||
##
|
||||
###
|
||||
sudo wget https://git.everwatch.global/eloyd/NWC2026-Fusion/raw/branch/main/EWG_configs.tar.gz
|
||||
sudo tar xvfz EWG_configs.tar.gz && sudo rm EWG_configs.tar.gz
|
||||
sudo tar xvfz ~/NWC2026-Fusion/EWG_configs.tar.gz && sudo rm EWG_configs.tar.gz
|
||||
sudo sed -i -e "s/localhost:NCPA/${HOSTNAME}/g" *.cfg
|
||||
### Verify
|
||||
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
|
||||
|
||||
Reference in New Issue
Block a user