Page 1 of 1

Help with fresh install on Ubuntu - multiple failures - MRTG Service won't start and more

Posted: Wed Oct 08, 2025 1:19 pm
by bret.mcgonigle
Hey everyone, been using NagiosXI for years and it's time to migrate to a new box with a fresh install and I'm having some struggles. I really appreciate this forum and the countless threads (which I've so thoroughly searched) but I'm stumped at the moment. Here goes:

---

Linux Distro: Ubuntu 24.04.3 LTS
64 bit
Manual Install of XI via "wget https://assets.nagios.com/downloads/nagiosxi/install.sh"
No special configuration, no GUI, no proxy, but I am connected via SSH over a VPN
It is a VM hosted by Rackspace, our cloud hosting provider. Same as the previous NagiosXI installation

I'll attach the install.log file to this post but here's the short version, which I will give more detail on:
Attempted a fresh install of NagiosXI as the root user. It fails on multiple steps, and each time I resolve one of the failures, I encounter another further in. I have done a complete wipe/reset multiple times to try to do the install run without errors by proactively running the fixes I uncovered on the previous attempt. As a controlled test, I grabbed a spare mini-PC, installed the same version of Ubuntu and took the same steps, I encounter no errors and the installation completes perfectly. I keep referencing files on that known working machine but I cannot find any differences. My organization is enforcing the distro choice, cloud provider, and another team handles the firewall and imaging of cloud VM's, so I don't have as much visibility on that as I'd like to have.

---

Detailed steps below:
1. I log in as my user, but use 'sudo -i' to run things as root, so all commands ahead are as root user
2. I run 'apt update && upgrade' SUCCESS
3. I run 'apt install apache2 php mysql-server php-mysql libapache2-mod-php php-gd php-ldap php-pear php-xml php-soap php-intl php-json php-mbstring php-cli php-curl' SUCCESS
4. I run wget 'https://assets.nagios.com/downloads/nagiosxi/install.sh' SUCCESS
5. I run 'chmod +x install.sh' SUCCESS
6. I run './install.sh' which succeeds in downloading the Nagios package, but fullinstall fails, permission ERROR
7. I run 'mount -o remount,exec /tmp/', which then allows fullinstall to run. I run fullinstall...

Now from this point, NagiosXI begins installing various packages, dependencies, configurations. My first failure is usually part of Step 01 phpize error
->I resolve this error by using 'pecl uninstall ssh2' then 'pecl clear-cache' then 'pecl install ssh2'

I run fullinstall again and it proceeds past this error.

Next error is on Step 03, MySQL fails to start, journalctl shows it is in Frozen state.
"systemctl stop mysql"
"apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*"
"rm -rf /etc/mysql"
"rm -rf /var/lib/mysql"
"apt autoremove"
"apt autoclean"
That sequence clears up that error. I run fullinstall again and it proceeds past that error.

Next error is on Step 11. This error has changed a few times depending on the above steps. The first time, it was "can't locate mysql headers," which required me to download a missing package (from another thread here) 'apt install libmysqlclient-dev' which cleared that up. However on this most recent install attempt, I am not seeing this error.
Instead, still on Step 11, I have two errors now:
MRTG installation failed - exiting.

The MRTG service will not start, and doesn't give me any information as to why it won't start. Most of the threads I can find on this one are about troubleshooting MRTG after installation. I attempted a manual installation of MRTG which gets me past the installation failed message, but mrtg.service is still not running even though it installed (same if I remove/wipe it first then reinstall). Checking my working mini-PC box, the config files and folders are all present and all identical.

The 2nd error in this section is 'nagios-mod-gearman' installation failed, permission denied. I can't find much about this, but I'm worried that the previous errors are causing a daisy chain effect where I'm wasting my time troubleshooting this far in. As a hail mary attempt on the last reset of this vm, I even opened read/write/execute permissions on the entire /etc/ /tmp/ and /var/ directories. I'm no linux expert so I'm a little confused how I'm logged in as root with all directors completely 777 open and I'm still getting permission denied errors, when the exact same thing on my mini-pc works without any permission errors at all.

Does the fullinstall use the Nagios user to make certain configuration changes? If so, how do I ensure that the nagios user it creates has the correct permission levels on the system? Does the fullinstall script not apply those permissions to the required folders or is something stopping that from occuring?

---

I really appreciate any help here. There must be something about this image (out of my scope) different from a base Ubuntu install but that's my only guess left at this point, and I don't know what to do with that information anyway as my organization only allows this approved image.
Thanks
-Bret

Edit: I keep getting a generic HTTP error attaching the install.log, so I've put it on google drive
https://drive.google.com/file/d/19dOzNR ... sp=sharing

Re: Help with fresh install on Ubuntu - multiple failures - MRTG Service won't start and more

Posted: Wed Oct 08, 2025 3:47 pm
by lgute
Hi @bret.mcgonigle,

Thanks for reaching out.

I'm going to try to duplicate your install issues. In the meantime, here are some documents that may help in the migration process (depending on which version of XI is running on your old server): Please note: in order to migrate your data to the new server, you have to start with the same version of XI as is installed on your old server.

Re: Help with fresh install on Ubuntu - multiple failures - MRTG Service won't start and more

Posted: Thu Oct 09, 2025 1:30 pm
by bret.mcgonigle
Thanks again for the help all. I did attempt a manual install of mrtg, snmp, and libgd-dev which all show as successful and up to date.
Thomas201Tang wrote: Thu Oct 09, 2025 3:23 am Comparing your working mini-PC’s repo files may also reveal differences in Rackspace’s VM image setup.
Okay, we might be onto something here.

Here is the repo list for my mini-PC:

Code: Select all

root@ubuntu-nagiosxi:~# grep -Erh ^deb /etc/apt/sources.list*
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
And the repo list for the Rackspace unit:

Code: Select all

root@1365849-ubuntu1:~# grep -Erh ^deb /etc/apt/sources.list*
deb https://mirror.rackspace.com/ubuntu/ noble main restricted
deb https://mirror.rackspace.com/ubuntu/ noble-updates main restricted
deb https://mirror.rackspace.com/ubuntu/ noble universe
deb https://mirror.rackspace.com/ubuntu/ noble-updates universe
deb https://mirror.rackspace.com/ubuntu/ noble multiverse
deb https://mirror.rackspace.com/ubuntu/ noble-updates multiverse
deb https://mirror.rackspace.com/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirror.rackspace.com/ubuntu/ noble-security main restricted
deb https://mirror.rackspace.com/ubuntu/ noble-security universe
deb https://mirror.rackspace.com/ubuntu/ noble-security multiverse
deb http://mirror.rackspace.com/ubuntu noble main restricted
deb-src http://mirror.rackspace.com/ubuntu noble main restricted
deb http://mirror.rackspace.com/ubuntu noble-updates main restricted
deb-src http://mirror.rackspace.com/ubuntu noble-updates main restricted
deb http://mirror.rackspace.com/ubuntu noble universe
deb-src http://mirror.rackspace.com/ubuntu noble universe
deb http://mirror.rackspace.com/ubuntu noble-updates universe
deb-src http://mirror.rackspace.com/ubuntu noble-updates universe
deb http://mirror.rackspace.com/ubuntu noble multiverse
deb-src http://mirror.rackspace.com/ubuntu noble multiverse
deb http://mirror.rackspace.com/ubuntu noble-updates multiverse
deb-src http://mirror.rackspace.com/ubuntu noble-updates multiverse
deb http://mirror.rackspace.com/ubuntu noble-security main restricted
deb-src http://mirror.rackspace.com/ubuntu noble-security main restricted
deb http://mirror.rackspace.com/ubuntu noble-security universe
deb-src http://mirror.rackspace.com/ubuntu noble-security universe
deb http://mirror.rackspace.com/ubuntu noble-security multiverse
deb-src http://mirror.rackspace.com/ubuntu noble-security multiverse
deb https://mirror.rackspace.com/opensuse/repositories/home:/holland-backup/xUbuntu_24.04 ./
deb [ arch=amd64 ] https://rax.mirror.rackspace.com/ubuntu noble main
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
-----
The Rackspace one does have the same final entry, but a lot of other differences and I see in my install log that it used many of Rackspace's mirrors to download.
Am I correct in thinking that there is a corrupted repo or some other kind of mismatch in the Rackspace repos?
And if so, if I revert to the Ubuntu default repos (hopefully not blocked by my firewalls) I'm thinking that may solve the issue.

I'll give this a shot and report back.

Quick update: I made a backup and replaced the source.list and source.list.d with copies from my known working installation, and ran the full install again. I did do an update && upgrade and it did process some packages, but still I failed at the same step. I didn't completely expect that to work because it skipped so many if there is a bad repo already present it wouldn't have caught it I think.

Maybe next step is to restore to the backup/blank install, change the sources to default Ubuntu, then try a fresh install again.
I'll work with my team to make this happen. Thanks again for the tips.