July 2nd, 2010 05:00

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

1 Rookie

 • 

122 Posts

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

445 Posts

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

16 Posts

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.

41 Posts

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

1 Rookie

 • 

122 Posts

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

736 Posts

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

1 Rookie

 • 

122 Posts

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

1 Rookie

 • 

122 Posts

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

736 Posts

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

1 Rookie

 • 

122 Posts

July 5th, 2010 08:00

why not, let us give it a try in my cygwin bash

$  echo "abc,abc,abc" | tr "," "\n" | grep -c abc
3

but do you know why this count only 5?

$  echo "session: abc,abc,abc \n abc,abc,abc;" | tr "," "\n" | grep -c abc
5

it is a special case of the bach echo command, look here:

$  echo -e "session: abc,abc,abc \n abc,abc,abc;" | tr "," "\n" | grep -c abc
6

-e     enable interpretation of backslash escapes

This is what I meant in my case not earlier. You have to be aware of such things depending on OS respective shell

echo on HPUX for example doesnt have the -e switch, also shell on SUN.

736 Posts

July 5th, 2010 08:00

Hi Holger,

You're right - this counts only the number of lines and not the number of instances and therefore makes no difference from wc -l.  I haven't given up yet though:

How about:

tr "," "\n" < session_out | grep [client_name] | wc -l

This puts a new line everywhere where there is a comma and then counts the lines that contain the client name.

-Bobby
No Events found!

Top