What state to use to get the status of a check?

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!

IMHO, it’s EEE as the others are internal details relating to the check command and its runs. But the state could be set via the DSL or the REST-API as well and would not necessarily be reflected the same way under “last_check_result”.

I thought about BBB or EEE - but they are not equal…

Hosts have a state of [up|down|unknown|pending] but the check for the host state reports the usual [ok|warn|crit|unknown|pending].