Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11618] problems with deleting API objects w/ Classic UI #4132

Closed
icinga-migration opened this issue Apr 19, 2016 · 10 comments
Closed
Labels
area/api REST API bug Something isn't working

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11618

Created by kowallix on 2016-04-19 11:49:04 +00:00

Assignee: (none)
Status: Rejected (closed on 2016-08-08 16:50:01 +00:00)
Target Version: (none)
Last Update: 2016-08-09 08:54:30 +00:00 (in Redmine)

Icinga Version: 2.4.3
Backport?: Not yet backported
Include in Changelog: 1

I have several problems when deleting objects.

  1. After deleting a service it is still visible in the Classic UI
  • it is no longer visible in the Web2 UI
  • a GET against the API says it doesn't exist
  • even though the check is still visible in the Classic UI , it is no longer checked or updated - the "Next Scheduled Active Check" timestamp remains fixed.
  1. I can't delete a host object without using cascade
    I have a host with several services. Then I delete the services. Then I try to delete the host itself.
    Response is:
    "Object cannot be deleted because other objects depend on it. Use cascading delete to delete it anyway"
    But there are no other objects which depend on it. (according to API and Web2 UI - Classic UI still has host and services - see problem 1)

  2. When I delete a host using cascade and then recreate it, it doesn't show up in Web2 UI

  • create host
  • delete host using cascade
  • create host
    Result: Host is visible in ClassicUI but not in the Web2UI
@icinga-migration
Copy link
Author

Updated by kowallix on 2016-04-20 15:22:54 +00:00

After restarting icinga2 both UI show the correct configuration.

  • the deleted services disappeared from ClassicUI
  • the recreated hosts show up in the WebUI

But then I then repeat the procedure:

  • create host
  • create service
  • delete service (doesn't disappear from ClassicUI)
  • delete host (only possible with cascade=1)

and I'm back at the initial problem.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-04-22 08:09:22 +00:00

  • Parent Id set to 11415

@icinga-migration
Copy link
Author

Updated by kowallix on 2016-04-22 13:18:19 +00:00

problem does not go away when we deactivate WebUI (actually the IDO Modul)

It is possible to delete a host and all it's services using cascade and then recreate the host and the services we want to keep.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-05-09 11:31:48 +00:00

  • Subject changed from problems with deleting API objects to problems with deleting API objects w/ Classic UI
  • Status changed from New to Feedback
  • Assigned to set to kowallix

The status files read by the Classic UI are not updated when those objects are added/deleted but in a given interval by the StatusDataWriter feature (when the objects cache is invalidated). In case you restart the daemon, the files are purged and rewritten.

@icinga-migration
Copy link
Author

Updated by kowallix on 2016-05-30 11:20:48 +00:00

I can confirm the restart part.
But the StatusDataWriter part doesn't seem to work.

objects.cache is updated when I delete a service - but the service is still present in objects.cache
status.dat is updated regularly - but the service is still in there as well.

config for the stastusdatawriter is all default:

cat /etc/icinga2/features-enabled/statusdata.conf
/****

  • The StatusDataWriter type periodically updates the status.dat and objects.cache
  • files. These are used by the Icinga 1.x CGIs to display the state of
  • hosts and services.
    */

library "compat"

object StatusDataWriter "status" { }

@icinga-migration
Copy link
Author

Updated by kowallix on 2016-06-14 08:35:45 +00:00

when I delete the service the icinga touches the object.cache file - according to mtime
But the content of the file is not changed - the service I deleted is still there.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-08 15:29:29 +00:00

  • Status changed from Feedback to New
  • Assigned to deleted kowallix

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-08 16:50:02 +00:00

  • Status changed from New to Rejected

I'm not able to reproduce this. My StatusDataWriter config is the default without any modifications. Tested on Fedora 24.

Put

imagine /etc/icinga2/conf.d # curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/hosts/bumsti01' -d '{ "attrs": { "check_command": "dummy" } }'
{"results":[{"code":200.0,"status":"Object was created"}]}


imagine /etc/icinga2/conf.d # REMOTE_USER=icingaadmin REQUEST_METHOD=GET QUERY_STRING='search_string=bumsti&jsonoutput' /usr/local/icinga-classic/sbin/status.cgi
Cache-Control: no-store
Pragma: no-cache
Last-Modified: Mon, 08 Aug 2016 16:46:44 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-type: text/json; charset="utf-8"

{ "cgi_json_version": "1.11.0",
"icinga_status": {
"status_data_age": 10,
"status_update_interval": 10,
"reading_status_data_ok": true,
"program_version": "v2.4.10-607-g60dcf23",
"icinga_pid": 18945,
"timezone": "CEST",
"date_format": "us",
"program_start": 1470674374,
"total_running_time": "0d 0h 7m 10s",
"last_external_command_check": 0,
"last_log_file_rotation": 0,
"notifications_enabled": true,
"disable_notifications_expire_time": 0,
"service_checks_being_executed": true,
"passive_service_checks_being_accepted": true,
"host_checks_being_executed": true,
"passive_host_checks_being_accepted": true,
"obsessing_over_services": false,
"obsessing_over_hosts": false,
"check_service_freshness": true,
"check_host_freshness": true,
"event_handlers_enabled": true,
"flap_detection_enabled": true,
"performance_data_being_processed": true
}, 
"status": {
"host_status": [
{ "host_name": "bumsti01", "host_display_name": "bumsti01", "status": "PENDING", "last_check": "N/A", "duration": "0d  0h  7m 10s", "attempts": "1/3", "current_notification_number": 0, "state_type": "SOFT", "is_flapping": false, "in_scheduled_downtime": false, "active_checks_enabled": true, "passive_checks_enabled": true, "notifications_enabled": true, "has_been_acknowledged": false, "action_url": null, "notes_url": null, "status_information": "Host check scheduled for Mon Aug 8 18:48:19 CEST 2016"}
]
}
}

Delete

imagine /etc/icinga2/conf.d # curl -k -s -u root:icinga -H 'Accept: application/json' -X DELETE 'https://localhost:5665/v1/objects/hosts/bumsti01'

imagine /etc/icinga2/conf.d # REMOTE_USER=icingaadmin REQUEST_METHOD=GET QUERY_STRING='search_string=bumsti&jsonoutput' /usr/local/icinga-classic/sbin/status.cgi
Cache-Control: no-store
Pragma: no-cache
Last-Modified: Mon, 08 Aug 2016 16:47:55 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-type: text/json; charset="utf-8"

{ "cgi_json_version": "1.11.0",
"icinga_status": {
"status_data_age": 5,
"status_update_interval": 10,
"reading_status_data_ok": true,
"program_version": "v2.4.10-607-g60dcf23",
"icinga_pid": 18945,
"timezone": "CEST",
"date_format": "us",
"program_start": 1470674374,
"total_running_time": "0d 0h 8m 21s",
"last_external_command_check": 0,
"last_log_file_rotation": 0,
"notifications_enabled": true,
"disable_notifications_expire_time": 0,
"service_checks_being_executed": true,
"passive_service_checks_being_accepted": true,
"host_checks_being_executed": true,
"passive_host_checks_being_accepted": true,
"obsessing_over_services": false,
"obsessing_over_hosts": false,
"check_service_freshness": true,
"check_host_freshness": true,
"event_handlers_enabled": true,
"flap_detection_enabled": true,
"performance_data_being_processed": true
}, 
"status": {
"host_status": [

]
,
"service_status": [

]
}
}

I'm therefore closing this issue.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-08 16:51:00 +00:00

  • Parent Id deleted 11415

@icinga-migration
Copy link
Author

Updated by kowallix on 2016-08-09 08:54:30 +00:00

My problem is that I can't delete a service belonging to the host object (deleting the host itself works)

curl -k -s -u icinga:icinga -H 'Accept: application/json' -X PUT 'https://monitoring.something.de:5665/v1/objects/hosts/host.something.de' -d '{attrs
curl -k -s -u icinga:icinga -H 'Accept: application/json' -X PUT 'https://monitoring.something.de:5665/v1/objects/services/host.something.de!ssh' -d '{attrs
curl -k -s -u icinga:icinga -H 'Accept: application/json' -X DELETE 'https://monitoring.something.de:5665/v1/objects/services/host.something.de!ssh'
{results was deleted.",type

but the service is still present in classic UI

@icinga-migration icinga-migration added bug Something isn't working area/api REST API labels Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant