Using the triptime: option events with the round trip time will be generated.
This handler is more useful than the vanilla tcphandler in that it can distinguish between failure to connect() and proper server responses. A 'noservice' event indicates that there does exists a running server on that port yet no service is available. This may indicate a misbehaving processes or incorrect program bound to the port.
Regex's are POSIX 1003.2 "extended" form.
Wire keywords (standard handler keywords documented in Wire )
set noconnect create event { name: "noconnect" priority: 1 } set noservice create event { name: "noservice" priority: 1 }
create handler tcptxt { url: ftp://ftp.mydomain.com cmd: "QUIT\r\n" regexp: "^221" defaultport: 21 noconnect: $noconnect noservice: $noservice timeout: 5 cycletime: 60 }Events generated:
| Event Name | Type | Description |
|---|---|---|
| connect | AW_EVENT_TYPE_STRING | Was able to connect, send string of "url" |
| noconnect | AW_EVENT_TYPE_STRING | Was NOT able to connect, send string of "url" |
| service | AW_EVENT_TYPE_STRING | Regex match in line of return text indicating success of cmd, send string of "url" |
| noservice | AW_EVENT_TYPE_STRING | No regex match in any line of return text indicating NO success, send string of "url" |
| triptime | AW_EVENT_TYPE_INT32 | Estimated round trip time in usec |
#include <regex.h>
#include "sysnet.h"
#include "monitor.h"
#include "wire.h"
Go to the source code of this file.
Data Structures | |
| struct | aw_tcptxthandler_events_t |
| Events generated. More... | |
| struct | aw_tcptxthandler_state_t |
| State of handler during probing. More... | |
| struct | aw_tcptxthandler_t |
| Handler object. More... | |
Defines | |
| #define | AW_TCPTXTHANDLER_READ_BUFFER_SIZE 4096 |
Enumerations | |
| enum | aw_tcptxthandler_state_cd_t { AW_TCPTXTHANDLER_IDLE, AW_TCPTXTHANDLER_WAIT_CONNECT, AW_TCPTXTHANDLER_WAIT_WRITE, AW_TCPTXTHANDLER_WAIT_READ, AW_TCPTXTHANDLER_DONE } |
| The state codes for each state on handler. More... | |
Functions | |
| aw_tcptxthandler_t * | aw_create_tcptxthandler (const aw_tcptxthandler_events_t *events, const byte_t *url, const u_int32_t default_port, const byte_t *cmd, const byte_t *regexp, const aw_timestamp_t timeout, int32_t(*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), int32_t(*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), const aw_alarm_sched_t *sched, aw_logger_t *logger) |
| Create a tcptxt handler. | |
| void | aw_free_tcptxthandler (aw_tcptxthandler_t *p) |
| Free handler and all associated resources. | |
| int32_t | aw_init_tcptxthandler (aw_tcptxthandler_t *h, const aw_tcptxthandler_events_t *events, const byte_t *url, const u_int32_t default_port, const byte_t *cmd, const byte_t *regexp, const aw_timestamp_t timeout, int32_t(*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), int32_t(*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), const aw_alarm_sched_t *sched, aw_logger_t *logger) |
| Init a tcptxt handler. | |
| aw_handler_t * | aw_wire_tcptxthandler (aw_wire_mkhandler_args_t *args) |
| Create a tcptxt handler using "wire". See header doc for keyword documentation. | |
| aw_handler_t * | aw_wire_tcptxthandler_wrapper (const u_int32_t default_port, const byte_t *cmd, const byte_t *regexp, aw_wire_mkhandler_args_t *args) |
| Create a tcptxt handler from a wrapper (e.g., ftp) using "wire". See header doc for keyword documentation. | |
|
|
|
|
|
The state codes for each state on handler.
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Create a tcptxt handler. aw_create_tcptxthandler
|
|
|
Free handler and all associated resources. aw_free_tcptxthandler
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Init a tcptxt handler. aw_init_tcptxthandler
|
|
|
Create a tcptxt handler using "wire". See header doc for keyword documentation. aw_wire_tcptxthandler |
|
||||||||||||||||||||
|
Create a tcptxt handler from a wrapper (e.g., ftp) using "wire". See header doc for keyword documentation. aw_wire_tcptxthandler_wrapper
|