-
Notifications
You must be signed in to change notification settings - Fork 584
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 #5632] hosts aren't included in hostgroups or at least that is not shown in the classic ui #1233
Comments
Updated by gbeutner on 2014-02-11 12:11:45 +00:00
Can you please attach a copy of your objects.cache and status.dat files to this ticket? They can usually be found in /var/cache/icinga2. Please note that both these files might contain confidential information about your infrastructure (such as host names, passwords, etc.) and you may want to sanitize them somewhat. |
Updated by gvegidy on 2014-02-11 22:07:21 +00:00
Thanks for your quick reply. I've attached both files in shortened form. To me it looks like icinga2 isn't writing out the correct group information. Please tell me if I have shortened the file too much to be of any use. When looking into the logfile, I regularly see this error: Feb 11 23:01:57 localhost icinga2: Exception during database operation: /root/rpmbuild/BUILD/icinga2-abuild/components/db_ido_pgsql/idopgsqlconnection.cpp(269): Throw in function icinga::IdoPgsqlResult icinga::IdoPgsqlConnection::Query(const icinga::String&) [icinga::ContextTrace*] = [icinga::errinfo_message_*] = ERROR: duplicate key value violates unique constraint "uq_servicedependencies" [icinga::errinfo_database_query_*] = INSERT INTO icinga_servicedependencies (dependent_service_object_id, instance_id, service_object_id) VALUES (96, 1, 102) I guess this has to be something to do with service dependencies, so I'm not sure if this has something to do with the hostgroups problem. I'll try to find out where this error message comes from nevertheless. Just wanted to tell you about this now, maybe it is somehow related. |
Updated by gvegidy on 2014-02-15 23:44:56 +00:00 I now have singled out the database errors, see Bug #5665. I can't reproduce the hostgroup problem on a x86_64 system using exactly the same config as on the ARM system I'm seeing it on. Both systems are Fedora 20, rpms compiled on the respective system from your srpms. So I'm currently not sure if this problem is related to the ARM architecture or if there is something else going on. I'll investigate further. |
Updated by gvegidy on 2014-02-16 15:15:41 +00:00 Ok, I think I got it: the objects.cache file is written out before the host is added to the HostGroup-Object. I added some Log() calls to the accessor methods of the HostGroup object: [2014-02-16 15:25:23 +0100] <Q #0xb6dfbb68 W #0xb6dfbc50> debug/icinga: hostgroup linux-servers read: 0 Members [...] [2014-02-16 15:25:24 +0100] debug/icinga: In IcingaApplication::Main() When looking at the code, Host::Start() (from where the Host is added to the HostGroup) is called from within the same queue as StatusDataWriter::Start(). This happens in ConfigItem::ActivateItems() where all DynamicObjects are initialized. In StatusDataWriter::Start(), StatusDataWriter::UpdateObjectsCache (from where objects.cache is written) is not called directly, but enqueued for async callback. So in the end there is no explicit initialization order in the code, but the order this is called depends on thread scheduling and maybe code locations in memory. And this is system and architecture specific, so that is why I can see this problem on my ARM machine and not on x86_64. I think to truely fix this, you should make sure that StatusDataWriter::UpdateObjectsCache can not be called before all object initialization is completed. As I just started looking into icinga2 code today, I don't know what would be the best way to accomplish this. So sorry, no patch from me this time. |
Updated by mfriedrich on 2014-02-17 08:44:59 +00:00
|
Updated by mfriedrich on 2014-02-20 16:06:41 +00:00
|
Updated by gbeutner on 2014-03-05 11:13:30 +00:00 Hi, your analysis is pretty much spot on. Please see if the latest commit in the "next" branches fixes this.
|
Updated by gbeutner on 2014-03-05 11:13:34 +00:00
Applied in changeset 979d6cc. |
Updated by gvegidy on 2014-03-09 12:48:41 +00:00 I tested the patch and can confirm that the issue is fixed. Thank you very much. |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/5632
Created by gvegidy on 2014-02-10 21:45:47 +00:00
Assignee: gbeutner
Status: Resolved (closed on 2014-03-05 11:13:34 +00:00)
Target Version: 0.0.8
Last Update: 2014-03-09 12:48:41 +00:00 (in Redmine)
I'm using icinga2-0.0.7 and because of resource restrictions (it is running on a tiny Beaglebone Black ARM system) I'm running it with the classic ui.
I have the default configuration in generic-host.conf:
template Host "linux-server" inherits "generic-host" {
groups += [ "linux-servers" ],
...
But when I click on "Hostgroup Summary" in the Classic UI, I get shown "No matching hosts" although I have numerous hosts derived from "linux-server".
This is the same for other hostgroups too. If I explicitly add "groups = [ "xyz" ]" into the real host definition the problem stays the same.
So either the hostgroups don't work at all or aren't shown in the Classic UI anymore.
Attachments
Changesets
2014-03-05 11:07:53 +00:00 by gbeutner 979d6cc
The text was updated successfully, but these errors were encountered: