Unable to write max checks to host config

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Unable to write max checks to host config

Post by peter.zanetti »

Unrelated to my post about a delete script and on a different instance of Nagios in our environment. This Nagios Server is a fresh install. Today I tried to add a single device through Core for testing purposes. After I added it and tried to apply the configuration I got an error.
max check error.PNG
The Max Check attempts for this device is defined as 4.
show max attempt defined.PNG
Any Idea what is causing this error?
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Unable to write max checks to host config

Post by tmcdonald »

Just to get the obvious out of the way, are there any spaces in that field (not 100% sure if this would matter) and are you certain you are looking at the correct host?

Also to clarify, when you say "I tried to add a single device through Core" you are talking about the Core Configuration Manager, right?
Former Nagios employee
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Re: Unable to write max checks to host config

Post by peter.zanetti »

There are no spaces in the field.
It is the only device on the server so I am sure it is the correct one.
Yes I mean Core Configuration Manager.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Unable to write max checks to host config

Post by jdalrymple »

That is a common error, but usually related to having no max_check_attempts defined at all.

Can you find the host in CCM and click the little disk icon and show us the output there?
You do not have the required permissions to view the files attached to this post.
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Re: Unable to write max checks to host config

Post by peter.zanetti »

Here is what that file looks like.

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.3.3
# Date:	      2015-09-02 16:01:34
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
	host_name			cvt3247532
	alias				price checker
	address				cvt3247532
	initial_state			u
	max_check_attempts		4
	check_interval			15
	retry_interval			1
	check_period			24x7
	register			1
	}	

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Unable to write max checks to host config

Post by jdalrymple »

Everything looks fine - obviously.

Can you save that entire config and PM it to me? I'd like to load it into a lab machine and see if I get the same results.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to write max checks to host config

Post by lmiltchev »

Check to see if your php and system time is in sync.

Admin->System Profile

Do you get config errors if you run the "reconfigure_nagios.sh" from the CLI?

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Be sure to check out our Knowledgebase for helpful articles and solutions!
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Re: Unable to write max checks to host config

Post by peter.zanetti »

jdalrymple wrote:Everything looks fine - obviously.

Can you save that entire config and PM it to me? I'd like to load it into a lab machine and see if I get the same results.
What Directory can I copy the file from?
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Re: Unable to write max checks to host config

Post by peter.zanetti »

lmiltchev wrote:Check to see if your php and system time is in sync.

Admin->System Profile

Do you get config errors if you run the "reconfigure_nagios.sh" from the CLI?

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Yes the system time and php time are the same.
Date/Time
PHP Timezone: America/New_York
PHP Time: Thu, 03 Sep 2015 08:14:24 -0400
System Time: Thu, 03 Sep 2015 08:14:24 -0400

Code: Select all

./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.loginnagiosql.login: Permission denied
LOGIN SUCCESSFUL!
NAGIOSQL LOGIN FAILED!
Im not sure if the error is database permissions or because I don't have root access in the command line.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Unable to write max checks to host config

Post by jdalrymple »

Has somebody been fiddling with your mysql databse?

Try this from the command line and share the results:

Code: Select all

mysql -u nagiosxi -pn@gweb nagiosql
Locked