Page 1 of 1

"error": "Could not find a unique id for this service."

Posted: Thu Jul 04, 2019 10:06 am
by deek
Hi

I am trying to delete the service from Nagios through REST API command. But getting the below error.

curl -XDELETE "http://xxxx/nagiosxi/api/v1/config/serv ... lyconfig=1

"error": "Could not find a unique id for this service."

Also tried using ccm script, which throws up the below error

./ccm_delete_object.php --type service –-config=xxxx

When using type 'service' you must specifiy one:
-i|--id (object id)
-c|--config (confg name)


What is this unique and object id that we are seeing here.

Ideally, we wanted to delete all services for a given host. But we wanted to test for one service before we proceeding with multiple services.

Please advice.

Thanks
Deepan.

Re: "error": "Could not find a unique id for this service."

Posted: Mon Jul 08, 2019 10:59 am
by lmiltchev
What is the version of Nagios XI that you are currently using? Is this the only service that you are not able to delete? Can you delete other services via the REST API?

Is the service added to more than one host or a hostgroup? Do you see the service and it's ID in the CCM? Do you have more than one service, named "Port" on the same host?

Do you see any errors/crashed tables in the mysql (mariadb) log?

Code: Select all

tail /var/log/mysqld.log
tail /var/log/mariadb/mariadb.log