# IRPCTest.GetServerHealth

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/GetServerHealth/

Badges: `Vault API / standard` `read` `session` `idempotent`

Runs the server health checks you select and returns the result of each.

- **Service:** [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md) `MFiles.IRPCTest`
- **gRPC method:** `/MFiles.IRPCTest/GetServerHealth`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-server-health`
- **Request:** [`GetServerHealthRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/GetServerHealth/index.md#request)
- **Response:** [`GetServerHealthResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/GetServerHealth/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

Needs a session. Without a session the call fails with `UNAUTHENTICATED`.

These are the checks of
[CheckServerHealthAnonymous](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/CheckServerHealthAnonymous/index.md), selected one by one
in `data_request`:

- `vault_refresh_from_one_db`: the latest refresh of the vault list from One DB succeeded.
- `online_state_transition_finished_for_all_vaults`: every vault has finished going online.
- `all_vaults_in_correct_end_state`: every vault that is set to be online is online.

Each of them is a `ServerHealthItem`:

- `SERVER_HEALTH_ITEM_IGNORE` (the default): the check is not run and its result field stays
  `TRI_STATE_BOOLEAN_UNDEFINED`. An empty request therefore returns an empty result.
- `SERVER_HEALTH_ITEM_CHECK`: the check is run and its result field is `TRI_STATE_BOOLEAN_TRUE` or
  `TRI_STATE_BOOLEAN_FALSE`.
- `SERVER_HEALTH_ITEM_FAIL_IF_UNHEALTHY`: the check is run, and the call fails instead of
  returning `TRI_STATE_BOOLEAN_FALSE`.

A vault that has not finished going online counts as unhealthy for both vault checks.

<a id="request"></a>

## Request: GetServerHealthRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `data_request` | [`ServerHealthRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerHealthRequest/index.md) | Which checks to run, and whether a failed check fails the call; see Remarks. |
| `data_request.vault_refresh_from_one_db` | [`ServerHealthItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ServerHealthItem/index.md) | Check that a refresh from One DB has been successfully made. Values: `SERVER_HEALTH_ITEM_IGNORE` (0), `SERVER_HEALTH_ITEM_CHECK` (1), `SERVER_HEALTH_ITEM_FAIL_IF_UNHEALTHY` (2). |
| `data_request.online_state_transition_finished_for_all_vaults` | [`ServerHealthItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ServerHealthItem/index.md) | Check that all the vaults have finished the online transition. Values: `SERVER_HEALTH_ITEM_IGNORE` (0), `SERVER_HEALTH_ITEM_CHECK` (1), `SERVER_HEALTH_ITEM_FAIL_IF_UNHEALTHY` (2). |
| `data_request.all_vaults_in_correct_end_state` | [`ServerHealthItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ServerHealthItem/index.md) | Check that all the vaults are in correct end state. Values: `SERVER_HEALTH_ITEM_IGNORE` (0), `SERVER_HEALTH_ITEM_CHECK` (1), `SERVER_HEALTH_ITEM_FAIL_IF_UNHEALTHY` (2). |

<a id="response"></a>

## Response: GetServerHealthResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `data_result` | [`ServerHealthResult`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerHealthResult/index.md) | One result per check. A check that was not requested is `TRI_STATE_BOOLEAN_UNDEFINED`. `vault_refresh_from_one_db_succeeded` is also `TRI_STATE_BOOLEAN_UNDEFINED` on servers that do not use One DB, which is the normal case on premises. |
| `data_result.vault_refresh_from_one_db_succeeded` | [`TriStateBoolean`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.TriStateBoolean/index.md) | True, if a refresh from One DB has been successfully made. Undefined, if One DB is not enabled for the server. Values: `TRI_STATE_BOOLEAN_UNDEFINED` (0), `TRI_STATE_BOOLEAN_FALSE` (1), `TRI_STATE_BOOLEAN_TRUE` (2). |
| `data_result.online_state_transition_finished_for_all_vaults_succeeded` | [`TriStateBoolean`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.TriStateBoolean/index.md) | True, if all the vaults have finished the online transition. Values: `TRI_STATE_BOOLEAN_UNDEFINED` (0), `TRI_STATE_BOOLEAN_FALSE` (1), `TRI_STATE_BOOLEAN_TRUE` (2). |
| `data_result.all_vaults_in_correct_end_state_succeeded` | [`TriStateBoolean`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.TriStateBoolean/index.md) | True, if all the vaults are in correct end state. Values: `TRI_STATE_BOOLEAN_UNDEFINED` (0), `TRI_STATE_BOOLEAN_FALSE` (1), `TRI_STATE_BOOLEAN_TRUE` (2). |

<a id="related"></a>

## Related methods

- [CheckServerHealthAnonymous](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/CheckServerHealthAnonymous/index.md): Succeeds when the server and all its vaults have finished starting; fails otherwise. No session needed.
