RE: [U2] Monitoring a count of users logged on

2004-06-28 Thread alfkec
HELP PHANTOM, from TCL will show the syntax for running phantoms. The
biggest problem is the SB.LOGIN that is put in your login proc. You will
want to make sure you skip it for this program. The help gives some ideas
for doing so.

hth

P.S. Make sure you trim your replies!!
-- 
Colin Alfke
Calgary, Alberta Canada

Just because something isn't broken doesn't mean that you can't fix it

Stu Pickles


-Original Message-
From: Al DeWitt [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 26, 2004 9:34 AM
To: [EMAIL PROTECTED]
Subject: [U2] Monitoring a count of users logged on


I should have been more specific.  We are running Unidata 6.0 
on a Windows
2000 server as well as using SystemBuilder 5.2.4.

Taking what I learned here I found that system(514) will give 
me a count of
users logged on.  I have created basic program that outputs 
the info I need
to a file.  I used the SB job scheduler to create a phantom to run it.

However, I think I remember that Sleep doesn't work with job 
scheduler and I
have the program sleep for 60 seconds before looping.  Can 
anyone verify
this?

If sleep doesn't work is there a work around for me to pause 
the program and
run it every 60 seconds? Or I suppose I could run it as a 
phantom directly
out of UniData, but I don't know the command structure to 
execute that.  Can
anyone help me on this as well?

Thanks.

Al
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Monitoring a count of users logged on

2004-06-25 Thread Bob Witney
Al

Here are 2 for you

The one runs from a screen then other I execute from a crontab via a Unix
script

Hope they help

Bob



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Al DeWitt
Sent: 25 June 2004 00:10
To: ([EMAIL PROTECTED])
Subject: [U2] Monitoring a count of users logged on


I need to be able to monitor the number of users logged into the server.  I
would want this to run periodically (say every 10 minutes) Monday through
Friday, 08:00 - 15:00.  I would like the output to go to a text file for
later analysis.  The output could be as simple as Date, Time, # of Users
logged in.

Is this something I can do via UniAdmin?  Do I need to write a basic program
and run it as a phantom?

Thanks.

Al DeWitt
Stylmark, Inc.
763-574-8705
[EMAIL PROTECTED]
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__
*-%-%--*
  SUBROUTINE EWWATCHER
*--*
* This computer program is the sole copyright of TRAVELLOG SYSTEMS LTD *
* It may not be copied, reproduced or used save as licenced.   *
* Legal action will be taken against any infringement of copyright *
* and or licence agreements.   *
* (C) TRAVELLOG SYSTEMS LTD 2004   *

*  *
* . PROGRAM TITLE  *
*   EWWATCHER  *
*  *
* . PROGRAM DESCRIPTION*
*   EWWATCHER  *
*  *
*  Ver Date  Who  Description  *
*  ---   ---  ---  *
* 1.00 01 MAR 04 bob  Created  *
*  *

*  *
* . Arguments required by this routine :-  *
*   NONE   *
*  *

*  *
* . External Subroutine Calls :-   *
*   D$DRIVER   *
*  *

*  *
* . This program called from the following programs :- *
*   UNKNOWN*
*  *

*  *
* . WARNING!  LEAVE LINE BELOW FOR HEADER REGENERATION - THANK YOU *
*%*%
*
$INCLUDE TL.LIB K_COMMON
*
*
* D$004SA1 WILL SET UP SCREEN.ID HERE
*
*
  SCREEN.ID = EWWATCHER
*
  C.VERSION = 1.00
  CALL D$DRIVER(SCREEN.ID)
*
  RETURN
*
*
   END
  CRT X906944 Start :OCONV(DATE(),'D2'): :OCONV(TIME(),'MTS')
  OPEN '',x906944 TO FL ELSE STOP NO FILE
  EOT = ''
  USERID = ''
  EXECUTE ! cat /etc/passwd  CAPTURING ALL.THE.USERS
  NO.USER = DCOUNT(ALL.THE.USERS,@FM)
  FOR XX = 1 TO NO.USER
 USERID = FIELD(ALL.THE.USERSXX,':',1)
 IF USERID NE '' THEN
FOUND = ''
C=! users
EXECUTE C CAPTURING R
CONVERT ' ' TO @FM IN R
N=DCOUNT(R,@FM)
FOR I = 1 TO N
   L = RI

RE: [U2] Monitoring a count of users logged on

2004-06-25 Thread Bob Witney
I'll try that again (its is very early and we lost the footie last night)

Try this for your monitoring:

  CRT X906944 Start :OCONV(DATE(),'D2'): :OCONV(TIME(),'MTS')
  OPEN '',x906944 TO FL ELSE STOP NO FILE
  EOT = ''
  USERID = ''
  EXECUTE ! cat /etc/passwd  CAPTURING ALL.THE.USERS
  NO.USER = DCOUNT(ALL.THE.USERS,@FM)
  FOR XX = 1 TO NO.USER
 USERID = FIELD(ALL.THE.USERSXX,':',1)
 IF USERID NE '' THEN
FOUND = ''
C=! users
EXECUTE C CAPTURING R
CONVERT ' ' TO @FM IN R
N=DCOUNT(R,@FM)
FOR I = 1 TO N
   L = RI
   IF L = USERID THEN
  FOUND = 1
  EXIT
   END
NEXT
READ REC FROM FL,USERID:'*':DATE() THEN
END ELSE
   REC = ''
END
LASTPOS = DCOUNT(REC1,@VM)
BEGIN CASE
   CASE REC1,LASTPOS = OFF AND FOUND
  REC2,-1 = OCONV(TIME(),'MTS')
  REC1,-1='ON'
  REC3,-1=OCONV(DATE(),'D4/')
  GOSUB UPDATETIMES
  WRITE REC ON FL,USERID:'*':DATE()
   CASE REC1,LASTPOS =  AND FOUND
  REC2,-1 = OCONV(TIME(),'MTS')
  REC1,-1='ON'
  REC3,-1=OCONV(DATE(),'D4/')
  GOSUB UPDATETIMES
  WRITE REC ON FL,USERID:'*':DATE()
   CASE REC1,LASTPOS = 'OFF' AND NOT(FOUND)
   CASE REC1,LASTPOS = 'ON' AND FOUND
  GOSUB UPDATETIMES
  WRITE REC ON FL,USERID:'*':DATE()
   CASE REC1,LASTPOS = 'ON' AND NOT(FOUND)
  REC2,-1 = OCONV(TIME(),'MTS')
  REC1,-1='OFF'
  REC3,-1=OCONV(DATE(),'D4/')
  WRITE REC ON FL,USERID:'*':DATE()
   CASE 1
END CASE
 END
  NEXT XX
  CRT X906944 End :OCONV(DATE(),'D2'): :OCONV(TIME(),'MTS')
  RETURN
UPDATETIMES:
  CMD = ! ps -ef | grep :USERID: | grep -v grep 
  EXECUTE CMD CAPTURING PIDLIST
  NO.PIDS = DCOUNT(PIDLIST,@VM)
  FOR AA = 1 TO NO.PIDS
 LNE = TRIM(PIDLISTAA)
 PID = FIELD(LNE,' ',2)
 TME = FIELD(LNE,' ',7)
 TME = ICONV(TME,'MT')
 LOCATE PID IN REC4,1 BY 'AR' SETTING PIDPOS THEN
REC5,PIDPOS = TME
REC6,PIDPOS = TIME()
 END ELSE
REC4,PIDPOS = PID
REC5,PIDPOS = TME
REC6,PIDPOS = TIME()
 END
  NEXT AA
  RETURN
   END

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Re[2]: [U2] Monitoring a count of users logged on

2004-06-25 Thread Bill Pizer
I have this running every 60 minutes for UniData:
   
totallogins=`/usr/ud60/bin/listuser |head -4| tail -1 |awk '{print $6}'`
wwwlogins=`ps -eaf |grep udapi_slave |grep -v grep | wc -l |sed s/ //g`
ssllogins=`ps -eaf |grep udtelnet |grep -v grep |wc -l |sed s/ //g` 
dat=`date` echo 
TOT=$totallogins,WWW=$wwwlogins,SSL=$ssllogins $dat  /tmp/count_udt

---
Original Email
From: Kent Walker [EMAIL PROTECTED]
Sent: Jun 24, 2004 08:32 PM
To: [EMAIL PROTECTED],  ([EMAIL PROTECTED]) [EMAIL PROTECTED]
Subject: Re: [U2] Monitoring a count of users logged on

You'll need a way to save the fourth line of the listuser output to the 
end of a log file along with a timestamp.

UNIX or Windows?

At 04:09 PM 6/24/2004, Al DeWitt wrote:
I need to be able to monitor the number of users logged into the server.  I
would want this to run periodically (say every 10 minutes) Monday through
Friday, 08:00 - 15:00.  I would like the output to go to a text file for
later analysis.  The output could be as simple as Date, Time, # of Users
logged in.

Is this something I can do via UniAdmin?  Do I need to write a basic program
and run it as a phantom?

Thanks.

Al DeWitt
Stylmark, Inc.
763-574-8705
[EMAIL PROTECTED]

---
Kent Walker - Datatel Analyst
Information Technology - U.C. Hastings College of the Law
415-565-4635
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: Re[2]: [U2] Monitoring a count of users logged on

2004-06-25 Thread Stevenson, Charles
I do something similar on UV starting with 
   `cat /.uvhome`/bin/uvlictool report_lic
instead of UD's:
/usr/ud60/bin/listuser

(A question about uvlictool came up in the Universe Database Hang
thread this week.)

 -Original Message-
 From: Bill Pizer
 
 I have this running every 60 minutes for UniData:
  
 totallogins=`/usr/ud60/bin/listuser |head -4| tail -1 |awk 
 '{print $6}'` wwwlogins=`ps -eaf |grep udapi_slave |grep -v 
 grep | wc -l |sed s/ //g` ssllogins=`ps -eaf |grep udtelnet 
 |grep -v grep |wc -l |sed s/ //g` 
 dat=`date`
  echo 
 TOT=$totallogins,WWW=$wwwlogins,SSL=$ssllogins $dat  
 /tmp/count_udt
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Unclassified RE: [U2] Monitoring a count of users logged on

2004-06-24 Thread HENDERSON MICHAEL MR
-Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Al DeWitt
 Sent: Friday, 25 June 2004 11:10
 To: ([EMAIL PROTECTED])
 Subject: [U2] Monitoring a count of users logged on
 
 I need to be able to monitor the number of users logged into the
server.  
 I would want this to run periodically (say every 10 minutes) Monday
through 
 Friday, 08:00 - 15:00.  I would like the output to go to a text file
for 
 later analysis.  The output could be as simple as Date, Time, # of
Users 
 logged in.

 Is this something I can do via UniAdmin?  

Not as at 10.0, which is a pity - you can monitor all right but not
export
the results of the monitoring as far as I can see.  Maybe 10.1?


 Do I need to write a basic program and run it as a phantom?

Yes.  :-(
If your user numbers go up and down a lot, you might want to consider
checking every 5 or 10 seconds, keeping a maximum  minimum in named
common, 
and logging them every 10 or 15 minutes.


HTH

Mike
 
 Thanks.
  
 Al DeWitt
 Stylmark, Inc. 
 763-574-8705
 [EMAIL PROTECTED]
The information contained in this Internet Email message is intended
for the addressee only and may contain privileged information, but not
necessarily the official views or opinions of the New Zealand Defence Force.
If you are not the intended recipient you must not use, disclose, copy or 
distribute this message or the information in it.

If you have received this message in error, please Email or telephone
the sender immediately.
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Monitoring a count of users logged on

2004-06-24 Thread John Hester
Al DeWitt wrote:
I need to be able to monitor the number of users logged into the server.  I
would want this to run periodically (say every 10 minutes) Monday through
Friday, 08:00 - 15:00.  I would like the output to go to a text file for
later analysis.  The output could be as simple as Date, Time, # of Users
logged in.
 
Is this something I can do via UniAdmin?  Do I need to write a basic program
and run it as a phantom?
Here's a basic program I run from TCL in UV:
CALL !GET.USER.COUNTS  (uv.users,  max.uv.users,  os.users)
PRINT Max UniVerse users: :max.uv.users
PRINT Current UniVerse users: :uv.users
PRINT OS users  : :os.users
You could stick it in a phantom or if you're on a *nix system, run it as 
a cron job.

-John
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Monitoring a count of users logged on

2004-06-24 Thread Logan, David (SST - Adelaide)
Hi Al,

Just use a phantom writing the data to a file and then import it to
Excel for graphing. You can use the following code

  PRINT SYSTEM(35)
  TOTAL.UNIVERSE = 0
  EXECUTE 'sh -c ipcs -m|grep aceb|wc -l' CAPTURING STUFF
  TOTAL.UNIVERSE = STUFF1
  TOTAL.PHANTOMS = TOTAL.UNIVERSE - SYSTEM(35)
  PRINT SYSTEM(37)
  PRINT TOTAL.PHANTOMS

This give the total universe users rather than the number of interactive
sessions. You can change the prints to writing the totals out to a file.


I use the ipcs command (this is on a unix box, it won't work on a
Windows machine) to count totals which include the phantoms as the
system(35) call only seems to count the interactive sessions or those
which take a license. 

You should be able to use a scheduler of some kind (cron on unix) to
make it run every 10-15 minutes and log the results. You can then import
it direct to Excel for further analysis.

Regards

David Logan
Database Administrator
HP Managed Services
139 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Al DeWitt
Sent: Friday, 25 June 2004 8:40 AM
To: ([EMAIL PROTECTED])
Subject: [U2] Monitoring a count of users logged on


I need to be able to monitor the number of users logged into the server.
I
would want this to run periodically (say every 10 minutes) Monday
through
Friday, 08:00 - 15:00.  I would like the output to go to a text file for
later analysis.  The output could be as simple as Date, Time, # of Users
logged in.
 
Is this something I can do via UniAdmin?  Do I need to write a basic
program
and run it as a phantom?
 
Thanks.
 
Al DeWitt 
Stylmark, Inc. 
763-574-8705 
[EMAIL PROTECTED] 
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/