ONTAP 9.12.1 commands

50←PDF
  • ONTAP 9.12.1 commands(CA08871-263en.pdf)
  • security session kill-cli

    Kill a CLI session

    Availability: This command is available to cluster administrators at the admin privilege level.

    Description

    The security session kill-cli command is used to terminate CLI sessions. If the session being killed is actively processing a non-read command, the kill will wait until the command is complete before terminating the session. If the session being killed is actively processing a read (show) command, the kill will wait until the current row is returned before terminating the session.

    Parameters

    -node {<nodename>|local} - Node

    Selects the sessions that match this parameter value. This identifies the node that is processing the session.

    [-interface {cli|ontapi|rest}] - Interface

    Selects the sessions that match this parameter value. This identifies the interface (CLI, ONTAPI, or REST) that is processing the session.

    [-start-time <MM/DD HH:MM:SS>] - Start Time

    Selects the sessions that match this parameter value. This identifies the start time of the current active session.

    -session-id <integer> - Session ID

    Selects the sessions that match this parameter value. This number uniquely identifies a management session within a given node.

    [-vserver <vserver>] - Vserver

    Selects the sessions that match this parameter value. This identifies the Vserver associated with this management session.

    [-username <text>] - Username

    Selects the sessions that match this parameter value. This identifies the authenticated user associated with this management session.

    [-application <text>] - Client Application

    Selects the sessions that match this parameter value. This identifies the calling application by name.

    [-location <text>] - Client Location

    Selects the sessions that match this parameter value. This identifies the location of the calling client application. This is typically the IP address of the calling client, or "console" or "localhost" for console or localhost connections.

    [-idle-seconds <integer>] - Idle Seconds

    Selects the sessions that match this parameter value. When a session is not actively executing a command request (the session is idle), this indicates the time (in seconds) since the last request completed.

    [-state {pending|active|idle}] - Session State

    Selects the sessions that match this parameter value. This identifies the state (pending, active, or idle) of the session. The state is "pending" if it hit a session limit and the session is waiting for another session to end. The state is "idle" for CLI sessions that are waiting at the command prompt. The state is "active" if the session is actively working on a request.

    [-request <text>] - Active Command

    Selects the sessions that match this parameter value. This identifies the request (command) that is currently being handled by the session.

    Examples

    The following example illustrates killing a CLI session by specifying the node and the session id.

    cluster1::> security session show -node node1
    
    Node: node1               Interface: cli                                   Idle
    Start Time     Sess ID Application Location           Vserver Username  Seconds
    -------------- ------- ----------- ------------ ------------- -------- --------
    03/27 16:58:13 1358    console     console           cluster1 admin           -
        Active Seconds: 0  Request: security session show
    03/27 16:58:17 1359    ssh         10.98.16.164      cluster1 admin         650
    2 entries were displayed.
    
    cluster1::>
    
    cluster1::> security session kill-cli -node node1 -session-id 1359
    1 entry was acted on.
    
    cluster1::> security session show -node node1
    
    Node: node1               Interface: cli                                   Idle
    Start Time     Sess ID Application Location           Vserver Username  Seconds
    -------------- ------- ----------- ------------ ------------- -------- --------
    03/27 16:58:13 1358    console     console           cluster1 admin           -
        Active Seconds: 0  Request: security session show
    
    cluster1::>

    The following example illustrates killing a CLI session by specifying the node and specifying a query on idle-seconds.

    cluster1::> security session show -node node1
    
    Node: node1               Interface: cli                                   Idle
    Start Time     Sess ID Application Location           Vserver Username  Seconds
    -------------- ------- ----------- ------------ ------------- -------- --------
    03/27 16:58:13 1358    console     console           cluster1 admin           -
        Active Seconds: 0  Request: security session show
    03/27 17:13:36 1479    ssh         10.98.16.164      cluster1 admin          83
    2 entries were displayed.
    
    cluster1::> security session kill-cli -node node1 -session-id * -idle-seconds > 80
    1 entry was acted on.
    
    cluster1::> security session show
    
    Node: node1               Interface: cli                                   Idle
    Start Time     Sess ID Application Location           Vserver Username  Seconds
    -------------- ------- ----------- ------------ ------------- -------- --------
    03/27 16:58:13 1358    console     console           cluster1 admin           -
        Active Seconds: 0  Request: security session show
    
    cluster1::>
    Top of Page