Using Command Line Tools


Handlers and bindings are managed by a tool called 'traped' (TRAPper EDitor) which is located in /opt/trapper/bin. It takes a command as its first argument, then additional arguments optionally.


traped list modules

# traped list modules

Prints a list of all modules

traped list handlers

# traped list handlers

Prints a list of all handlers

traped list matches

# traped list matches

Prints a list of matches in a form: <trap_oid> <handler_name>

traped create module

# traped create module <name>

Creates an empty module <name>


# traped create module test

traped create handler

# traped create handler <name>

Creates an empty handler <name>


# traped create handler test

traped read

# traped read <name>

Prints handler/module <name> to stdout


# traped read test > test.lua

traped update

# traped update <name>

Updates handler/module <name> with a script passed via stdin


# traped update test < test.lua

traped detele

# traped delete <name>

Deletes handler/module <name>

traped bind

# traped bind { <oid> | "<pattern>" | fallback } <name>

Binds handler <name> to trap <oid>, or to all traps with oids that match <pattern>, or to all traps that were not processed by any other handler


# traped bind . test
# traped bind ".1.2.3*" test
# traped bind fallback test

Note1: * in a pattern means "a substring of any length consisting of any symbols"

Note2: you must enclose pattern in quotes

traped unbind

# traped unbind { <oid> | "<pattern>" | fallback } <name>

Unbinds handler <name>, essentially reverting the same bind command

traped move

# traped move up|down { <oid> | "<pattern>" | fallback } <name>
Move match between trap and handler higher in the list, so that it can be processed sooner example:
# traped list matches
.1.2.3* test1 . test2

In case a trap with oid . comes - test1 will be processed first, then test2

# traped move up . test
# traped list matches
. test2 .1.2.3* test1

In case a trap with oid . comes - test2 will be processed first, then test1