免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6626 | 回复: 14
打印 上一主题 下一主题

如何记录用户登录和退出的时间? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-11-25 12:41 |只看该作者 |倒序浏览
现在需要在短时间内记录几个用户的登录和退出时间(qinter内的),如何能很快的方便的获取呢?

论坛徽章:
0
2 [报告]
发表于 2005-11-25 12:59 |只看该作者
我一般的做法,就是修改用户的jobd, Log CL program commands  . . . .   *NO  
里面可以记录下用户登陆期间运行的CL命令,然后退出后会保存成splf文件。可以检查用户登陆退出时间,以及做了些什么操作。



                        Change Job Description (CHGJOBD)                        
                                                                                
Type choices, press Enter.                                                     
                                                                                
Accounting code  . . . . . . . .   *USRPRF                                    
Routing data . . . . . . . . . .   'QCMDI'                                    
                                                                                
Request data or command  . . . .   *NONE                                       
                                                                                
                                                                                
                                                                                
CL syntax check  . . . . . . . .   *NOCHK        0-99, *SAME, *NOCHK           
Initial library list . . . . . .   *SYSVAL       Name, *SAME, *SYSVAL, *NONE   
                + for more values                                               
End severity . . . . . . . . . .   30            0-99, *SAME                  
Message logging:                                                               
   Level  . . . . . . . . . . . .   4             0-4, *SAME                    
   Severity . . . . . . . . . . .   00            0-99, *SAME                  
   Text . . . . . . . . . . . . .   *NOLIST       *SAME, *MSG, *SECLVL, *NOLIST
Log CL program commands  . . . .   *NO           *SAME, *NO, *YES              
                                                                        More...

论坛徽章:
0
3 [报告]
发表于 2005-11-25 13:00 |只看该作者
Log CL program commands  . . . .   *NO    这个改成*yes

论坛徽章:
0
4 [报告]
发表于 2005-11-25 19:03 |只看该作者
如果想狠一点,就修改SIGNOFF的默认参数LOG(*NOLIST)—>*LOG(*LIST),每个登陆400的用户操作全记载。

不过建议短暂使用,不用时及时修改回去,因为会造成系统产生大量SPLF,会消耗系统ASP%资源的。

论坛徽章:
0
5 [报告]
发表于 2005-11-25 20:07 |只看该作者
居士兄的方法还暂时没有试,qingzhou的办法先前用过,但效果不理想,虽然可以从wrksplf 用户名中看到start和end的时间,但很不直观--log太多,我只需要starting time and end time 。

我在另一个400论坛也问了,fh2001(估计你们都知道吧)回答的方法我试了试,还不错,就是dsplog msgid(cpf1164), 很直观,一排一排的,有登录用户的结束时间。但缺点是还有其他不少log信息--筛选的还不够干净--不知道该如何做到最佳审计--仅审计用户何时登录、何时注销。
谢谢,今天下午忙坏了,所以现在才来感谢。还没吃饭。

论坛徽章:
0
6 [报告]
发表于 2005-11-26 23:57 |只看该作者
DSPLOG JOB(QZSOSIGN) MSGID(CPIAD0B CPF1164)

论坛徽章:
0
7 [报告]
发表于 2005-11-27 10:17 |只看该作者
gpm 说的方法我测试了一下。看不到用户的登陆退出信息。

另外MSG ID : CPIAD0B的描述如下:

                                                            
Message ID . . . . . . . . . :   CPIAD0B                                       
Message file . . . . . . . . :   QCPFMSG                                       
   Library  . . . . . . . . . :     QSYS                                       
                                                                                
Message . . . . :   *SIGNON server job &3/&2/&1 processing request for user &4
   on &5 in subsystem &6 in &7.                                                
Cause . . . . . :   The *SIGNON server is processing request &8 for user &4.   
   The types of requests supported are as follows:                              
     1 -- Retrieve Signon Information                                          
     2 -- Change Password                                                      
     3 -- Generate Authentication Token                                         
     4 -- Generate Authentication Token on Behalf of Another User               
     5 -- Start Server                                                         
                                                                                




Display the history log
Each time a client user successfully connects to a server job, that job is swapped to run under the profile of that client user. To determine which job is associated with a particular client user, you can display the history log with the DSPLOG command. Look for the messages starting with:

CPIAD0B (for signon server messages)
CPIAD09 (for messages relating to all other servers)


signon 服务的描述:

Signon server
The Signon server provides security for clients. This security function prevents access to the system by users with expired passwords, validates user profile passwords and returns user profile security information for use with password caching and iSeries(TM) Navigator Application Administration.

The programs listed in the following table are included with this server.
Signon server programs Program name  Library  Description  
QZSOSIGN  QSYS  Server program  
QZSOSGND  QSYS  Daemon program  


所以,gpm 说的signon服务,不是说的用户登陆,而是指系统的一个服务。所以我认为gpm说的方法是有问题的。

论坛徽章:
0
8 [报告]
发表于 2005-11-27 11:03 |只看该作者
我瞎想一下,有没有这种可能:(我在微机端这么做过),就是修改signoff的cl命令,使在signoff时获取系统时间;为用户属性增加一个字段--退出时间,将上述signoff时获取的系统时间写进该字段。
简单说就是现在400只有“上次登录时间”,没有“上次结束时间”--能否加一个呢?我不知道。

另:居士兄2楼的方法我还没有试,仔细看了一下,是否是:也是通过修改系统jobd的默认值,记录或者不记录job期间运行的cl命令,但都是有登录和退出时间的?会否即使不记录cl命令,splf(log)内还是很多内容?明天上班试一下。

大家动脑筋好好玩。

论坛徽章:
0
9 [报告]
发表于 2005-11-27 20:00 |只看该作者
修改singoff命令,记录下登陆的joblog的方法有个弊端
如果用户直接关闭窗口,就会造成无法记录

论坛徽章:
0
10 [报告]
发表于 2005-11-30 15:02 |只看该作者
以下方法不知道是否可行:
1、为该用户单独定制JobD,如MYJOBD,在MYJOBD中指定RTGDTA参数为特定字符串,如:"MYDATA"
2、将该用户的简要表中的JobD参数修改为MYJOBD
3、定制一个路由入口程序MYENTCMD。
  PGM
         /* ADD Record Start-time Process Here */
          ...
  
         Call QCMD

         /* ADD Record End-Time Process Here */
           ...
      ENDPGM

将该程序编译到 MYLIB下

4、ADDRTGE   SBSD(QINTER) SEQNBR(800)  CMPVAL("MYDATA")  PGM(MYLIB/MYENTCMD)

5、完成
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP