I have 26 services that are type "unknown". I don't know how they got there but I am unable to delete them using the Nagios XI UI or using the CCM UI. I searched the cfg files - especially services.cfg - but I cannot find them anywhere.
Something odd about these services is that some are for existing hosts and some are for hosts that aren't defined in Nagios XI. Another curiosity is that many of the services are for C: Drive Disk Usage on a Linux host. I'm guessing one of my coworkers did something to create this mess but so far I have not been able to figure out how it was done.
Regardless, I need to know how I can delete these services.
Nagios XI 5.4.6
Services exist that I cannot delete
Services exist that I cannot delete
Last edited by cpss454 on Fri Aug 25, 2017 10:04 am, edited 1 time in total.
-
dwasswa
Re: Services exist that I cannot delete
The Documentation below will guide you in achieving that.
https://assets.nagios.com/downloads/nagiosxi/docs/Using-The-Nagios-XI-Core-Config-Manager-For-Host-Management.pdf
https://support.nagios.com/kb/article.php?id=5
Please let me know if something is unclear or if you have any other questions.
https://assets.nagios.com/downloads/nagiosxi/docs/Using-The-Nagios-XI-Core-Config-Manager-For-Host-Management.pdf
https://support.nagios.com/kb/article.php?id=5
Please let me know if something is unclear or if you have any other questions.
Re: Services exist that I cannot delete
Those documents were no help. As stated in the original post, I am unable to delete the services using either the XI or the CCM UIs.
The services do not appear in the CCM Services list.
The services are shown in the XI Services list but when I try to delete any of them the following message is displayed:
Could not find a unique id for this service
Service cannot be deleted using this method
One or more errors were detected that prevent the service from being deleted.
Possible causes include...
The service is associated with other hosts, services, or objects that need to be deleted first
The service is generated by an advanced monitoring configuration entry
The service is maintained in a static or external configuration file
To resolve this issue...
Use the Nagios Core Configuration Manager to delete the service - or -
Manually delete the service definition from the appropriate external configuration file
None of the methods listed have allowed me to locate the service so I could delete it.
The services do not appear in the CCM Services list.
The services are shown in the XI Services list but when I try to delete any of them the following message is displayed:
Could not find a unique id for this service
Service cannot be deleted using this method
One or more errors were detected that prevent the service from being deleted.
Possible causes include...
The service is associated with other hosts, services, or objects that need to be deleted first
The service is generated by an advanced monitoring configuration entry
The service is maintained in a static or external configuration file
To resolve this issue...
Use the Nagios Core Configuration Manager to delete the service - or -
Manually delete the service definition from the appropriate external configuration file
None of the methods listed have allowed me to locate the service so I could delete it.
-
dwasswa
Re: Services exist that I cannot delete
There is a script in XI that might help see below...
/usr/local/nagiosxi/scripts
cd /usr/local/nagiosxi/scripts/
./nagiosql_delete_service.php --help
output:
Usage: ./nagiosql_delete_service.php [--id=<service id>] [--config=<config_name>]
When you run the script parse service id and config_name as arguments
After the services have successfully been deleted, the host can be removed as well:
./nagiosql_delete_host.php --help
Output:
Usage: ./nagiosql_delete_host [--id=<host id>] [--host=<host_name>]
When you run the script parse host id and host_name as arguments
Once the host is removed, the new configuration can be applied and verified by running the reconfigure_nagios.sh
./reconfigure_nagios.sh
/usr/local/nagiosxi/scripts
cd /usr/local/nagiosxi/scripts/
./nagiosql_delete_service.php --help
output:
Usage: ./nagiosql_delete_service.php [--id=<service id>] [--config=<config_name>]
When you run the script parse service id and config_name as arguments
After the services have successfully been deleted, the host can be removed as well:
./nagiosql_delete_host.php --help
Output:
Usage: ./nagiosql_delete_host [--id=<host id>] [--host=<host_name>]
When you run the script parse host id and host_name as arguments
Once the host is removed, the new configuration can be applied and verified by running the reconfigure_nagios.sh
./reconfigure_nagios.sh
-
kyang
Re: Services exist that I cannot delete
Hi @cpss454,
Are the services connected to any hostgroups or hosts? Usually, if a service can't be deleted it is still tied to something which is why it is says this
https://support.nagios.com/forum/viewto ... =6&t=33973
Try doing this.
Go to Configure -> Core Config Manager, then on the left under Tools click --> Config File Management. Then you have all these options, click Delete, then Write, then Verify, restart Nagios Core then apply configuration.
then go back to deleting the services.
Does this helps?
Are the services connected to any hostgroups or hosts? Usually, if a service can't be deleted it is still tied to something which is why it is says this
Try looking at another related forumThe service is associated with other hosts, services, or objects that need to be deleted first
The service is generated by an advanced monitoring configuration entry
The service is maintained in a static or external configuration file
https://support.nagios.com/forum/viewto ... =6&t=33973
Try doing this.
Go to Configure -> Core Config Manager, then on the left under Tools click --> Config File Management. Then you have all these options, click Delete, then Write, then Verify, restart Nagios Core then apply configuration.
then go back to deleting the services.
Does this helps?
Re: Services exist that I cannot delete
I tried kyang's suggestion to no avail.
Looking at Derick Wasswa's suggestion, I have a question about nagiosql_delete_service.php. I am trying to delete (for example) the "Drive C: Disk Usage" service for host myhost.mycompany.com. What arguments would I use for the script?
Looking at Derick Wasswa's suggestion, I have a question about nagiosql_delete_service.php. I am trying to delete (for example) the "Drive C: Disk Usage" service for host myhost.mycompany.com. What arguments would I use for the script?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services exist that I cannot delete
@cpss454
Can you PM us a system profile?
Admin -> System Profile
Also send the names of the services you cannot delete, then we can take a look and see if we cna find them..
Also, can you post the output of the following
Thanks!
Can you PM us a system profile?
Admin -> System Profile
Also send the names of the services you cannot delete, then we can take a look and see if we cna find them..
Also, can you post the output of the following
Code: Select all
ps-ef|grep bin/nagiosThanks!
Re: Services exist that I cannot delete
System profile and names of services are attached.
ps -ef|grep bin/nagios
nagios 13344 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13345 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13346 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13347 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13348 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13349 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13350 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13351 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13352 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13353 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13354 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13355 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13356 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13357 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13358 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13359 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13360 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13361 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13362 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13363 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13364 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13365 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13366 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13367 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 15122 1 0 Aug23 ? 00:02:14 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 15167 15122 0 Aug23 ? 00:00:02 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 28230 5836 0 12:50 pts/1 00:00:00 grep --color=auto bin/nagios
ps -ef|grep bin/nagios
nagios 13344 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13345 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13346 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13347 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13348 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13349 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13350 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13351 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13352 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13353 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13354 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13355 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13356 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13357 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13358 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13359 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13360 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13361 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13362 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13363 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13364 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13365 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13366 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 13367 15122 0 12:26 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 15122 1 0 Aug23 ? 00:02:14 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 15167 15122 0 Aug23 ? 00:00:02 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 28230 5836 0 12:50 pts/1 00:00:00 grep --color=auto bin/nagios
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services exist that I cannot delete
Ok, so if these cannot be found in the CCM, lets do the following:
Go to the Core Config Manager
Tools > Config File Management
Click on Write and Verify to check for config errors
If you don't have any errors, click on Delete to remove all host and service configuration files.
Next, apply configuration. The configs will be recreated with whatever is in the database.
Go to the Core Config Manager
Tools > Config File Management
Click on Write and Verify to check for config errors
If you don't have any errors, click on Delete to remove all host and service configuration files.
Next, apply configuration. The configs will be recreated with whatever is in the database.