Invalid max_check_attempts value for host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
toneyc
Posts: 5
Joined: Wed Aug 21, 2019 9:37 am
Location: Austin, TX

Invalid max_check_attempts value for host

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Invalid max_check_attempts value for host

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
toneyc
Posts: 5
Joined: Wed Aug 21, 2019 9:37 am
Location: Austin, TX

Re: Invalid max_check_attempts value for host

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Invalid max_check_attempts value for host

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
toneyc
Posts: 5
Joined: Wed Aug 21, 2019 9:37 am
Location: Austin, TX

Re: Invalid max_check_attempts value for host

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Invalid max_check_attempts value for host

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
toneyc
Posts: 5
Joined: Wed Aug 21, 2019 9:37 am
Location: Austin, TX

Re: Invalid max_check_attempts value for host

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Invalid max_check_attempts value for host

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
toneyc
Posts: 5
Joined: Wed Aug 21, 2019 9:37 am
Location: Austin, TX

Re: Invalid max_check_attempts value for host

Post by toneyc »

That procedure seems to have solved the issue, thanks!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Invalid max_check_attempts value for host

Post by lmiltchev »

Great! So you were able to send the profile.zip to @benjaminsmith, correct?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked