Executing root@admin ~ # curl -s -u $ICINGA2_API_USER:$ICINGA2_API_PASSWORD -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST -k "https://$ICINGA2_API_HOST:$ICINGA2_API_PORT/v1/objects/services?filter=service.name==%22agent-health%22" | json_pp
I get:
{
"results" : [
{
"attrs" : {
"__name" : "ga.domain.tld!agent-health",
"acknowledgement" : 0,
"acknowledgement_expiry" : 0,
"acknowledgement_last_change" : 0,
"action_url" : "",
"active" : true,
"check_attempt" : 1,
"check_command" : "cluster-zone",
"check_interval" : 300,
"check_period" : "",
"check_timeout" : null,
"command_endpoint" : "ga.domain.tld",
"display_name" : "cluster-health-ga.domain.tld",
"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" : 10.9,
"flapping_last_change" : 1721250494.37898,
"flapping_threshold" : 0,
"flapping_threshold_high" : 30,
"flapping_threshold_low" : 25,
"force_next_check" : false,
"force_next_notification" : false,
"groups" : [],
"ha_mode" : 0,
"handled" : false,
"host_name" : "ga.domain.tld",
"icon_image" : "",
"icon_image_alt" : "",
"last_check" : 1721739859.5294,
"last_check_result" : {
"active" : true,
"check_source" : "ga.domain.tld",
"command" : "cluster-zone",
"execution_end" : 1721739859.5294,
"execution_start" : 1721739859.52938,
"exit_status" : 0,
"output" : "Zone 'ga.domain.tld' is not connected. Log lag: less than 1 millisecond",
"performance_data" : [
{
"counter" : false,
"crit" : 0,
"label" : "slave_lag",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "s",
"value" : 0,
"warn" : 0
},
{
"counter" : false,
"crit" : null,
"label" : "last_messages_sent",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
},
{
"counter" : false,
"crit" : null,
"label" : "last_messages_received",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
},
{
"counter" : false,
"crit" : null,
"label" : "sum_messages_sent_per_second",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
},
{
"counter" : false,
"crit" : null,
"label" : "sum_messages_received_per_second",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
},
{
"counter" : false,
"crit" : null,
"label" : "sum_bytes_sent_per_second",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
},
{
"counter" : false,
"crit" : null,
"label" : "sum_bytes_received_per_second",
"max" : null,
"min" : null,
"type" : "PerfdataValue",
"unit" : "",
"value" : 0,
"warn" : null
}
],
"schedule_end" : 1721739859.5294,
"schedule_start" : 1721739859.5294,
"state" : 2,
"ttl" : 0,
"type" : "CheckResult",
"vars_after" : {
"attempt" : 1,
"reachable" : true,
"state" : 2,
"state_type" : 1
},
"vars_before" : {
"attempt" : 1,
"reachable" : true,
"state" : 2,
"state_type" : 1
}
},
"last_hard_state" : 2,
"last_hard_state_change" : 1721739561.28873,
"last_reachable" : true,
"last_state" : 2,
"last_state_change" : 1721739444.80542,
"last_state_critical" : 1721739859.53051,
"last_state_ok" : 1721739303.94638,
"last_state_type" : 1,
"last_state_unknown" : 1721737817.98358,
"last_state_unreachable" : 1720095736.37306,
"last_state_warning" : 0,
"max_check_attempts" : 3,
"name" : "agent-health",
"next_check" : 1721740157.77058,
"next_update" : 1721740457.77058,
"notes" : "",
"notes_url" : "",
"original_attributes" : null,
"package" : "_etc",
"paused" : false,
"previous_state_change" : 1721739444.80542,
"problem" : true,
"retry_interval" : 60,
"severity" : 2176,
"source_location" : {
"first_column" : 1,
"first_line" : 4,
"last_column" : 28,
"last_line" : 4,
"path" : "/etc/icinga2/zones.d/master/services.d/agent-health.conf"
},
"state" : 2,
"state_type" : 1,
"templates" : [
"agent-health"
],
"type" : "Service",
"vars" : {
"cluster_zone" : "ga.domain.tld"
},
"version" : 0,
"volatile" : false,
"zone" : "master"
},
"joins" : {},
"meta" : {},
"name" : "ga.domain.tld!agent-health",
"type" : "Service"
}
]
}
check_source is ga.domain.tld - which is how I want it/it must be
vars.cluster_zone is “ga.domain.tld” which is also correct.
A zone with that name exists, and the host is part of that zone.
What am I missing?