Fortinet Document Library

Version:


Table of Contents

5.3.0
Download PDF
Copy Link

Management commands

MGM:get_session_id()

Returns the session id.

Syntax

MGM:get_session_id();

Arguments: N/A

Examples

when HTTP_REQUEST {

sid = MGM:get_session_id()

debug(“session id: %s\n”, sid)

}

FortiADC version: V5.0

Used in events:

Used in all events except VS_LISTENER_BIND.

MGM:rand_id()

Returns a 32-long string of HEX symbols.

Syntax

MGM:rand_id();

Arguments: N/A

Examples

when HTTP_REQUEST {

rid = MGM:rand_id()

debug(“rand id is %s\n”, rid)

}

FortiADC version: V5.0

Used in events:

Used in all events 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.

Examples

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 though they are disabled in 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.

Examples

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

Management commands

MGM:get_session_id()

Returns the session id.

Syntax

MGM:get_session_id();

Arguments: N/A

Examples

when HTTP_REQUEST {

sid = MGM:get_session_id()

debug(“session id: %s\n”, sid)

}

FortiADC version: V5.0

Used in events:

Used in all events except VS_LISTENER_BIND.

MGM:rand_id()

Returns a 32-long string of HEX symbols.

Syntax

MGM:rand_id();

Arguments: N/A

Examples

when HTTP_REQUEST {

rid = MGM:rand_id()

debug(“rand id is %s\n”, rid)

}

FortiADC version: V5.0

Used in events:

Used in all events 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.

Examples

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 though they are disabled in 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.

Examples

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