UNSOLVED

PRATAPSIMHA

updated

16 years ago

P

PRATAPSIMHA

41 Posts

1

8387

July 2nd, 2010 00:00

How to check the sessions running through cli

How to check the number of sessions running for a particular client using CLI

  • 5174

    0

    Posted July 2nd, 2010 05:00

    If you are Unix/linux  Networker server  you can use   following  NSRWATCH comand.

  • Holger_Inf

    1 Rookie

    •

    122 Posts

    5174

    0

    Posted July 2nd, 2010 06:00

    nsrwatch doesnt count the sessions, it also show not all sessions

    you should use nsradmin

    show session

    print type: nsr

    you may use it with an input file and process the output with awk for example.

    Anything after the ':' are the sessions, sessions are separated by a ',' but may be

    divieded probably on multiple lines untile a ';' which mark the end of the session list

    If you properly format the output one session per line you may count the session

    with wc -l

    On Windows?? Use a linux client to start nsradmin against the server

  • masonb

    445 Posts

    3007

    0

    Posted July 2nd, 2010 07:00

    Pratapsimha,

    Maybe if you describe in more detail what you are trying to achieve and why you need to do this from command line rather than GUI we may be able to assist more?

    Regards,

    Bill Mason

  • 3007

    0

    Posted July 2nd, 2010 07:00

    From nsradmin we can check the status of the group, like its running or idle or failed.

    nsradmin

    . type: NSR group

    p

    there is no option to see  session in cli.

  • PRATAPSIMHA

    41 Posts

    5185

    0

    Posted July 2nd, 2010 20:00

    Hi ,

    Is it possible to look the sessions ruunign by giving one command if yes, then please help me to get this ☺

    Thanks & Regards

    Pratapsimha MP

    L2 ,ITO DO India Cluster – Assigned to Pfizer

    HP Enterprise Services

    Pratapsimha.mp@pfizer.com|pratapsimha.mp@hp.com

    HP Avenue, 39/40, Electronics City | Hosur Road

    GCI | Bangalore| India

    www.hp.com

    24 x 7 Support Contact Info:

    Via Email,* please send an E-mail to Group Mailbox: pfizer.backup@hp.com

    Via Phone, ( please contact Team Mobile : 91-974-096-6855 |Service Desk: 1-877-733-4357

  • Holger_Inf

    1 Rookie

    •

    122 Posts

    5185

    0

    Posted July 4th, 2010 01:00

    There is no single command available to look at all sessions. As pointet out earlier nsrwatch show you only a limited number out of the currently running sessions.

    You can take a look at all sessions from a unix linux system with this command:

    echo "show session \r\n print type: nsr" | nsradmin -i -s -

    you may look in the OS-specific man page to the echo command for options how to handle newline/carriage retourn

  • coganb

    736 Posts

    5185

    0

    Posted July 5th, 2010 00:00

    Further to Holger's solution using nsradmin, what you need to do is:

    1) Create a file (called session_in for example) using vi with the following text:

    . type: nsr
    show session
    print

    2) type:

    nsradmin -i session_in > session_out 2>&1

    This will give you the list of all sessions currently running

    3) To get the number for a particular client:

    grep [client_name] session_out | wc -l

    The number you get is the number of sessions that are running for this client.

    This works in my small test setup.  You would need to test this more thoroughly to be sure that it works in your environment.

    -Bobby

  • Holger_Inf

    1 Rookie

    •

    122 Posts

    5185

    0

    Posted July 5th, 2010 02:00

    Hi Bobby,

    the output of nsradmin may not one session per line. How the fields are separated is mentionened in my post from 02.07.2010 07:05

    If you use

    grep XXXXX | wc -l

    you count lines. In the case of more than one session of this client in one line you get a wrong number of sessions.

    Regards, Holger

  • Holger_Inf

    1 Rookie

    •

    122 Posts

    2839

    0

    Posted July 5th, 2010 07:00

    Hi Bobby,

    on what platform did you try? I tested on Linux and on cygwin, both tests produced the same result:

    $  echo "abc abc abc" | grep -c abc
    1

    If you get three please let me know, how

    Regards, Holger

  • coganb

    736 Posts

    5185

    0

    Posted July 5th, 2010 07:00

    Thanks Holger,

    How about instead of using 'wc -l', you count the number of times the client name is mentioned in the file as it will only be mentioned once for each session (?):

    grep -c [client_name] session_out

    Will that work?

    -Bobby