Upgrade transition issues

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
mynameis[ORIG1]
Posts: 9
Joined: Tue Aug 13, 2024 10:29 am

Upgrade transition issues

Post by mynameis[ORIG1] »

Hey Community,

We just tried to upgrade our nagios xi from centos 7 to rhel9. We mostly had a successful transition except for a few parts.

1.) Whenever we do apply configuration. We get this issue.

Code: Select all

<div>Error: Service description, host name, or check command is NULL</div><div>Error: Could not register service (config file '/usr/local/nagios/etc/services/DC-HOSTNAME-1.cfg', starting on line 16)</div>
This host is suppose to be a passive checks for it's monitored services according to my boss. It worked fine in the centos7 one, but not here. Why is that?
When I run this command to verify that everything works, I run into a completely different issue:

Code: Select all

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.4.13
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2023-06-01
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'webHOSTNAME.DOMAIN.NAME' (config file '/usr/local/nagios/etc/services/Base-WINDOWS-C-USAGE.cfg', starting on line 16)
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 2467 services.
        Checked 288 hosts.
        Checked 42 host groups.
        Checked 0 service groups.
        Checked 31 contacts.
        Checked 4 contact groups.
        Checked 151 commands.
        Checked 35 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 288 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 35 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
Shouldn't the nagios -v command output what is showing in apply configuration? I realize that that's another issue, but I want to get the apply configuration in a running state.

2.) We had a problem with the Monitoring Engine and Performance Grapher showing as red. We get the same issue as the problem description herehttps://support.nagios.com/kb/article/n ... d-533.html. When we apply it, it does turn those green, but the problem description still occurs. Is there anything else we could possibly do

We are using Nagios XI 2024R1.1.2. Could upgrading solve this issue?

Just out of curiosity, would y'all recommend just using the already built centos 9 steam image by nagios because we are facing these issues, or would you recommend facing them head on?
DoubleDoubleA
Posts: 123
Joined: Thu Feb 09, 2017 5:07 pm

Re: Upgrade transition issues

Post by DoubleDoubleA »

Hi @mynameis[ORIG1],

On this issue I would put in a ticket with support. They've worked CentOS 7 EOL issues and will be your best resource.

Aaron
mynameis[ORIG1]
Posts: 9
Joined: Tue Aug 13, 2024 10:29 am

Re: Upgrade transition issues

Post by mynameis[ORIG1] »

@DoubleDoubleA or whoever,

How would I go about doing that? This would be my first time putting a ticket into support.
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: Upgrade transition issues

Post by snapier3 »

Couple of things that can be amiss with the XI instance that can cause this.

1. Double check that your sudoers file is up to date with the Nagios aliases, commands and permissions.
2. Check that nagios.cmd file is being written when you're applying changes, restarting nagios core.
3. If you're using a ram disk and passive checks make sure the available volume of the ram disk is appropriate.
4. If you haven't yet upgraded to XI2024R1.2.X and are using a max check attempt of 3, either change this or upgrade.

--SN
mynameis[ORIG1]
Posts: 9
Joined: Tue Aug 13, 2024 10:29 am

Re: Upgrade transition issues

Post by mynameis[ORIG1] »

Snapier3,

1.) The sudoer file seems to work when I run the following code below. This follows what I mentioned above in the link: https://support.nagios.com/kb/article/n ... d-533.html

Code: Select all

sed -i 's/^Defaults    requiretty/#Defaults    requiretty/g' /etc/sudoers
cat /tmp/nagiosxi.sudoers >> /etc/sudoers
chmod 440 /etc/sudoers
This adds this to the /etc/sudoers despite me getting a parsing issue when I push it to puppet. Yes, I know puppet is a different issue all together. I know I'm not going to get support here for that, unless it's out of y'all's own free will.

I should note I turn off puppet, and this helps improve the system components. So I know this is the fix for my system component issue, it's just figuring out how the host will accept the /etc/sudoers without complaining about a parser issue despite me copying and pasting the file in puppet :cry: . Again, I know that's not a nagios support issue, just a me issue. That's why I said what I said above :D .

Code: Select all

User_Alias      NAGIOSXI=nagios
User_Alias      NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/scripts/components/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/scripts/send_to_nls.php *
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/scripts/migrate/migrate.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/components/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_ssl_config.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/scripts/components/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/components/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
2.) I'm running a tail -f on the nagios.cmd file, but not seeing anything. Granted it looks like it's some sort of FIFO file you are talking about.
3.) We are using more RAM then our previous i Installation, so I would imagine that wouldn't be the issue.
4.) I'll have to ask if upgrading it will be okay. Can you tell me how updating might fix the issue? Is my issue a bug in NAGIOS XI 2024R1.1.2?
DoubleDoubleA
Posts: 123
Joined: Thu Feb 09, 2017 5:07 pm

Re: Upgrade transition issues

Post by DoubleDoubleA »

Hi @mynameis[ORIG1],

To put in a support ticket, please visit https://answerhub.nagios.com/support/s/ .

This forum is officially community support, though the Nagios dev team are frequent commenters here. As a rule Nagios staffers on the forum don't get too much into troubleshooting in situations where working with support is likely a better and faster outcome for everyone, though of course community members may comment, as has already been the case here.

Aaron
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: Upgrade transition issues

Post by snapier3 »

4.) I'll have to ask if upgrading it will be okay. Can you tell me how updating might fix the issue? Is my issue a bug in NAGIOS XI 2024R1.1.2?
There were several (lots even) fixes in 1.1.3 but there was a regression bug that is handled in 1.1.4.

Take a look at the change log;
https://www.nagios.com/changelog/
mynameis[ORIG1]
Posts: 9
Joined: Tue Aug 13, 2024 10:29 am

Re: Upgrade transition issues

Post by mynameis[ORIG1] »

Looks like we are upgrading it.

I'm going to close this ticket since we found the issue. I'll write what we found for future people.

When digging more in

Code: Select all

journalctl -xu nagios
we found that the nagios user was being asked for credentials when trying to restarting various services with systemctl. So this was the right fix to update the sudoers file: https://support.nagios.com/kb/article/n ... d-533.html, that file I mentioned above in the comments. There was just more work that needed to be involved.

What also needed to change were two lines in /usr/local/nagiosxi/scripts/restart_nagios_with_export.sh. Line 48 needed to be uncommented while line 49 needed to be commented. The only difference between those two lines were an extra word "sudo". When that was uncommented, everything worked!

This is an example of the two lines changed correctly.

Code: Select all

48: sudo $BASEDIR/manage_services.sh restart nagios
49: #$BASEDIR/manage_services.sh restart nagios
The errors I was getting after I clicked apply config and the #/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg were basically just a unhelpful rabbit trail.
Post Reply