I am building some checks - but I am not sure which state to use that represents the result of the check.
I marked the states of my sample-result with comments below (AAA, BBB, … EEE) to identify it.
{
"attrs": {
"last_check_result": {
"active": true,
"check_source": "MyHost",
"command": [
"/usr/lib/nagios/plugins/check_ping",
"-H",
"192.168.1.111",
"-c",
"5000,100%",
"-w",
"3000,80%"
],
"execution_end": 1700638780.905078,
"execution_start": 1700638750.898157,
"exit_status": 2, // AAA
"output": "PING CRITICAL - Packet loss = 100%",
"performance_data": [
"rta=5000.000000ms;3000.000000;5000.000000;0.000000",
"pl=100%;80;100;0"
],
"schedule_end": 1700638780.905165,
"schedule_start": 1700638750.897758,
"state": 2, // BBB
"ttl": 0,
"type": "CheckResult",
"vars_after": {
"attempt": 1,
"reachable": true,
"state": 2, // CCC
"state_type": 1
},
"vars_before": {
"attempt": 1,
"reachable": true,
"state": 2, // DDD
"state_type": 1
}
},
"state": 1 // EEE
},
"joins": {},
"meta": {},
"name": "MyHost",
"type": "Host"
}
Is it AAA, …, EEE that should be used? I did not find infos in the REST API I am using.
Thanks!