Wire keywords (standard handler keywords documented in Wire )
Example:
// watch password file, send events on mtime or deleted set passwdchange create event { name: "passwd changed" } create handler filestat { filename: /etc/passwd file-created: $passwdchange file-deleted: $passwdchange file-mtime-change: $passwdchange cycletime: 300 }
Events generated:
| Event Name | Type | Description |
|---|---|---|
| file_exists | AW_EVENT_TYPE_STRING | File exists at handler start, send filename |
| file_notexists | AW_EVENT_TYPE_STRING | File does not exist at handler start, send filename |
| file_created | AW_EVENT_TYPE_STRING | New file, send filename |
| file_deleted | AW_EVENT_TYPE_STRING | File deleted, send filename |
| file_size | AW_EVENT_TYPE_INT32 | Size of file (bytes) |
| file_size_change | AW_EVENT_TYPE_INT32 | Size of file change since last poll (bytes) |
| file_mtime | AW_EVENT_TYPE_INT32 | Last modified time (time_t) |
| file_mtime_change | AW_EVENT_TYPE_INT32 | Last modified time changed since last poll (seconds) |
Events accepted:
| Type | Description |
|---|---|
| Any | Generate an event of type requested |
#include <regex.h>
#include "monitor.h"
#include "wire.h"
Go to the source code of this file.
Data Structures | |
| struct | aw_filestathandler_events_t |
| Events generated. More... | |
| struct | aw_filestathandler_state_t |
| State of handler during probing. More... | |
| struct | aw_filestathandler_t |
| Handler object. More... | |
Functions | |
| aw_filestathandler_t * | aw_create_filestathandler (const aw_filestathandler_events_t *events, const char *filename, int32_t dont_log_file_not_found, 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 filestat handler. | |
| void | aw_free_filestathandler (aw_filestathandler_t *p) |
| Free handler and all associated resources. | |
| aw_handler_t * | aw_wire_filestathandler (aw_wire_mkhandler_args_t *args) |
| Create a filestat handler using "wire". See header doc for keyword documentation. | |
|
||||||||||||||||||||||||||||||||
|
Create a filestat handler. aw_create_filestathandler
|
|
|
Free handler and all associated resources. aw_free_filestathandler
|
|
|
Create a filestat handler using "wire". See header doc for keyword documentation. aw_wire_filestathandler |