Merge branch '2.2' into 2.2-mrm

This commit is contained in:
Markus Mäkelä
2017-10-30 11:06:34 +02:00
49 changed files with 1458 additions and 500 deletions

View File

@ -1519,8 +1519,19 @@ static json_t* server_to_json_data(const SERVER* server, const char* host)
/** Relationships */
json_t* rel = json_object();
json_object_set_new(rel, CN_SERVICES, service_relations_to_server(server, host));
json_object_set_new(rel, CN_MONITORS, monitor_relations_to_server(server, host));
json_t* service_rel = service_relations_to_server(server, host);
json_t* monitor_rel = monitor_relations_to_server(server, host);
if (service_rel)
{
json_object_set_new(rel, CN_SERVICES, service_rel);
}
if (monitor_rel)
{
json_object_set_new(rel, CN_MONITORS, monitor_rel);
}
json_object_set_new(rval, CN_RELATIONSHIPS, rel);
/** Attributes */
json_object_set_new(rval, CN_ATTRIBUTES, server_json_attributes(server));