> Markdown version of https://tuna.am/en/docs/cli/monitor/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# tuna monitor

Interact with monitors.

Ping, run and manage monitors. New monitors are created in the dashboard.

In an interactive terminal opens a TUI with live monitor status, details, pause and delete. Otherwise prints this help: use the subcommands below.

Guide with examples: [Monitors in the CLI](https://tuna.am/en/docs/monitors/cli.md).

Usage

```bash
tuna monitor [flags]

```

| Flag               | Description                                |
| ------------------ | ------------------------------------------ |
| `--api-key string` | Your tuna.am api key (env `TUNA_API_KEY`). |

## Subcommands

| Command                          | Description                          |
| -------------------------------- | ------------------------------------ |
| [`tuna monitor delete`](#delete) | Delete a monitor with its history.   |
| [`tuna monitor events`](#events) | Show the last events of a monitor.   |
| [`tuna monitor exec`](#exec)     | Execute a command with monitoring.   |
| [`tuna monitor get`](#get)       | Show a monitor with its last events. |
| [`tuna monitor pause`](#pause)   | Pause a monitor.                     |
| [`tuna monitor ping`](#ping)     | Send a telemetry ping.               |
| [`tuna monitor resume`](#resume) | Resume a paused monitor.             |
| [`tuna monitor status`](#status) | View monitor status.                 |

## tuna monitor delete

Delete a monitor with its history.

Usage

```bash
tuna monitor delete ID [flags]

```

| Flag        | Description                   |
| ----------- | ----------------------------- |
| `-y, --yes` | Skip the confirmation prompt. |

Also accepts the flags of `tuna monitor`.

## tuna monitor events

Show the last events of a monitor.

Usage

```bash
tuna monitor events ID [flags]

```

| Flag              | Description                             |
| ----------------- | --------------------------------------- |
| `-n, --limit int` | How many events to show. Default: `20`. |

Also accepts the flags of `tuna monitor`.

## tuna monitor exec

Execute a command with monitoring.

Usage

```bash
tuna monitor exec KEY -- [COMMAND] [ARGUMENTS] [flags]

```

Examples

```bash
tuna monitor exec ABCD -- /path/to/file
tuna monitor exec ABCD --host=agent1 -- /path/to/file
tuna monitor exec ABCD --no-stdout -- /path/to/file --arg1 --arg2 --arg3

```

| Flag            | Description                            |
| --------------- | -------------------------------------- |
| `--host string` | Report host.                           |
| `--no-stdout`   | Disable sending stdout/stderr to Tuna. |

Also accepts the flags of `tuna monitor`.

## tuna monitor get

Show a monitor with its last events.

Usage

```bash
tuna monitor get ID

```

Also accepts the flags of `tuna monitor`.

## tuna monitor pause

Pause a monitor.

Usage

```bash
tuna monitor pause ID

```

Also accepts the flags of `tuna monitor`.

## tuna monitor ping

Send a telemetry ping.

Usage

```bash
tuna monitor ping KEY [flags]

```

Examples

```bash
tuna monitor ping ABCD
tuna monitor ping ABCD --state=ping
tuna monitor ping ABCD --state=ping --host=agent1
tuna monitor ping ABCD --state=fail --message="Error: Job was not successful"
tuna monitor ping ABCD --state=finish

```

| Flag               | Description                    |
| ------------------ | ------------------------------ |
| `--host string`    | Report host.                   |
| `--message string` | Report message.                |
| `--state string`   | Report state. Default: `ping`. |

Also accepts the flags of `tuna monitor`.

## tuna monitor resume

Resume a paused monitor.

Usage

```bash
tuna monitor resume ID

```

Also accepts the flags of `tuna monitor`.

## tuna monitor status

View monitor status.

Usage

```bash
tuna monitor status [KEY]

```

Examples

```bash
tuna monitor status ABCD

```

Also accepts the flags of `tuna monitor`.

[Global flags](https://tuna.am/en/docs/cli.md#global-flags) work too.
