I am trying to add a new server to be monitored and I get the error below.
Error: Invalid max_check_attempts value for host ''server_x'. Error: Could not register host (config file '/usr/local/nagios/etc/hosts/server_x.cfg', starting on line 16).
server_x was removed from Nagios several weeks ago, and I have been able to make configuration changes since this server was removed. The config file /usr/local/nagios/etc/hosts/server_x.cfg does not exist.
Any help would be appreciated!
Invalid max_check_attempts value for host
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Invalid max_check_attempts value for host
As for the error itself, I've never seen the issue reported in that output to be wrong. To see what the file looks like that is causing this issues, please try the following:
XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs
From there you can open the file in question and look at the line number given in the error. This object is the problem. You can fix its assigned hosts/service description/max_check_attempts in the CCM. You can find it like so:
XI > Configure > Core Config Manager > Services > [yourserviceshowninthefile] > yoursetting
XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs
From there you can open the file in question and look at the line number given in the error. This object is the problem. You can fix its assigned hosts/service description/max_check_attempts in the CCM. You can find it like so:
XI > Configure > Core Config Manager > Services > [yourserviceshowninthefile] > yoursetting
Previous Nagios employee
-
garrett320
- Posts: 7
- Joined: Thu Apr 27, 2017 11:44 am
Re: Invalid max_check_attempts value for host
I am now seeing this error
While trying to add a new host
SSH Proxy Monitoring Wizard
Backend login to the Core Config Manager failed.
Configuration Error
An error occurred while attempting to apply your configuration to the monitoring engine. Contact your Nagios administrator if this problem persists.
Run this monitoring wizard again
Run another monitoring wizard
View the latest configuration snapshots
When I tried to delete services no longer being monitored I received the following error
Apply Configuration
Backend login to the Core Config Manager 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.
While trying to add a new host
SSH Proxy Monitoring Wizard
Backend login to the Core Config Manager failed.
Configuration Error
An error occurred while attempting to apply your configuration to the monitoring engine. Contact your Nagios administrator if this problem persists.
Run this monitoring wizard again
Run another monitoring wizard
View the latest configuration snapshots
When I tried to delete services no longer being monitored I received the following error
Apply Configuration
Backend login to the Core Config Manager 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.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Invalid max_check_attempts value for host
Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically. The most important file here is going to be the config.inc.php
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
Also, it's possible you are out of space and/or have database corruption.
What's the output of the following?
It's possible you are out of space.
Please run through https://assets.nagios.com/downloads/nag ... tabase.pdf and report any errors. If you stop at any point, please know at which point you stop. If there's any output you need to give us, Please put the output in a code block. The button is the fifth from the left on the post input screen (between Quote and List).
If the repair script and other instructions in the document do not work, please continue.
Regarding the instructions below, if you do not have killall, you can install it via the following command:
If psmisc is not in your repos, then instead you can check to make sure nagios is not running with
If that document does not resolve your issue, please run the following commands in order and report any errors. You must use mariadb instead of mysqld in this case, if you have mariadb.
UPDATE: Profile received and shared with techs
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
Also, it's possible you are out of space and/or have database corruption.
What's the output of the following?
Code: Select all
df -i
df -hPlease run through https://assets.nagios.com/downloads/nag ... tabase.pdf and report any errors. If you stop at any point, please know at which point you stop. If there's any output you need to give us, Please put the output in a code block. The button is the fifth from the left on the post input screen (between Quote and List).
If the repair script and other instructions in the document do not work, please continue.
Regarding the instructions below, if you do not have killall, you can install it via the following command:
Code: Select all
yum install psmiscCode: Select all
ps -aef | grep nagiosCode: Select all
service nagios stop
service ndo2db stop
service mysqld stop
service crond stop
service httpd stop
killall -9 nagios
killall -9 ndo2db
rm -f /usr/local/nagios/var/ndo.sock
rm -f /usr/local/nagios/var/ndo2db.lock
service ndo2db start
service nagios start
service mysqld start
service crond start
service httpd start
Last edited by dwhitfield on Thu May 18, 2017 9:33 am, edited 1 time in total.
Reason: profile received
Reason: profile received
-
garrett320
- Posts: 7
- Joined: Thu Apr 27, 2017 11:44 am
Re: Invalid max_check_attempts value for host
Disk space is ok
[Nagios ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv 10G 151M 9.9G 2% /
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 2.9G 4.0K 2.9G 1% /dev/shm
tmpfs 2.9G 249M 2.6G 9% /run
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 10G 4.2G 5.9G 42% /usr
/dev/sda1 509M 178M 332M 35% /boot
/dev/mapper/rootvg-optlv 30G 14G 17G 45% /opt
/dev/mapper/rootvg-homelv 5.0G 56M 5.0G 2% /home
/dev/mapper/rootvg-varlv 5.0G 986M 4.1G 20% /var
/dev/mapper/rootvg-var_loglv 5.0G 820M 4.2G 17% /var/log
/dev/mapper/rootvg-tmplv 5.0G 112M 4.9G 3% /tmp
tmpfs 580M 0 580M 0% /run/user/54323
tmpfs 580M 0 580M 0% /run/user/54322
[Nagios ~]$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/rootvg-rootlv 5242880 3396 5239484 1% /
devtmpfs 738565 397 738168 1% /dev
tmpfs 741242 2 741240 1% /dev/shm
tmpfs 741242 702 740540 1% /run
tmpfs 741242 16 741226 1% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 5242880 133319 5109561 3% /usr
/dev/sda1 262144 336 261808 1% /boot
/dev/mapper/rootvg-optlv 15728640 34938 15693702 1% /opt
/dev/mapper/rootvg-homelv 2621440 759 2620681 1% /home
/dev/mapper/rootvg-varlv 2621440 9875 2611565 1% /var
/dev/mapper/rootvg-var_loglv 2621440 190 2621250 1% /var/log
/dev/mapper/rootvg-tmplv 2621440 3732 2617708 1% /tmp
tmpfs 741242 1 741241 1% /run/user/54323
tmpfs 741242 1 741241 1% /run/user/54322
No errors were reported during the DB repair.
I did get this error trying to stop MySQL
[root@Nagios ~]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service
Failed to stop mysqld.service: Unit mysqld.service not loaded.
[Nagios ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv 10G 151M 9.9G 2% /
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 2.9G 4.0K 2.9G 1% /dev/shm
tmpfs 2.9G 249M 2.6G 9% /run
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 10G 4.2G 5.9G 42% /usr
/dev/sda1 509M 178M 332M 35% /boot
/dev/mapper/rootvg-optlv 30G 14G 17G 45% /opt
/dev/mapper/rootvg-homelv 5.0G 56M 5.0G 2% /home
/dev/mapper/rootvg-varlv 5.0G 986M 4.1G 20% /var
/dev/mapper/rootvg-var_loglv 5.0G 820M 4.2G 17% /var/log
/dev/mapper/rootvg-tmplv 5.0G 112M 4.9G 3% /tmp
tmpfs 580M 0 580M 0% /run/user/54323
tmpfs 580M 0 580M 0% /run/user/54322
[Nagios ~]$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/rootvg-rootlv 5242880 3396 5239484 1% /
devtmpfs 738565 397 738168 1% /dev
tmpfs 741242 2 741240 1% /dev/shm
tmpfs 741242 702 740540 1% /run
tmpfs 741242 16 741226 1% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 5242880 133319 5109561 3% /usr
/dev/sda1 262144 336 261808 1% /boot
/dev/mapper/rootvg-optlv 15728640 34938 15693702 1% /opt
/dev/mapper/rootvg-homelv 2621440 759 2620681 1% /home
/dev/mapper/rootvg-varlv 2621440 9875 2611565 1% /var
/dev/mapper/rootvg-var_loglv 2621440 190 2621250 1% /var/log
/dev/mapper/rootvg-tmplv 2621440 3732 2617708 1% /tmp
tmpfs 741242 1 741241 1% /run/user/54323
tmpfs 741242 1 741241 1% /run/user/54322
No errors were reported during the DB repair.
I did get this error trying to stop MySQL
[root@Nagios ~]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service
Failed to stop mysqld.service: Unit mysqld.service not loaded.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Invalid max_check_attempts value for host
Did you run through the rest of the document? It's strange that no errors were reported in the db log, because your mariadblog has a bunch of crash table warnings. Also, the logs stopped on May 14, which is a bit odd.dwhitfield wrote: You must use mariadb instead of mysqld, if you have mariadb.
You are on 5.4.0, which has some pretty serious bugs. Are you on an offline install? If so, then you are probably fine. Otherwise, I would highly recommend you upgrade to 5.4.4: https://assets.nagios.com/downloads/nag ... nstall.pdf
Did you turn perfdata off? Your logs for that end on April 27 and May 14. I can tell it's a new profile though because of your apache logs.
Again, I'd highly suggest an upgrade, but if that's not possible, what's the output of service npcd status?
-
garrett320
- Posts: 7
- Joined: Thu Apr 27, 2017 11:44 am
Re: Invalid max_check_attempts value for host
We are running in an offline install. I have created a new server running 5.4.4, this can be closed. Thank you for our help.