Page 1 of 1

nagiosql_delete_service.php utility to delete single service

Posted: Sat Feb 14, 2015 2:40 pm
by mp4783
The nagiosql_delete_service.php utility does not appear to be working for deletion of a single service.

I execute as follows from the /usr/local/nagios/nagiosxi/scripts directory as the nagios user:

./nagiosql_delete_service.php --id=468

OUTPUT:

URL: http://localhost:8085/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost:8085/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'type=service&cmd=delete&id=468' -O nagiosql.delete.service
--2015-02-14 19:24:41-- http://localhost:8085/nagiosxi/includes/components/ccm/
Resolving one.proxy.att.com... 135.28.13.11
Connecting to one.proxy.att.com|135.28.13.11|:8080... connected.
Proxy request sent, awaiting response... 407 Proxy Authentication Required
2015-02-14 19:24:41 ERROR 407: Proxy Authentication Required.

1 services deleted successfully!
--------------------------------------------------------------------

I then execute execute reconfigure_nagios.sh. After this completes, I check the GUI for the service and it is still there, even after waiting for a few minutes and logging in and out.

I tried a suggested solution which replaced the following files with http://support.nagios.com/forum/downloa ... hp?id=5439 and http://support.nagios.com/forum/downloa ... hp?id=5430:
delete_object.inc.php
nagiosql_delete_contact.php
nagiosql_delete_host.php
nagiosql_delete_service.php
nagiosql_delete_timeperiod.php

Nothing changed, so I restored the originals.

I realize the document on automated host management doesn't reference the "--id" option, but it did report as successful. How do I delete a single service? I can think of one way, but it would require removing all services for a host, reconfiguring Nagios, and then importing a modified service definition file. This would, I assume, result in the lost of all state and history for the services that were to remain. It would also require a second reconfiguration of Nagios.

Re: nagiosql_delete_service.php utility to delete single ser

Posted: Sun Feb 15, 2015 4:04 pm
by mp4783
Well, now it seems to be working consistently, though I've no idea what might have changed because the command sequence is pretty simple.

Nevertheless, I'll monitor behavior and post again if it fails.

Re: nagiosql_delete_service.php utility to delete single ser

Posted: Mon Feb 16, 2015 9:17 am
by lmiltchev
Let us know if it fails again. BWT, I see you are using a proxy. Did you configure it according to our recommendation posted on our FAQ wiki page?

http://support.nagios.com/wiki/index.ph ... th_Proxies

Perhaps, your problem was related to improperly configured proxy.