Upgrading to CentOS 8, nagios service failing to start.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
danniiffxi
Posts: 121
Joined: Tue Jan 30, 2018 3:29 am
Location: UK

Upgrading to CentOS 8, nagios service failing to start.

Post by danniiffxi »

Hi Guys

I am currently in the process of upgrading our Nagios instances on to CentOS 8 VM's, I ran a config backup from our CentOS 6.10 test server and transferred the tar file to the new CentOS 8 VM.. Both VM's are running 5.7.2..

Code: Select all

[root@nagxit01 nagiosxi]# /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1594829221.tar.gz
WARNING: you are trying to restore a el6 backup on a el8 system
         Compiled plugins and other binaries as well as httpd configurations
         will NOT be restored.

         You will need to re-download the Nagios XI tarball, and re-install
         the subcomponents for this system. More info here:
         https://assets.nagios.com/downloads/nagiosxi/docs/Backing-Up-And-Restoring-Nagios-XI.pdf

Are you sure you want to continue? [y/N]
After the restore completed successfully I continued following the documentation and ran the following.

Code: Select all

cd /tmp/
wget https://assets.nagios.com/downloads/nagiosxi/scripts/restore_repair.sh
chmod +x restore_repair.sh
./restore_repair.sh
The process seemingly finished without error with the following text.

Code: Select all

make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
cd ./share && make
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/share'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/share'
cd ./scripts && make
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'

*** Compile finished ***

  make install
     - This installs the main program and HTML files

Enjoy.

cd ./src && make install
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
make install-basic
make[2]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/var/spool/perfdata/
/usr/bin/install -c -m 754 -o nagios -g nagios npcd /usr/local/nagios/bin
/usr/bin/install -c -m 754 -o nagios -g nagios npcdmod.o /usr/local/nagios/bin
make[2]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
make strip-post-install
make[2]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
/usr/bin/strip /usr/local/nagios/bin/npcd
/usr/bin/strip /usr/local/nagios/bin/npcdmod.o
make[2]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/src'
cd ./share && make install
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/share'
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/images
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/include
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/include/font
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/include/font/makefont
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/include/js
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/lang/
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/templates/
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/templates.dist/
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/pnp/templates.special/
for file in pnp/*.php; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp; done
for file in pnp/templates.dist/*.php; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/templates.dist; done
for file in pnp/templates.special/*.php; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/templates.special; done
for file in pnp/lang/*.php; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/lang; done
for file in pnp/images/*; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/images; done
for file in pnp/include/*.*; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/include; done
for file in pnp/include/js/*; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/include/js; done
for file in pnp/include/font/*.php; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/include/font; done
for file in pnp/include/font/makefont/*; \
do /usr/bin/install -c -m 644 -o nagios -g nagios $file /usr/local/nagios/share/pnp/include/font/makefont; done
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/share'
cd ./scripts && make install
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/share/perfdata
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/libexec
make install-processperfdata
make[2]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
/usr/bin/install -c -m 755 -o nagios -g nagios process_perfdata.pl /usr/local/nagios/libexec
make[2]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
make install-plugins
make[2]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
/usr/bin/install -c -m 755 -o nagios -g nagios check_pnp_rrds.pl /usr/local/nagios/libexec
make[2]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/scripts'
cd ./sample-config && make install
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/sample-config'
rm -f /usr/local/nagios/share/pnp/conf/config.php
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/etc/pnp
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/etc/pnp/check_commands
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/etc/pnp/pages
/usr/bin/install -c -m 644 -o nagios -g nagios  pnp/pnp4nagios_release /usr/local/nagios/etc/pnp
/usr/bin/install -c -m 644 -o nagios -g nagios  pnp/config.php /usr/local/nagios/etc/pnp
/usr/bin/install -c -m 644 -o nagios -g nagios  pnp/background.pdf /usr/local/nagios/etc/pnp
make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest/sample-config'
make install-basic
make[1]: Entering directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest'

*** Main program, Scripts and HTML files installed ***

Please run 'make install-config' to install sample
configuration files

Please run 'make install-init' if you want to use
BULK Mode with NPCD



make[1]: Leaving directory '/tmp/nagiosxi/subcomponents/pnp/pnp-latest'
UPGRADE: PNP upgraded OK.
INSTALL: Webinject is being installed...
INSTALL: Webinject installed OK.
You have new mail in /var/spool/mail/root
I then ran the following after the Nagios service didn't start, and I received the following error.

Code: Select all

systemctl status nagios.service
● nagios.service - Nagios Core 4.4.6
   Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2020-07-15 17:58:04 BST; 5min ago
     Docs: https://www.nagios.org/documentation
 Main PID: 551406 (code=exited, status=0/SUCCESS)

Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: Copyright (c) 1999-2009 Ethan Galstad
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: Last Modified: 2020-04-28
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: License: GPL
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: Website: https://www.nagios.org
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: Reading configuration data...
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]: Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 83 (Check result path '/var/n>
Jul 15 17:58:04 wxlnxnagxit01 nagios[573085]:    Error processing main config file!
Jul 15 17:58:04 wxlnxnagxit01 systemd[1]: nagios.service: Control process exited, code=exited status=1
Jul 15 17:58:04 wxlnxnagxit01 systemd[1]: nagios.service: Failed with result 'exit-code'.
Jul 15 17:58:04 wxlnxnagxit01 systemd[1]: Failed to start Nagios Core 4.4.6.
Line 83 in the nagios.cfg file..

Code: Select all

     83 check_result_path=/var/nagiosramdisk/spool/checkresults
Any idea how to fix this issue, or did i miss something? This is only our Test server and I have snapshot with the vanilla XI install so I can revert a try again if needed, but I'd like to iron out off the bugs before i try this on our production servers. If you need any more info, please let me know.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgrading to CentOS 8, nagios service failing to start.

Post by scottwilkerson »

Did you have a ramdisk setup on the old system and didn't set it up on the new one?

This would be required to go through on the new server
https://assets.nagios.com/downloads/nag ... giosXI.pdf
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
danniiffxi
Posts: 121
Joined: Tue Jan 30, 2018 3:29 am
Location: UK

Re: Upgrading to CentOS 8, nagios service failing to start.

Post by danniiffxi »

Hi Scott

I never installed a ramdisk when I re-built the original test server a few years back, but I have just checked and the old system does have the /var/nagiosramdisk/spool/checkresults folder in place, did older versions of Nagios install a ramdisk automatically? I'd remember if I installed onet.

Either way I ran the installer in the guide you sent through as I have a VM snapshot, and the following happens. The script I would expect to create the correct folder, errors because it can't find the folder.

Code: Select all

[root@nagxit01 tmp]# wget https://assets.nagios.com/downloads/nagiosxi/scripts/install_ramdisk.sh
--2020-07-16 07:43:06--  https://assets.nagios.com/downloads/nagiosxi/scripts/install_ramdisk.sh
Resolving assets.nagios.com (assets.nagios.com)... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821
Connecting to assets.nagios.com (assets.nagios.com)|72.14.181.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9774 (9.5K) [application/x-sh]
Saving to: ‘install_ramdisk.sh’

install_ramdisk.sh                   100%[====================================================================>]   9.54K  --.-KB/s    in 0s

2020-07-16 07:43:06 (143 MB/s) - ‘install_ramdisk.sh’ saved [9774/9774]

[root@wxlnxnagxit01 tmp]# chmod +x install_ramdisk.sh
[root@wxlnxnagxit01 tmp]# ./install_ramdisk.sh
======================================== IMPORTANT! ========================================
This script automates the process of setting up a RAM Disk in Nagios XI.
DO NOT USE IT IF YOU HAD A RAMDISK, PREVIOUSLY INSTALLED ON YOUR SYSTEM
OR IF YOU ARE UNSURE IF YOU HAD ONE IN THE PAST!
============================================================================================

Do you want to continue with automatic install? [Y/n] y
Proceeding with setting up RAM Disk in Nagios XI...
Checking for config errors...

Nagios Core 4.4.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2020-04-28
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 83 (Check result path '/var/nagiosramdisk/spool/checkresults' is not a valid directory)
   Error processing main config file!


Config errors found. Exiting...
So after that i ended up creating the folders /var/nagiosramdisk/spool/checkresults and /var/nagiosramdisk/tmp manually and running the installer again.

Code: Select all

All done!
Old configs were backed up in /tmp/ramdiskbackup
RAM Disk was installed in /var/nagiosramdisk
The RAM Disk size was set to 300 MB

[root@wxlnxnagxit01 tmp]# systemctl status nagios.service
● nagios.service - Nagios Core 4.4.6
   Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-07-16 08:07:50 BST; 28s ago
     Docs: https://www.nagios.org/documentation
  Process: 809542 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
  Process: 809540 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
 Main PID: 809544 (nagios)
    Tasks: 6 (limit: 11308)
   Memory: 14.7M
And as you can see it is now working.. It just seems like a headache to have to create the folder chmod then run the installer.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgrading to CentOS 8, nagios service failing to start.

Post by scottwilkerson »

Glad to see it is working now.

Someone specifically setup a ramdisk on the old system as Nagios XI installer does not do this on it
s own

Marking as resolved.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked