# Plugin mode (Centreon / Nagios / Zabbix)
Since v1.2, rkik provides a plugin mode to integrate easily with traditional monitoring systems (Centreon, Nagios, Zabbix).
This mode emits a single machine-readable line (the plugin output) and returns standard plugin exit codes so monitoring servers can interpret the result.
## Usage
Example:
```bash
rkik time.google.com --plugin --warning 400 --critical 1000
```
Flags
- `--plugin` : enable plugin mode.
- `--warning <MS>` : warning threshold in milliseconds (requires `--plugin`).
- `--critical <MS>` : critical threshold in milliseconds (requires `--plugin`).
## Output format
The plugin line follows this structure:
```
- `<STATE>` is one of `OK`, `WARNING`, `CRITICAL`, `UNKNOWN`.
- Perfdata fields follow the `label=value[UOM];warn;crit;min;max` convention used by Nagios plugins.
Example:
```
## Exit codes
- `0` (OK): request succeeded and `|offset| < warning` (or no thresholds provided).
- `1` (WARNING): request succeeded and `|offset| >= warning` and `< critical`.
- `2` (CRITICAL): request succeeded and `|offset| >= critical`.
- `3` (UNKNOWN): request failed or no usable result (error cases).
## Behavior notes
- The plugin mode suppresses the usual human-readable output; only the plugin line is printed.
- Thresholds are interpreted in milliseconds and compare the absolute value of the clock offset.
- By default, perfdata includes the `ms` unit in the value (e.g., `offset_ms=4.006ms`). If you prefer strictly numeric perfdata values (no unit), request a change and we can provide an option to produce numeric-only perfdata.
- `--plugin` is currently not supported with `--compare` (multi-host compare). If you need plugin-style output for comparisons, specify how you want to aggregate results per host (average, max, or per-host multi-line output).
## Examples
OK example:
```
Unknown example (network error):
```