# BIG-IP Scripted monitor explainer

> Paste the send and expect file a BIG-IP LTM Scripted monitor reads and see each line as the monitor reads it, with findings against every rule F5 states (LF line endings, exactly one space after the keyword, nothing after a closing quotation mark, a match only on a prefix of the reply, its escape sequences) and against what F5 leaves open. Add a server transcript in the RFCs' S: and C: notation and the check is simulated line by line: pass, fail at a line and why, or undetermined where F5's text does not say. Nothing connects anywhere.

- Tool: https://ronutz.com/en/tools/bigip-scripted-monitor-explainer
- Family: Networking

---

## What it does

Reads the file a BIG-IP LTM Scripted monitor plays (the send and expect lines kept in `/config/eav/`) and explains it the way F5's documentation says the monitor reads it. Every line is shown as written and as read: the keyword, the text with its quotation marks removed and F5's escape sequences resolved, how a send ends (CR LF, LF alone, CR alone or nothing), and what a known reply or command means in SMTP, POP3, IMAP or FTP, with the RFC section. The findings check the file against every rule F5 states and flag everything F5 leaves open, rules S1 to S16, each tied to a line.

Give it a server transcript as well and it simulates the check: each send goes out, each expect is compared with the next server reply, and the result is **pass**, **fail at line N** with F5's reason, or **undetermined at line N** where F5's text does not say what the monitor does. Nothing connects anywhere: the transcript is text you paste, and the script is read, never run. The [Scripted monitor lab](https://ronutz.com/en/learn/bigip-ltm-scripted-monitors#lab-scripted-monitor-dialogue) in the Learn article plays a script against a server that follows the RFCs, line by line, and shows which of F5's rules stops it.

The facts are F5's: the BIG-IP 21.1.0 LTM Monitors Reference, "Scripted monitor settings", and the TMSH Reference for `ltm monitor scripted`. The protocol facts come from RFC 5321 (SMTP), RFC 1939 (POP3), RFC 9051 (IMAP4rev2) and RFC 959 (FTP). All were read on 2026-10-27.

## The rules F5 states

- **S1, a CR in a line (error).** F5: scripts "must use hard-return line endings (LF), not soft-return line endings (CR-LF)". A file saved on Windows has a CR before every LF. The finding says whether the CR ends the line or sits inside it.
- **S2, not exactly one space after the keyword (error).** F5: "Exactly one character space must be used to separate the send or expect instruction keywords from the text". Two or more spaces, or a tab, are flagged.
- **S3, characters after a closing quotation mark (error).** F5: "The text to send or match extends to the end of the line, even when using quotation marks. Any characters that follow a closing quotation mark will break the match." On an expect line the simulator therefore fails the check there; on a send line F5 does not say what is sent, so the simulator stops as undetermined.
- **S4, a first word that is not send or expect (error).** F5 documents those two keywords only. The finding says when the word is a capitalized keyword (`Expect`), a comment (`#`), or a sign that an Expect (Tcl) script was pasted (`spawn`, `set`, `#!/usr/bin/expect` and the like).
- **S5, an escape sequence F5 does not list (warning).** F5's table: `\a` bell, `\b` backspace, `\f` form feed, `\n` new line, `\r` return, `\t` tab, `\v` vertical tab, `\\` backslash, `\'` single quotation mark. Anything else after a backslash, such as `\x0d` or `\"`, is not documented.
- **The prefix rule (the simulator's match).** F5: "Matching text can match the prefix of a response, but cannot match a substring that is not a prefix, that is, a substring that starts other than at the beginning of the response." When the text occurs later in the reply, the step says at which character.
- **The order.** F5: "the lines of the file are always read in the sequence specified". The simulator walks the file top to bottom and stops at the first line that fails or cannot be decided.

## What F5 leaves open

F5's text does not settle these, so the explainer flags them as warnings and the simulator stops there with **undetermined** and the reason, rather than guessing:

- **S9, a blank line.** Blank lines after the last instruction are noted but cannot change a match.
- **S10, white space before the keyword.**
- **S11, a quotation form F5 does not describe:** single quotation marks (F5 lists an escape for the single quotation mark but does not say whether single quotation marks enclose a text), an opening quotation mark with no closing one, or a quotation mark inside an unquoted text.
- **S12, an empty text** (`expect` alone, or `expect ""`).
- **S13, a last line without LF.** An expect on such a line stops the simulation; a send there is only noted.
- **S14, no expect line at all:** nothing the server says is ever checked.
- **Case.** When the reply starts with the text in another case (`+ok` against `+OK`), the simulator says undetermined: F5 does not say whether the comparison is case-sensitive.
- **What a response is.** F5 does not say how much of a multi-line reply the monitor reads before comparing. When a match would need the monitor to have read past the end of the reply's first line, the simulator says undetermined.
- **An unquoted line that ends in CR** (a CR-LF file without quotation marks): F5 says LF only, but not how such a line is then read.

## Advice from the RFCs

- **S6, a send with no line ending (warning).** SMTP, POP3, IMAP and FTP end every command with CR LF (RFC 5321 2.3.8, RFC 1939 section 3, RFC 9051 2.2, RFC 959 section 4), so a server of those protocols waits for one. F5's own example writes `\r\n` at the end of each send; nothing in F5's text says the monitor adds a line ending.
- **S7, a send ending in LF alone or CR alone (note).** RFC 5321 2.3.8: a conforming implementation must not recognize any other line terminator than CR LF.
- **S8, an expect written like a pattern (note):** a leading `^`, a trailing `$`, `.*` or `.+`, or Expect's `-re`, `-gl`, `-ex` or `-nocase`. The text is matched literally; F5 says the only monitors that support regular expression matching are HTTP, HTTPS, HTTP/2, TCP and UDP.
- **S15, a credential in a send (warning):** `PASS` (POP3, FTP) or `LOGIN` (IMAP). The password is masked everywhere in the output, the transcript comparison included. The file keeps it in clear, the tmsh reference lists no TLS option for the monitor type, and RFC 9051 6.2.3 says LOGIN must not be used on unsecure networks. POP3 allows QUIT and IMAP allows LOGOUT before authentication, so a check that never logs in is usually possible.
- **S16, an expect on a reply code and a space (note),** such as `"250 "`. In SMTP and FTP multi-line replies every line but the last starts with the code and a hyphen (RFC 5321 4.2.1, RFC 959 4.2), so `"250 "` is never the start of an EHLO reply; expect the code alone.

## The transcript, and how the simulation reads it

Write the session as the RFCs do: `S:` before each line the server sends, `C:` before each line the client sends.

```
S: 220 foo.com Simple Mail Transfer Service Ready
C: HELO bigip1.somecompany.net
S: 250 foo.com
C: quit
S: 221 foo.com Service closing transmission channel
```

- A **reply** is a run of `S:` lines; a `C:` line or a blank line ends it. Put a blank line between two `S:` runs when the server sends them as separate replies.
- Each `S:` line is read as ending in **CR LF**, as all four protocols require. The spaces after `S:` and `C:` are notation, not data (RFC 1939 writes `S:  +OK` with two).
- Each **expect** is compared with the **next reply**, from its first character. This is the simulator's one assumption: F5 does not say what counts as "the response" when a reply has several lines. Wherever that could change the verdict, the simulator says undetermined.
- Each **send** is compared with the next `C:` line, if there is one; a difference is noted (the transcript may come from another client), never a failure.
- When the transcript has **no reply left** for an expect, the check fails there: F5's Timeout row says a target that does not respond within the Timeout is considered down.
- Lines that start with neither `S:` nor `C:` are ignored and listed.

The reasons a check fails: the text occurs in the reply but not at its start (with the offset); the reply does not start with the text and does not contain it; the reply ends before the text does; characters follow a closing quotation mark, or the CR of a CR-LF ending does; no reply arrives.

## Reading the output

The summary counts lines, sends, expects and findings, and says when the file does not end with an LF. The simulation shows the verdict, then one row per line reached: the line, what it sends or expects as the monitor reads it, the reply it was compared with (numbered as in the transcript) or, for a send, whether the transcript shows the same client line, and the outcome. The table of lines shows each line as written, where a control character the file really holds (the CR of a CR-LF ending, a tab) appears as its Unicode picture, such as ␍ or ␉, and an escape typed as a backslash and a letter stays as typed; elsewhere text is shown with F5's escape sequences and a backslash as two.

The **Example** button loads F5's own SMTP script from the Monitors Settings Reference, verbatim, with a session shaped like RFC 5321's: it passes.

## Timing

The script has no timer of its own in F5's documentation. The monitor's Interval (10 seconds by default for Scripted, per the tmsh reference) and Timeout (31 seconds, three times the Interval plus one) decide when a member is marked down, as for every monitor; [the article on LTM health monitors](https://ronutz.com/en/learn/ltm-health-monitors) and its [monitor timing lab](https://ronutz.com/en/learn/ltm-health-monitors#lab-f5-monitor-timing) show how they combine.

## Share results

At the end of the summary, **Share results** builds a link to this page, only when you press it, that carries both boxes after the `#` (`input` for the script, `transcript` for the transcript when there is one) with every PASS and LOGIN password replaced by the bullets this page shows, in the script as written and in the transcript's `C:` lines, so no password goes as typed. Its popover says first what the link carries, then offers Copy link and, where the browser has one, its share sheet; the page's address is not changed.

Those are the passwords rule S15 masks: `PASS` ([RFC 1939](https://www.rfc-editor.org/rfc/rfc1939), section 7) and the last argument of `LOGIN` ([RFC 9051](https://www.rfc-editor.org/rfc/rfc9051), section 6.2.3), read 2026-10-27. One bullet per character, as on this page, so the receiving page reads exactly the same lines, findings and simulation: the tool's share vectors compare the two results whole. A password written with escape sequences cannot be found as written (the page masks that whole text), so it gets no link at all, and the popover names the line. Other credentials go as typed, such as an SMTP AUTH exchange ([RFC 4954](https://www.rfc-editor.org/rfc/rfc4954), Base64 that decodes to the password); the popover says so before you copy. [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) (section 3.5, read 2026-10-27) has the fragment "separated from the rest of the URI prior to a dereference", so the copy is not sent to the server when the link is opened; it stays in the address bar and the history of whoever opens it, and anyone who has the link can read it.

- **How long.** At most 16,384 characters in all, the bound the site uses for every value after the `#`; a longer share gets no link, and the popover says how long it is.
- **Opening a link.** Both boxes fill as a paste would (a transcript the link does not carry is emptied) and the page reads them. Nothing connects to anything and nothing runs. The values then leave the page's address at once, without a request, so a reload or the page's own Share button carries nothing.

## Limits

- The explainer applies F5's published rules. What a given BIG-IP build does beyond them, it cannot know; where the documentation is silent it says undetermined instead.
- The transcript is yours: the simulator does not know how your server really answers, how fast, or whether it answers only part of a reply.
- The credential check is a pattern: `PASS x` and `tag LOGIN user password`. A password sent another way (AUTH, for example) is not recognized.
- Test the real monitor on the system: `tmsh run ltm monitor scripted NAME destination ADDRESS:PORT`, then `tmsh show ltm monitor scripted NAME test-result`, or the Test button in the Configuration utility.

## API

The same engine answers the `/api/v1/bigip-scripted-monitor-explainer` operation of the site's HTTP API, described in the OpenAPI contract on the [API page](https://ronutz.com/en/api); the contract also says whether this site serves the API.

- **Request.** A JSON object, `{"script": "...", "transcript": "..."}`, in the body of a POST or in the `input` query parameter of a GET; the transcript may be empty or left out. The script is limited to 32,768 characters and the transcript to 65,536.
- **Response.** `lines` (each with `line`, `raw`, `kind`, `keyword`, `written`, `quoted`, `decoded`, `length`, `ending`, `hint`, `secret`, `breaks` and `open`), `findings` (`rule`, `severity`, `line`, `params`), `counts`, `sends`, `expects`, `endsWithLf`, `transcript` (`replies`, `clientLines`, `ignoredLines`) and `simulation` (`verdict`, `stopLine`, `reason`, `steps`, `unreadReplies`, `unusedClientLines`, `notes`), the last two null when no transcript is given. A password is masked in every field.

## Sources

- [F5, BIG-IP 21.1.0 LTM Monitors Reference, Monitors Settings Reference: Scripted monitor settings, the escape sequences and F5's SMTP example; the TCP Receive String and which monitors support regular expressions](https://techdocs.f5.com/en-us/bigip-21-1-0/big-ip-local-traffic-manager-monitors-reference/monitors-settings-reference.html#scripted-monitor-settings) (read 2026-10-27)
- [F5 TMSH Reference v17, ltm monitor scripted: options and defaults, run and show test-result](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_monitor_scripted.html) (read 2026-10-27)
- [RFC 5321, Simple Mail Transfer Protocol](https://www.rfc-editor.org/rfc/rfc5321) (read 2026-10-27)
- [RFC 1939, Post Office Protocol, Version 3](https://www.rfc-editor.org/rfc/rfc1939) (read 2026-10-27)
- [RFC 9051, Internet Message Access Protocol (IMAP), Version 4rev2](https://www.rfc-editor.org/rfc/rfc9051) (read 2026-10-27)
- [RFC 959, File Transfer Protocol](https://www.rfc-editor.org/rfc/rfc959) (read 2026-10-27)
- Learn: [BIG-IP LTM Scripted monitors](https://ronutz.com/en/learn/bigip-ltm-scripted-monitors), [How LTM health monitors decide up or down](https://ronutz.com/en/learn/ltm-health-monitors). Related: the [Expect script explainer](https://ronutz.com/en/tools/expect-script-explainer), for Expect itself, and the [tmsh config explainer](https://ronutz.com/en/tools/f5-tmsh-config-explainer), for the `ltm monitor scripted` object that names the file.
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax](https://www.rfc-editor.org/rfc/rfc3986) (read 2026-10-27): section 3.5, the fragment, which carries a Share results link's values

## Standards and references

- [F5, BIG-IP 21.1.0 LTM Monitors Reference, Monitors Settings Reference: Scripted monitor settings](https://techdocs.f5.com/en-us/bigip-21-1-0/big-ip-local-traffic-manager-monitors-reference/monitors-settings-reference.html#scripted-monitor-settings) - LF not CR-LF line endings; exactly one space after send or expect; the text runs to the end of the line, even when quoted, and characters after a closing quotation mark break the match; a match only on a prefix of the response; the escape sequences \a \b \f \n \r \t \v \\ \'; lines read in the sequence given, with F5's SMTP example; the file in /config/eav/; Timeout 31 seconds, three times the Interval plus one; a target that does not respond within the Timeout is down; only HTTP, HTTPS, HTTP/2, TCP and UDP monitors support regular expressions
- [F5 TMSH Reference v17: ltm monitor scripted](https://clouddocs.f5.com/cli/tmsh-reference/latest/modules/ltm/ltm_monitor_scripted.html) - the options (debug, defaults-from scripted, destination *:*, filename in /config/eav/, interval 10, manual-resume, time-until-up, timeout 31, up-interval); run, stop and show ... test-result for a one-shot test
- [RFC 5321, Simple Mail Transfer Protocol (October 2008)](https://www.rfc-editor.org/rfc/rfc5321) - lines end in CRLF and nothing else is a line terminator (2.3.8); the 220 greeting and the 554 refusal (3.1, 4.3.2); EHLO's multiline reply, 250- on all but the last line (4.1.1.1, 4.2.1); QUIT and 221 (4.1.1.10)
- [RFC 1939, Post Office Protocol, Version 3 (May 1996)](https://www.rfc-editor.org/rfc/rfc1939) - commands and responses end in CRLF, +OK and -ERR sent in upper case (3); the greeting and QUIT in the AUTHORIZATION state (4); USER and PASS (7)
- [RFC 9051, Internet Message Access Protocol (IMAP), Version 4rev2 (August 2021)](https://www.rfc-editor.org/rfc/rfc9051) - lines end in CRLF (2.2); LOGOUT answered by an untagged BYE before the tagged OK (6.1.3); LOGIN carries a plaintext password and is not to be used on unprotected connections (6.2.3); the OK, PREAUTH and BYE greetings (7.1.1, 7.1.5)
- [RFC 959, File Transfer Protocol (October 1985)](https://www.rfc-editor.org/rfc/rfc959) - commands end with the Telnet end-of-line code, CRLF (4); replies and multi-line replies (4.2); 120, 220 and 421 on connection, 221 to QUIT, 230 and 331 (4.2.2, 5.4)

## Related reading

- [ADC and GSLB redundancy: health monitors, pools and site failover](https://ronutz.com/en/learn/adc-and-gslb-redundancy-health-monitors-pools-and-site-failover.md): An application delivery controller and a global load balancer decide where traffic goes from what their probes say, so their redundancy is only as good as the probe, the rule that turns probe results into a verdict, and the time a verdict takes to reach clients. This part compares health checks, backup tiers, draining and slow start across F5, Fortinet, HAProxy, NGINX, Envoy, Kubernetes and the three large clouds, works out what DNS time-to-live and resolver behaviour do to site failover, sets anycast against DNS with the measurements, and reads the operators' reports in which health checks removed healthy capacity or passed a fault through. After reading, you can compute how long a member, a pool or a site takes to leave and return to service, choose thresholds knowing what each costs in false verdicts, and decide what your design should do when every probe says no.
- [BIG-IP LTM Scripted monitors: send, expect, and a match that only reads the start](https://ronutz.com/en/learn/bigip-ltm-scripted-monitors.md): A Scripted monitor is the BIG-IP's own small send-and-expect dialogue: a file of lines it sends to a pool member and lines it expects back, read strictly in order. It looks like Expect and is nothing like it: no Tcl, no patterns, no search, and a match that only ever compares the start of the reply. Here are its settings in tmsh and the Configuration utility, the rules F5 states and the questions F5 leaves open, worked scripts for SMTP, POP3, IMAP and FTP built from each protocol's RFC, and how it differs from Expect, from External monitors and from a Receive String.
- [BIG-IP Pools and Load-Balancing Methods](https://ronutz.com/en/learn/bigip-pools-and-load-balancing.md): A pool is the group of backend members a virtual server sends traffic to, and the load-balancing method decides which member gets each connection. The methods split into static ones that follow a fixed pattern and dynamic ones that react to live load, and the choice shapes how evenly and how smartly traffic spreads.
- [Health checks, persistence and the two questions every load balancer answers](https://ronutz.com/en/learn/health-checks-persistence-and-the-two-questions.md): Whatever its brand, a load balancer answers two questions before its algorithm is ever consulted: may this server take traffic, and must this client go back to where it was? This part treats both vendor-neutrally, from the standards (RFC 9110 and RFC 9112 for what a health check can ask of HTTP, RFC 6265 for the cookie that carries persistence) and from the documentation of HAProxy, NGINX, Envoy, Kubernetes, Amazon Web Services, Google Cloud and F5, with the site's BIG-IP articles as the worked examples. It writes out a health request byte by byte, turns probe timers into a second-by-second timeline with the requests lost, follows one client's requests through a persistence table while a server fails and another drains, works the remapping that a server's departure causes with plain and consistent hashing, and shows where the two answers collide. After it you can read any load balancer's configuration as answers to the two questions and predict what it does when they disagree.
- [How LTM Health Monitors Decide Up or Down](https://ronutz.com/en/learn/ltm-health-monitors.md): A health monitor is the probe a BIG-IP uses to decide whether a backend member can receive traffic. Its send and receive strings, its interval and timeout, and where it is attached together determine how quickly a failure is noticed and how a member is marked down.
