FINAL UPDATE: The code officially made it into Core:
https://github.com/NagiosEnterprises/na ... fc5e3cbe8a
This post is being kept around for posterity's sake.
Edit: As usual, please backup/snapshot before you try this!
Edit 2: Updated code, should work but I will need to test in the morning. Feel free to give it a shot and post back.
GitHub commit: https://github.com/tmcnag/nagioscore/co ... 724930a3e7
Fixed commit:
https://github.com/tmcnag/nagioscore/co ... 06e2c427cd
Alright, here's what needs to be done in brief if you do not have the /tmp/nagiosxi directory. If you do, you can skip the first wget and untar phase:
Code: Select all
cd /tmp
wget https://assets.nagios.com/downloads/nagiosxi/2014/xi-2014r2.7.tar.gz
tar xzf xi-2014r2.7.tar.gz
cd nagiosxi/subcomponents/nagioscore
wget --no-check-certificate https://github.com/tmcnag/nagioscore/tarball/master -O nagios-4.0.8.tar.gz
tar xzf nagios-4.0.8.tar.gz
mv tmcnag-nagioscore-* nagios-4.0.8
You will now need to modify the /tmp/nagiosxi/subcomponents/nagioscore/upgrade script to the following:
Code: Select all
#!/bin/sh -e
. ../../xi-sys.cfg
pkgname="nagios-4.0.8"
echo "NAGIOSCORE"
# Delete the old directory
#rm -rf "$pkgname"
#rm -rf nagios
# Extract archive
#tar -xzf "$pkgname.tar.gz"
ln -s nagios "$pkgname"
# Apply our patches
./apply-patches "$pkgname"
# Make and install Nagios
(
cd "./$pkgname"
./configure --with-command-group="$nagioscmdgroup" --disable-embedded-perl
make all
make install
#make install-init
#make install-config
#make install-commandmode
)
#comment out deprecated config items
sed -i 's/^old/#new/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/use_embedded_perl_implicitly/#use_embedded_perl_implicitly/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/^sleep_time/#sleep_time/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/^p1_file/#p1_file/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/^external_command_buffer_slots/#external_command_buffer_slots/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/^enable_embedded_perl/#enable_embedded_perl/g' /usr/local/nagios/etc/nagios.cfg
sed -i 's/^command_check_interval/#command_check_interval/g' /usr/local/nagios/etc/nagios.cfg
# Turn on auto_reschedule_checks
sed -i 's/^auto_reschedule_checks=0/auto_reschedule_checks=1/g' /usr/local/nagios/etc/nagios.cfg
# Restart the nagios service
if [ ! `command -v systemctl` ]; then
service nagios restart
else
systemctl restart nagios
fi
# Post-upgrade modifications
#./post-upgrade
Basically commenting out the lines to untar and such since we already did this. Then run it:
Code: Select all
cd /tmp/nagiosxi/subcomponents/nagioscore
./upgrade
Let me know if it complains. If it succeeds, you can now add "host_down_disable_service_checks=1" to nagios.cfg to enable, making sure to restart.
Please let me know if you run into any issues.
Update:
It appears some code from another branch made it into my commit. Nothing major, just changes the way newlines in output is processed. It should not affect the actual building of Core, but I will work on reverting my commit to a "clean" state so it only contains my changes. - Fixed, see edit at top of post.