ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Initiate a call command on every new login to AS400 server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Initiate a call command on every new login to AS400 server

    Hi,

    I'm working on this request. Here I'm required to log the login date & time for every new login to an as400 server & back off the user if his ID is not available in a file.
    I'm able to write a CL program to implement the above requirement.

    Issue I'm facing is that program is working fine when initiated from the command line. I'm not able to identify how to get this program initiated automatically on every new login.

    Please give me some ideas that I could try to implement for auto initiation of this requirement.

    Thanks in advance for all the help & guidance !!

  • #2
    Maybe set your program as the initial program to run in the users' user profiles?

    Comment


    • #3
      FYI, the history log logs all jobs starting and ending. As interactive sessions are just jobs to the system, they are logged there so the system may be fulfilling your requirements for logging the start date/time for interactive jobs already.

      To initiate your program, as Viking has mentioned, you could add it to the profiles initial program. If that isn't possible, you could add your program as a routing entry in the interactive subsystem.

      Comment


      • #4
        Aside from the initial program suggestion and routing entry suggestion that you've already received... another way is using the QIBM_QWT_JOBNOTIFY exit point. This lets you set up a data queue that will receive an entry every time a job starts or ends on the system. In the past, I have used this to make a database that kept track of every interactive job.

        This was a long time ago that I did this, but as I recall the program worked something like this (pseudo-code)

        1) Set up the QIBM_QWT_JOBNOTIFY exit point to put all job start/end into a data queue.

        2) A never-ending batch program waits on the data queue for new entries to appear.

        3) For each new entry, it retrieves the job information to find out if it is an interactive job.

        4) When this is a start request for an interactive job, the job's number/userid/name, ip address, and logon time (current time) are written to a physical file.

        5) When this is an end request, it chains back to the PF from step 4, and updates the logoff time with the current time.

        You could, of course, write any code you like -- my requirement was just to know who logged on/off and from which IP address. Anyway, this worked really well, I could do queries on any userid to see when they were logging on/off, how long they were spending on, who was logging on from outside the LAN, etc.

        Comment

        Working...
        X