0001: CRT "X906944 Start ":OCONV(DATE(),'D2'):" ":OCONV(TIME(),'MTS') 0002: OPEN '',"x906944" TO FL ELSE STOP "NO FILE" 0003: EOT = '' 0004: USERID = '' 0005: EXECUTE "! cat /etc/passwd " CAPTURING ALL.THE.USERS 0006: NO.USER = DCOUNT(ALL.THE.USERS,@FM) 0007: FOR XX = 1 TO NO.USER 0008: USERID = FIELD(ALL.THE.USERS<XX>,':',1) 0009: IF USERID NE '' THEN 0010: FOUND = '' 0011: C="! users" 0012: EXECUTE C CAPTURING R 0013: CONVERT ' ' TO @FM IN R 0014: N=DCOUNT(R,@FM) 0015: FOR I = 1 TO N 0016: L = R<I> 0017: IF L = USERID THEN 0018: FOUND = 1 0019: EXIT 0020: END 0021: NEXT 0022: READ REC FROM FL,USERID:'*':DATE() THEN 0023: END ELSE 0024: REC = '' 0025: END 0026: LASTPOS = DCOUNT(REC<1>,@VM) 0027: BEGIN CASE 0028: CASE REC<1,LASTPOS> = "OFF" AND FOUND 0029: REC<2,-1> = OCONV(TIME(),'MTS') 0030: REC<1,-1>='ON' 0031: REC<3,-1>=OCONV(DATE(),'D4/') 0032: GOSUB UPDATETIMES 0033: WRITE REC ON FL,USERID:'*':DATE() 0034: CASE REC<1,LASTPOS> = "" AND FOUND 0035: REC<2,-1> = OCONV(TIME(),'MTS') 0036: REC<1,-1>='ON' 0037: REC<3,-1>=OCONV(DATE(),'D4/') 0038: GOSUB UPDATETIMES 0039: WRITE REC ON FL,USERID:'*':DATE() 0040: CASE REC<1,LASTPOS> = 'OFF' AND NOT(FOUND) 0041: CASE REC<1,LASTPOS> = 'ON' AND FOUND 0042: GOSUB UPDATETIMES 0043: WRITE REC ON FL,USERID:'*':DATE() 0044: CASE REC<1,LASTPOS> = 'ON' AND NOT(FOUND) 0045: REC<2,-1> = OCONV(TIME(),'MTS') 0046: REC<1,-1>='OFF' 0047: REC<3,-1>=OCONV(DATE(),'D4/') 0048: WRITE REC ON FL,USERID:'*':DATE() 0049: CASE 1 0050: END CASE 0051: END 0052: NEXT XX 0053: CRT "X906944 End ":OCONV(DATE(),'D2'):" ":OCONV(TIME(),'MTS') 0054: RETURN 0055: UPDATETIMES: 0056: CMD = "! ps -ef | grep ":USERID:" | grep -v grep " 0057: EXECUTE CMD CAPTURING PIDLIST 0058: NO.PIDS = DCOUNT(PIDLIST,@VM) 0059: FOR AA = 1 TO NO.PIDS 0060: LNE = TRIM(PIDLIST<AA>) 0061: PID = FIELD(LNE,' ',2) 0062: TME = FIELD(LNE,' ',7) 0063: TME = ICONV(TME,'MT') 0064: LOCATE PID IN REC<4,1> BY 'AR' SETTING PIDPOS THEN 0065: REC<5,PIDPOS> = TME 0066: REC<6,PIDPOS> = TIME() 0067: END ELSE 0068: REC<4,PIDPOS> = PID 0069: REC<5,PIDPOS> = TME 0070: REC<6,PIDPOS> = TIME() 0071: END 0072: NEXT AA 0073: RETURN 0074: END
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lunt, Bruce Sent: 05 November 2008 17:50 To: [email protected] Subject: [U2] [UD HP-UX] I need to track user logins Hi All, I need to provide a report that shows what users have not been on the system for the last 90 days. I don't know how to do this and was hoping that someone out there could help me. Thanks in advance, Bruce Lunt ------- 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 ______________________________________________________________________ Confidentiality Notice: This e-mail and any attachments are intended solely for the addressee and may contain confidential or privileged information. If you are not the named addressee, or the person responsible for delivering the message to the named addressee, please notify the sender as soon as possible and delete the material from your computer. This message will be protected by copyright. If it has come to you in error, you must not take any action based on its contents nor must you copy or show the message to any person other than the intended recipient. _____________________________________________________________________ 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/
