Management commands
Management (MGM) commands script event management functions:
MGM:get_session_id() — Returns the session ID.
MGM:rand_id() — Returns a 32-character string of HEX symbols.
MGM:set_event(t) — Allows the user to disable/enable the rest of the events from executing by disabling this event.
MGM:set_auto(t) — In the case of keep-alive, all events will be re-enabled automatically even if they are disabled in the previous TRANSACTION using the HTTP:set_event(t) command. To disable this automatic re-enabling behavior, you can call HTTP:set_auto(t).
MGM:get_session_id()
Returns the session ID.
Syntax
MGM:get_session_id();
Arguments
N/A
Example
when HTTP_REQUEST { sid = MGM:get_session_id() debug(“session id: %s\n”, sid) }
FortiADC version: V5.0
Used in events: all except VS_LISTENER_BIND
MGM:rand_id()
Returns a 32-character string of HEX symbols.
Syntax
MGM:rand_id();
Arguments
N/A
Example
when HTTP_REQUEST { rid = MGM:rand_id() debug(“rand id is %s\n”, rid) }
FortiADC version: V5.0
Used in events: all except VS_LISTENER_BIND
MGM:set_event(t)
Allows the user to disable/enable the rest of the events from executing by disabling this event.
Syntax
MGM:set_event(t);
Arguments
Name | Description |
---|---|
t |
A table which specifies the event and operation. |
Example
when HTTP_REQUEST { t={}; t["event"]="req"; -- can be "req", "res", "data_req", "data_res", "ssl_client", "ssl_server", "tcp_accept", "tcp_close", "ssl_renego_client", "ssl_renego_server", "server_connected", "server_close", "server_before_connect", "vs_listener_bind", "auth_result", "cookie_bake" t["operation"]="disable"; -- can be "enable", and "disable" MGM:set_event(t); debug("disable rest of the HTTP_REQUEST events\n"); }
FortiADC version: V5.0
Used in events: ALL
MGM:set_auto(t)
In the case of keep-alive, all events will be re-enabled automatically even if they are disabled in the previous TRANSACTION using the HTTP:set_event(t) command. To disable this automatic re-enabling behavior, you can call HTTP:set_auto(t).
Syntax
MGM:set_auto(t);
Arguments
Name | Description |
---|---|
t |
A table which specifies the event and operation to enable or disable. |
Example
when HTTP_REQUEST { t={}; t["event"]="req"; t["operation"]="disable"; MGM:set_auto(t); debug("disable automatic re-enabling of the HTTP_REQUEST events\n"); }
Note: Event can be "req", "res", "data_req", "data_res", "ssl_server", "ssl_renego_server", "server_connected", "server_close", "server_before_connect." Operation can be "enable", and "disable."
FortiADC version: V5.0
Used in events: ALL