hostgroup empties on modification
-
marquetteu
- Posts: 47
- Joined: Tue Nov 13, 2012 12:08 pm
hostgroup empties on modification
we are using xi 5.7.1 on rhel 8 64 bit. It is a manual install using ssl.
we have hostgroups setup and in the host group we add hosts. When i add a new host all hosts from the hostgroup get deleted.
looking at /usr/local/nagios/etc/hostgroups.cfg also shows that all hosts are removed from the group when i try to add another host.
we have hostgroups setup and in the host group we add hosts. When i add a new host all hosts from the hostgroup get deleted.
looking at /usr/local/nagios/etc/hostgroups.cfg also shows that all hosts are removed from the group when i try to add another host.
Re: hostgroup empties on modification
I did a quick test by adding a host to a HostGroup and the existing hosts were not removed from the group.
I have question, are you adding Hosts to a HostGroup or are you adding a HostGroup to a Host?
The reason I ask is if you add a HostGroup to a Host, you will not see the host in the hostgroup.cfg file but if you look at the host.cfg file, in the /usr/local/nagios/etc/hosts folder, you will see the Hostgroup there.
When the Apply Config is ran, that builds the linkage between the Hosts and Hostgroups for the running config.
If you go to the Home > Hostgroup Grid menu and look at the HostGroup, do you see all of the Hosts?
Another cause is an config error. When there is a config error, the system reverts back to the latest known good snapshot which does not have the hosts in the group.
To verify the configs are good and in sync, login to the XI GUI and go to the Core Config Manager
Under "Tools", click "Write Config Files" or if you are running a newer versions of XI, The menu is called "Config File Management"
Click on the "Write" button, then the "Delete" button then click the "Write" button and then the "Verify" button.
If you get any errors, resolve them and click on the "Delete" button, "Write", "Verify" until all of the errors are resolved.
Click the Apply Configuration link and click the "Apply Configuration" button after ALL of the errors are resolved.
Then try adding a Host to a HostGroup and see if the issue still happens.
I have question, are you adding Hosts to a HostGroup or are you adding a HostGroup to a Host?
The reason I ask is if you add a HostGroup to a Host, you will not see the host in the hostgroup.cfg file but if you look at the host.cfg file, in the /usr/local/nagios/etc/hosts folder, you will see the Hostgroup there.
When the Apply Config is ran, that builds the linkage between the Hosts and Hostgroups for the running config.
If you go to the Home > Hostgroup Grid menu and look at the HostGroup, do you see all of the Hosts?
Another cause is an config error. When there is a config error, the system reverts back to the latest known good snapshot which does not have the hosts in the group.
To verify the configs are good and in sync, login to the XI GUI and go to the Core Config Manager
Under "Tools", click "Write Config Files" or if you are running a newer versions of XI, The menu is called "Config File Management"
Click on the "Write" button, then the "Delete" button then click the "Write" button and then the "Verify" button.
If you get any errors, resolve them and click on the "Delete" button, "Write", "Verify" until all of the errors are resolved.
Click the Apply Configuration link and click the "Apply Configuration" button after ALL of the errors are resolved.
Then try adding a Host to a HostGroup and see if the issue still happens.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
marquetteu
- Posts: 47
- Joined: Tue Nov 13, 2012 12:08 pm
Re: hostgroup empties on modification
I am trying to add a host to a hostgroup.
When i got to home->hostgroup grid i see just an empty hostgroup.
I did the write, delete, write, verify, apply and there were no errors.
After doing all the above, i add a host to a hostgroup, click save, then click apply configuration and it does not error, but when i go to the hostgroup grid or the hostgroup in the core config manager both are empty
When i got to home->hostgroup grid i see just an empty hostgroup.
I did the write, delete, write, verify, apply and there were no errors.
After doing all the above, i add a host to a hostgroup, click save, then click apply configuration and it does not error, but when i go to the hostgroup grid or the hostgroup in the core config manager both are empty
Re: hostgroup empties on modification
Run this and post the output here so we can see which version of MYSQL it running on the server.
If you installed a version of MariaDB on the server that did not come with RHEL8, you may have to adjust some MYSQL settings. See this KB article.
https://support.nagios.com/kb/article/n ... s-780.html
Can you login to the XI server as root and run this command,
Then login to the XI GUI and Apply the configuration and post the output of the tail command so we can see if there are any errors when the configs are saved.
Code: Select all
mysql -Vhttps://support.nagios.com/kb/article/n ... s-780.html
Can you login to the XI server as root and run this command,
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.logBe sure to check out our Knowledgebase for helpful articles and solutions!
-
marquetteu
- Posts: 47
- Joined: Tue Nov 13, 2012 12:08 pm
Re: hostgroup empties on modification
Code: Select all
# mysql -V
mysql Ver 8.0.17 for Linux on x86_64 (Source distribution)
# yum list installed mysql-server
Updating Subscription Management repositories.
Installed Packages
mysql-server.x86_64 8.0.17-3.module+el8.0.0+3898+e09bb8de @rhel-8-for-x86_64-appstream-rpms
Code: Select all
........................PROCESSING COMMAND ID 403...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
No files to import
--------------------------------------
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Finished writing out configuraton
--------------------------------------
--------------------------------------
> Verifying configuration with Nagios Core
> Output:
Nagios Core 4.4.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2020-04-28
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 342 services.
Checked 49 hosts.
Checked 8 host groups.
Checked 0 service groups.
Checked 4 contacts.
Checked 2 contact groups.
Checked 147 commands.
Checked 11 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 49 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 11 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
> Return Code: 0
--------------------------------------
OUTPUT=--------------------------------------
RETURNCODE=0
PROCESSING COMMAND ID 404...
PROCESS COMMAND: CMD=1160, DATA=
CMDLINE=/bin/true
OUTPUT=
RETURNCODE=0
PROCESSING COMMAND ID 405...
PROCESS COMMAND: CMD=1150, DATA=remove
CMDLINE=php /usr/local/nagiosxi/html/includes/components/nagiosbpi/api_tool.php --cmd=syncall
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/local/nagiosxi/html/includes/components/nagiosbpi/classes/BpGroup_class.php on line 837
CMD: syncall
MSG: BPI configuration applied successfully! BPI configuration applied successfully!
OUTPUT=MSG: BPI configuration applied successfully! BPI configuration applied successfully!
RETURNCODE=0
Re: hostgroup empties on modification
Run the following as root to change the strict trans settings for the nagiosql database.
Run the following to restart the processes.
See if the issue is resolved.
Code: Select all
echo "SET @@SQL_MODE = REPLACE(@@SQL_MODE,'STRICT_TRANS_TABLES', '');" | mysql -u root -pnagiosxi nagiosql
echo "SET @@GLOBAL.SQL_MODE = REPLACE(@@GLOBAL.SQL_MODE,'STRICT_TRANS_TABLES', '');" | mysql -u root -pnagiosxi nagiosql
echo "SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;" | mysql -u root -pnagiosxi nagiosqlCode: Select all
service nagios stop
service ndo2db stop
service mysqld restart
service httpd restart
service ndo2db start
service nagios startBe sure to check out our Knowledgebase for helpful articles and solutions!
-
marquetteu
- Posts: 47
- Joined: Tue Nov 13, 2012 12:08 pm
Re: hostgroup empties on modification
did all the steps successfully but the problem is still the same
Re: hostgroup empties on modification
Could you post or PM your Nagios XI System Profile to me so we can review it?
To get 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 upload it to the forum post or PM it to me.
I will also need the name of the Hostgroup and the names of the Hosts you are adding to it.
Thanks
To get 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 upload it to the forum post or PM it to me.
I will also need the name of the Hostgroup and the names of the Hosts you are adding to it.
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: hostgroup empties on modification
Can you get the following log file and post it?
Also, edit the HostGroup in the CCM and add the hosts to it but do not apply the config.
Run this as root
And post the /tmp/nagiosql.txt file.
I will also need the name of the Hostgroup and the names of the Hosts you are adding to it.
Code: Select all
/var/log/mysql/mysqld.logRun this as root
Code: Select all
mysqldump nagiosql -u root -pnagiosxi >/tmp/nagiosql.txtI will also need the name of the Hostgroup and the names of the Hosts you are adding to it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
marquetteu
- Posts: 47
- Joined: Tue Nov 13, 2012 12:08 pm
Re: hostgroup empties on modification
mysql dump has been pm'ed to you. the mysqld.log file is empty. the hostname is its-netvmprod1.
one thing i noticed is that after adding the host and clicking save, that is when the host group would empty itself
one thing i noticed is that after adding the host and clicking save, that is when the host group would empty itself