Page 1 of 1

Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 12:52 pm
by toneyc
I attempted to "applyconfiguration" in the hosts section and got:

-------------------------------------

Code: Select all

Apply Configuration
Configuration import failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
Error: Invalid max_check_attempts value for host 'audadb31'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/audadb31.cfg', starting on line 16)
-------------------------------------

I tried to delete audadb31 and apply the config again but got the same error. I recreated audadb31, still got the same error. I searched this forum and found a post that said go into config file manager, delete files, write files and tail /usr/local/nagiosxi/var/cmdsubsys.log. Here is the output:

-------------------------------------

Code: Select all

# tail -F /usr/local/nagiosxi/var/cmdsubsys.log
PROCESSING COMMAND ID 21...
PROCESS COMMAND: CMD=1150, DATA=remove
CMDLINE=php /usr/local/nagiosxi/html/includes/components/nagiosbpi/api_tool.php --cmd=syncall
CMD: syncall
MSG: BPI configuration applied successfully! BPI configuration applied successfully!
OUTPUT=MSG: BPI configuration applied successfully! BPI configuration applied successfully!
RETURNCODE=0
..............................................................
PROCESSED 1 COMMANDS
..........................................................
PROCESSED 0 COMMANDS
.PROCESSING COMMAND ID 22...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified

Resetting configuration permissions failed!
OUTPUT=Resetting configuration permissions failed!
RETURNCODE=3
PROCESSING COMMAND ID 23...
PROCESS COMMAND: CMD=1150, DATA=remove
CMDLINE=php /usr/local/nagiosxi/html/includes/components/nagiosbpi/api_tool.php --cmd=syncall
CMD: syncall
MSG: BPI configuration applied successfully! BPI configuration applied successfully!
OUTPUT=MSG: BPI configuration applied successfully! BPI configuration applied successfully!
RETURNCODE=0
............................^C
-------------------------------------

Can someone point out what I'm doing wrong, please?

Thanks,
Toney

Re: Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 1:31 pm
by benjaminsmith
Hello Toney,

Once the previous config is restored, are you able to make any changes and successfully apply configuration? For example, without re-creating audadb31, change the Display Name (or other setting ) on a current host or service and try to apply configuration. Is it successful?

If that doesn't work, please run the following commands as root from the terminal and post any errors to the thread. Thanks.

1. Reset config permissions

Code: Select all

/usr/local/nagiosxi/scripts/reset_config_perms.sh
2.Re-run the apply configuration script and post the output.

Code: Select all

cd/usr/local/nagiosxi/scripts/
rm -f reconfigure_nagios.lock
./reconfigure_nagios.sh
3. Check the sudoers file

Code: Select all

grep NAGIOS /etc/sudoers

Re: Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 1:51 pm
by toneyc
Interestingly, the hosts page no longer says I have changes to be applied, but when I click apply configuration, I still get that same error

Code: Select all

An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
Error: Invalid max_check_attempts value for host 'audadb31'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/audadb31.cfg', starting on line 16)
But that file doesn't exist:

Code: Select all

 # ls -l /usr/local/nagios/etc/hosts/audadb31.cfg
ls: cannot access /usr/local/nagios/etc/hosts/audadb31.cfg: No such file or directory
Also, the last thing was to check /etc/sudoers? There is no entry in /etc/sudoers for nagios.

Thanks,
Toney

Re: Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 2:52 pm
by benjaminsmith
Hi Toney,

The error is likely in the running configuration database. Go to Configure > Hosts and search for audadb3 from the search box in the upper right hand corner of the display. Is is there? You should be able to delete/de-activate this or correct the max_check_attempts and apply configuration.

Re: Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 3:32 pm
by toneyc
"No results returned from host table", the file doesn't exist that it is complaining about. Seems like this might be a database issue.

Thanks,
Toney

Re: Invalid max_check_attempts value for host

Posted: Mon Sep 23, 2019 3:51 pm
by benjaminsmith
Hi Toney,

Can you send over you system profile and I can check the logs? Thanks.

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message and then reply to this post to bring it up in the queue.

Re: Invalid max_check_attempts value for host

Posted: Tue Sep 24, 2019 11:12 am
by toneyc
That seemed easy enough, but:

Code: Select all

PROFILE BUILD FAILED
Array
(
)
CODE: 1
Does the "View System Info" give you the same information? That works.

Thanks,
Toney

Re: Invalid max_check_attempts value for host

Posted: Tue Sep 24, 2019 2:15 pm
by lmiltchev
Does the "View System Info" give you the same information? That works.
No, that doesn't contain all of the info we need in order to troubleshoot the issue. Try following the steps, outlined in the KB article below:
https://support.nagios.com/kb/article/n ... d-533.html
then PM the profile.zip to @benjaminsmith.

Re: Invalid max_check_attempts value for host

Posted: Tue Sep 24, 2019 5:01 pm
by toneyc
That procedure seems to have solved the issue, thanks!

Re: Invalid max_check_attempts value for host

Posted: Wed Sep 25, 2019 8:45 am
by lmiltchev
Great! So you were able to send the profile.zip to @benjaminsmith, correct?