{"action":"opened","issue":{"url":"https://api.github.com/repos/tas50/nagios/issues/354","labels_url":"https://api.github.com/repos/tas50/nagios/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/tas50/nagios/issues/354/comments","events_url":"https://api.github.com/repos/tas50/nagios/issues/354/events","html_url":"https://github.com/tas50/nagios/issues/354","id":65524656,"number":354,"title":"/etc/nagios/conf.d/servicegroups.cfg being generated with services but no hosts","user":{"login":"GitBytes","id":5084249,"avatar_url":"https://avatars.githubusercontent.com/u/5084249?v=3","gravatar_id":"","url":"https://api.github.com/users/GitBytes","html_url":"https://github.com/GitBytes","followers_url":"https://api.github.com/users/GitBytes/followers","following_url":"https://api.github.com/users/GitBytes/following{/other_user}","gists_url":"https://api.github.com/users/GitBytes/gists{/gist_id}","starred_url":"https://api.github.com/users/GitBytes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitBytes/subscriptions","organizations_url":"https://api.github.com/users/GitBytes/orgs","repos_url":"https://api.github.com/users/GitBytes/repos","events_url":"https://api.github.com/users/GitBytes/events{/privacy}","received_events_url":"https://api.github.com/users/GitBytes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-31T19:12:28Z","updated_at":"2015-03-31T19:12:28Z","closed_at":null,"body":"I am running into an interesting feature.. \r\n\r\nScenario:\r\nGenerating a servicegroups.cfg via (example) nagios_servicegroups/custom_servicegroup.json databag file:\r\n```\r\n{\r\n  \"id\": \"SS\",\r\n  \"alias\": \"Some Alias\",\r\n  \"notes\": \"SomeService Note\"\r\n}\r\n```\r\nand using the following (example) nagios_services/custom_service.json databag:\r\n```\r\n{\r\n  \"id\": \"SSMaster\",\r\n  \"hostgroup_name\": \"SSMaster_list\",\r\n  \"command_line\": \"$USER1$/check_something...\",\r\n  \"servicegroups\": \"SS\"\r\n}\r\n```\r\nIt would seem that when members are added to the servicegroups.cfg file, only the service description name (ex. ssmaster), is being added to the list and not ANY hosts (servicegroups.cfg):\r\n```\r\nline 7:      define servicegroup {\r\nline 8:         servicegroup_name  SS\r\nline 9:         members            ssmaster\r\nline 10:    }\r\n```\r\nThis breaks the nagios config check (nagios -v /etc/nagios/nagios.cfg) seemingly with output like this:\r\n```\r\nNagios Core 3.5.1\r\nCopyright (c) 2009-2011 Nagios Core Development Team and Community Contributors\r\n...\r\n...\r\nError: Could not find a service matching host name 'ssmaster' and description 'nodeX' (config file '/etc/nagios/conf.d/servicegroups.cfg', starting on line 9)\r\nError: Could not expand member services specified in servicegroup (config file '/etc/nagios/conf.d/servicegroups.cfg', starting on line 9)\r\n   Error processing object config files!\r\n```\r\n\r\nThe 'nodeX' becomes other services if they are added to the services databag with the ``` \"servicegroups\": \"SS\" ``` line.\r\n\r\nIs my method to deploy servicegroups wrong here? Am I missing something that could allow a better or no member list to be generated? If I comment out the members line in the servicegroups.cfg file, things seem to work properly...oddly enough because of the ```servicegroups       SS``` line in the services.cfg file.\r\n\r\nAny thoughts on this issue? Bottom line, members in the servicegroups.cfg file are only being populated with services and not hosts except in the case of a single service, then it grabs a seemingly random host and populates in wrong order (service,host or service,service.. instead of host,service,host,service...)"}}