curl -k -s -u $APILOGIN:$APIPASSWORD 'https://localhost:5665/v1/objects/hosts?host=clustertest3' |jq . { "results": [ { "attrs": { "__name": "clustertest3", "acknowledgement": 0, "acknowledgement_expiry": 0, "action_url": "", "active": true, "address": "", "address6": "", "check_attempt": 2, "check_command": "dummy", "check_interval": 300, "check_period": "", "check_timeout": null, "command_endpoint": "", "display_name": "clustertest3", "downtime_depth": 0, "enable_active_checks": true, "enable_event_handler": true, "enable_flapping": false, "enable_notifications": true, "enable_passive_checks": true, "enable_perfdata": true, "event_command": "", "flapping": false, "flapping_current": 0, "flapping_last_change": 0, "flapping_threshold": 0, "flapping_threshold_high": 30, "flapping_threshold_low": 25, "force_next_check": false, "force_next_notification": false, "groups": [ "Allhosts" ], "ha_mode": 0, "handled": false, "icon_image": "", "icon_image_alt": "", "last_check": 1578571432.517034, "last_check_result": { "active": true, "check_source": "myhost", "command": null, "execution_end": 1578571432.517034, "execution_start": 1578571432.517034, "exit_status": 0, "output": "Exception occurred while checking 'clustertest3': Error: Invalid type in for expression: HostGroup\nLocation: in /etc/icinga2/conf.d/clustertest.conf: 20:5-26:5\n/etc/icinga2/conf.d/clustertest.conf(18): var cluster_nodes = macro(\"$cluster_nodes$\")\n/etc/icinga2/conf.d/clustertest.conf(19): \n/etc/icinga2/conf.d/clustertest.conf(20): for (node in cluster_nodes) {\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(21): if (get_host(node).state > 0) {\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(22): down_count += 1\n ^^^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(23): } else {\n ^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(24): up_count += 1\n ^^^^^^^^^^^^^^^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(25): }\n ^^^^^^^\n/etc/icinga2/conf.d/clustertest.conf(26): }\n ^^^^^\n/etc/icinga2/conf.d/clustertest.conf(27): \n/etc/icinga2/conf.d/clustertest.conf(28): if (up_count >= down_count) {\n\n\t(0) Resolving macros for string '$dummy_state$'\n\t(1) Executing check for object 'clustertest3'\n", "performance_data": null, "schedule_end": 1578571432.517034, "schedule_start": 1578571432.517034, "state": 3, "ttl": 0, "type": "CheckResult", "vars_after": { "attempt": 2, "reachable": true, "state": 3, "state_type": 0 }, "vars_before": null }, "last_hard_state": 1, "last_hard_state_change": 1573816947.789697, "last_reachable": true, "last_state": 1, "last_state_change": 1573816947.789697, "last_state_down": 0, "last_state_type": 0, "last_state_unreachable": 0, "last_state_up": 0, "max_check_attempts": 3, "name": "clustertest3", "next_check": 1578571490.877049, "notes": "", "notes_url": "", "original_attributes": null, "package": "_etc", "paused": false, "previous_state_change": 1573816947.789697, "problem": true, "retry_interval": 60, "severity": 136, "source_location": { "first_column": 1, "first_line": 9, "last_column": 26, "last_line": 9, "path": "/etc/icinga2/conf.d/clustertest.conf" }, "state": 1, "state_type": 0, "templates": [ "clustertest3" ], "type": "Host", "vars": { "cluster_nodes": { "__name": "testgruppe", "action_url": "", "display_name": "testgruppe", "groups": null, "name": "testgruppe", "notes": "", "notes_url": "", "package": "_etc", "source_location": { "first_column": 0, "first_line": 1, "last_column": 28, "last_line": 1, "path": "/etc/icinga2/conf.d/clustertest.conf" }, "templates": [ "testgruppe" ], "type": "HostGroup", "vars": null, "version": 0, "zone": "" }, "dummy_state": { "arguments": [], "deprecated": false, "name": "", "side_effect_free": false, "type": "Function" }, "dummy_text": { "arguments": [], "deprecated": false, "name": "", "side_effect_free": false, "type": "Function" } }, "version": 0, "volatile": false, "zone": "" }, "joins": {}, "meta": {}, "name": "clustertest3", "type": "Host" } ] }