NagiosXI CCM Overwriting Service Hosts With Nothing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
pcappell
Posts: 29
Joined: Tue Jul 28, 2020 2:43 pm

NagiosXI CCM Overwriting Service Hosts With Nothing

Post by pcappell »

Hello,

I am experiencing an interesting issue in my test NagiosXI instance running 2024R1.1.5 migrated from RHEL7 to RHEL9. I have also ran the repair script that is supposed to be ran after performing this migration.

When I am modifying a host, if I save any kind of changes, all hosts and host groups are removed from the service, and Nagios reports an issue with a missing hostname or description for the .cfg file.

This is preventing us from moving forward with migration in our other environments.

I have tried the repair databases script a few times in, verified SELinux is disabled, and spent several hours trying to determine at which point in the application, when the "Save" button is pressed, that NagiosXI thinks the hosts/host groups should be zeroed out.

At this point, I have a PHP file that can be included once in any of the PHP files, and I have traced this down to the SQL statement generated by hostservice.inc.php file located in , but I cannot figure out what the root cause is.

Does anyone have some clever ideas, or maybe an idea of whats happening?

I have had to remove paths from this post as the Cloudflare WAF protecting the forums is not allowing me to post this otherwise.

Thank you!
Paul
DoubleDoubleA
Posts: 272
Joined: Thu Feb 09, 2017 5:07 pm

Re: NagiosXI CCM Overwriting Service Hosts With Nothing

Post by DoubleDoubleA »

Hi @pcappell,

I'll take a look at the path issue. Perhaps Cloudflare added something I'm not aware of recently, I'm reasonably certain I have/posted/path-like.txt before.

Anyway, might you post the path with perhaps dot separators or space separation within quotes some other means?

Thanks,

Aaron
pcappell
Posts: 29
Joined: Tue Jul 28, 2020 2:43 pm

Re: NagiosXI CCM Overwriting Service Hosts With Nothing

Post by pcappell »

Let's give paths another try

"At this point, I have a debug PHP file that can be included once in any of the PHP files, called ccm_debug_log.php, and I have traced this down to the SQL statement generated by /usr/local/nagiosxi/html/includes/components/ccm/includes/hostservice.inc.php file, but I cannot figure out what the root cause is."

Some additional context, within that SQL statement generated by /usr/local/nagiosxi/html/includes/componenets/ccm/includes/hostservice.inc.php, there is a host_name field that is always set to 1.
DoubleDoubleA
Posts: 272
Joined: Thu Feb 09, 2017 5:07 pm

Re: NagiosXI CCM Overwriting Service Hosts With Nothing

Post by DoubleDoubleA »

Hi @pcappell,

Digging into this, the issue is deeper than Nagios staff would troubleshoot on the forum, and we'd point you to open a support ticket, which I believe you have available. The Nagios dev team staffs the support forum, and while the support team will likely ask the dev team for some input on the support ticket, they are the right team to get the troubleshooting done.

Of course, a community member may chime in here.

Aaron
pcappell
Posts: 29
Joined: Tue Jul 28, 2020 2:43 pm

Re: NagiosXI CCM Overwriting Service Hosts With Nothing

Post by pcappell »

I was able to resolve this issue without submitting a ticket.

If someone encounters this issue in the future, there may be an issue with your nagiosql.tbl_lnkServiceToHost and nagiosql.tbl_lnkServiceToHostgroup table schema.

Through SQL debugging by setting SET GLOBAL general_log = 'ON'; in mysql, I found that INSERT statements into these tables when clicking save in a service object contained 2 variables, while the table expected 3; column "exclude" was the missing variable. Normally this shouldn't be an issue, but the table schema was set to default "exclude" to NULL.

Changing the "exclude" column from NULL to tinyint(1) with a default of 0 resolved the issue.

Be sure to turn off debug logging when you're done! SET GLOBAL general_log = 'OFF';
DoubleDoubleA
Posts: 272
Joined: Thu Feb 09, 2017 5:07 pm

Re: NagiosXI CCM Overwriting Service Hosts With Nothing

Post by DoubleDoubleA »

Thanks for the update!
Locked