Page 1 of 1
Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Tue Jun 17, 2014 10:08 am
by mrochelle
After upgrading several of my Nagios servers to Nagios XI 2014R1.1, I noticed that my automated host management was no longer performing the auto deletes. The adds appear to be working fine. I have manually walked through the steps using the commands:
/usr/local/nagiosxi/scripts/nagiosql_delete_service.php --config=<config_name>
/usr/local/nagiosxi/scripts/nagiosql_delete_host.php --host=<config_name>
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
and things appear to be ok. I'm attaching the output for reference. You thoughts are appreciated,
Marcus
Automated_Host_Management.txt
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Tue Jun 17, 2014 12:22 pm
by lmiltchev
I was able to recreate the issue. It is possible that this is caused by the changes we made in apply configuration logic.
We will have to do some more digging into this. We will let you know when we have a possible fix/workaround.
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Tue Jun 17, 2014 12:28 pm
by mrochelle
NP, Thanks for the quick follow up.
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Wed Jun 18, 2014 11:12 am
by lmiltchev
Follow the stops, outlined here:
http://support.nagios.com/forum/viewtop ... 12#p102512
This will fix your issue with the Automated Host Management (deleting hosts).
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Wed Jun 18, 2014 1:02 pm
by mrochelle
I followed the indicated steps in the reference post. Downloaded and unzip both indicated zips in appropriate locations and no change with the problem.
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Wed Jun 18, 2014 4:22 pm
by lmiltchev
We tested the patches numerous times and they worked in our environment... Can you show us the commands that you are running from the command line, in order to add hosts and services, along with the output of them?
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Thu Jun 19, 2014 8:44 am
by mrochelle
Attached you will find a response file which I have included the directory listings for the updates for your review to be sure I have them install and the commands and output. Let me know what you find.

The commands are in order of execution:
./nagiosql_delete_service.php --config=KC_1806 >> AHC_response.txt
./nagiosql_delete_service.php --config=KC_1808 >> AHC_response.txt
./nagiosql_delete_host.php --host=KC_1806 >> AHC_response.txt
./nagiosql_delete_host.php --host=KC_1808 >> AHC_response.txt
./reconfigure_nagios.sh >> AHC_response.txt
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Thu Jun 19, 2014 2:46 pm
by lmiltchev
I wonder if the "nagiosql_delete_service.php" script actually deleted the services on this host from the database... as you have:
Unable to delete host KC_1806. Host has dependent relationships
Let's find out if this is indeed what's failing. Add a brand new test host with some services as you normally would. Next, try to remove the services on this host from the database:
Code: Select all
./nagiosql_delete_service.php --config=<config name>
Do not apply configuraiton (do not run "./reconfigure_nagios.sh"). Go to the CCM and check to see if the services have been deleted.
One more thing... When you create your hosts + services from the CLI, do you use the SAME config name as the host name? For example:
1. Placing the
hostA.cfg file in the "/usr/local/nagios/etc/import/" directory:
define host{
host_name hostA
address 127.0.0.1
use xiwizard_generic_host
}
define service{
host_name hostA
service_description Ping
use xiwizard_website_ping_service
}
2. Running "./reconfigure_nagios.sh".
3. Deleting the service.
./nagiosql_delete_service.php --config=hostA
4. Deleting the host.
./nagiosql_delete_host.php --host=hostA
Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Fri Jun 20, 2014 7:50 am
by mrochelle
Yes, when I create the service, the config name is the same as the host name. Also, keep in mind, this automation worked prior to the NagiosXI 2014 upgrade. I performed the test you requested and the ./nagiosql_delete_service.php --config=<config name> is not working. The test service on the test host I created was not deleted.
I also created and attempted the same with a host only and no service. The ./nagiosql_delete_host.php --host=KC_TEST2 did not remove the host. So it appears neither command is working for me.

Re: Nagios XI 2014 - Auto Deletes Stopped Working
Posted: Fri Jun 20, 2014 12:34 pm
by abrist
mrochelle: Could you open a ticket by sending an email to
[email protected]? I would like to set up a remote to look into and solve this issue.