Ghost host(s)/ db corruption? - Cannot apply configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
phamanth
Posts: 13
Joined: Tue Jan 28, 2020 10:57 am

Ghost host(s)/ db corruption? - Cannot apply configuration

Post by phamanth »

Have an issue with a ghost host. Applying configuration errors out stating that host has invalid max_check_attempts. Even, after deleting host from front end and back end, recreating the host, verify configuration, delete configuration, verify config have all proved failures and the error still shows up.


Error: Invalid max_check_attempts value for host
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/.cfg', starting on line 16)

I resolved this temporarily by rolling back to a previous configuration before the error had occurred as far as I know. Recreated the hosts and it worked for about a week.

Unsure if related, but the issue seems to start up after I have been using the linux snmp wizard, after attempting to add new host (unrelated to the ones that throw the error), the same invalid configuration shows up for the host (described in the beginning) that was deleted and recreated. Which leads me to believe something in the database is bringing back the error.

Please assist. Thank you for your time and assistance.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by gsmith »

Hi,

Please dump the nagiosql db:

Code: Select all

mysqldump -uroot -pnagiosxi nagiosql > /tmp/nagiosql.dump
Then share the file in a private message and reply to this post as this will
bring it up in the queue which will make us aware the file has been uploaded.

Thanks
phamanth
Posts: 13
Joined: Tue Jan 28, 2020 10:57 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by phamanth »

PM sent. Bumping post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by gsmith »

Hi,

Thanks for the db file, I was able to load it successfully.

Can you please tell me which host is causing the problems?

You can tell me in a PM if you want to keep the hostname private.

Thanks
phamanth
Posts: 13
Joined: Tue Jan 28, 2020 10:57 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by phamanth »

agofusqazoo02 and agofusqazoo03. These were the ones that would say they had the max_check_attempts parameter blank and could not read the host cfg file. However, even after removing these completely through deleting through the UI as well as rm -f in the backend to the host cfg file, the error would still show up when trying to apply configuration and even if the hosts did not exist, which leads me to believe some sort of db issue.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by gsmith »

Hi

Could you please try the following and let me know the results:

Code: Select all

Choose Configure, Core Config Manager
Under Tools in the left-hand menu select Config File Management
Hit the "Delete Files" (red) button - it's OK to do this
Hit the "Write Configs" (blue) button
Optional but informative - hit the "Verify Files" (white button)
In the left-hand menu under Quick Tools select Apply Configuration
Click the "Apply Configuration" (blue) button
If that doesn't solve anything then I will do what you did:
removing these completely through deleting through the UI as well as rm -f in the backend to the host cfg file
and then I will look through the database.

Thanks
phamanth
Posts: 13
Joined: Tue Jan 28, 2020 10:57 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by phamanth »

Already did that previously but did it again. Same thing: Delete, write, verify configuration all say successful. Then, when applying configuration, the same max_interval_checks errors for the same host(s) whether it exists are not still popping up.

The last time I was able to "fix" was to rollback to a configuration from a previous week and recreated the error-laden hosts. Configuration was able to apply. Worked well until (not sure if related) I added a linux snmp device from the configuration wizard. After trying to create and apply configuration, the error popped up again for the ghost host.

Please look into the db and what can be done to fix this corruption. Thank you.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by ssax »

Please run this tail command (and leave it running):

Code: Select all

tail -Fn0 /usr/local/nagiosxi/var/cmdsubsys.log
Then try to apply configuration through the web interface and once it errors send us the full output from the tail command above.

Please PM (Private Message) one of us a copy of your profile.zip as well, you can download it from Admin > System Profile by clicking the Download Profile button.
phamanth
Posts: 13
Joined: Tue Jan 28, 2020 10:57 am

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by phamanth »

Requested files sent in PM.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ghost host(s)/ db corruption? - Cannot apply configurati

Post by ssax »

While not likely related, I see this:
PHP Warning: file_put_contents(/usr/local/nagiosxi/var/components/auditlog.log): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/utils-auditlog.inc.php on line 145
What is the output of this command?

Code: Select all

ls -l /usr/local/nagiosxi/var/components/auditlog.log
The actual issue:

Code: Select all

> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
  - Importing: /usr/local/nagios/etc/import/VvsmFseU.tmp.cfg .. ERROR
   Duplicate entry 'agoxxxxxxr01.xxxxx.org-1' for key 'config_name'Entry host_name::agoxxxxxxr01.xxxxx.org inside tbl_host could not be inserted: 1<br>
Try removing the files from /usr/local/nagios/etc/import, Apply Configuration, and let us know the results:

Code: Select all

rm -rf /usr/local/nagios/etc/import/*.cfg
I would also upgrade to XI 5.8.7 when you get a chance to get the latest NDO3 fixes.
Locked