IBM i Global

 View Only
Expand all | Collapse all

How to find which program is using specific command

  • 1.  How to find which program is using specific command

    Posted Thu December 26, 2024 02:31 PM

    Hi ,

    Apart from find string, we wanted to check how to find programs/jobs using one specific command. There is one third party vendor command our processes uses and we are not going to use that henceforth. We have changed our programs to not to use that command however still it's use date is changing monthly. So not sure how to check it.  Could you please help. Thank you! 



    ------------------------------
    Ujwala Kavathekar
    ------------------------------


  • 2.  RE: How to find which program is using specific command

    Posted Thu December 26, 2024 08:45 PM

    Dear Ujwala

    You can start audit journaling just on that particular command object to see which jobs access it.  More details here: Planning the auditing of object access at https://www.ibm.com/docs/en/i/7.4?topic=auditing-planning-object-access         



    ------------------------------
    Satid S
    ------------------------------



  • 3.  RE: How to find which program is using specific command

    Posted Thu December 26, 2024 08:54 PM
    Edited by Satid S Thu December 26, 2024 08:58 PM

    Some more useful reference info on IBM i object access auditing:  

    Tracking Access to Your Sensitive Files By Dan Riehl at https://www.securemyi.com/nl/articles/objaud.html                    

    Auditing and Reporting the Use of CL Commands By Dan Riehl at  https://www.securemyi.com/nl/articles/cmdaudit.html    



    ------------------------------
    Satid S
    ------------------------------



  • 4.  RE: How to find which program is using specific command

    Posted Fri December 27, 2024 08:45 AM

    You could also use the QIBM_QCA_RTV_CMD exit point to register a program to get control when a command is used.

    https://www.securemyi.com/articles/artcmdexit2.htm



    ------------------------------
    Barbara Morris
    ------------------------------



  • 5.  RE: How to find which program is using specific command

    Posted Mon December 30, 2024 10:04 AM

    Hello
    Besides object auditing and RTV_CMD exit point, you may want to try PRTCMDUSG command. However, I believe that its output does not include commands called through QCMDEXC API and SQL function.



    ------------------------------
    Marc Rauzier
    ------------------------------



  • 6.  RE: How to find which program is using specific command

    Posted Tue December 31, 2024 08:43 AM

    Have you considered something like this:  Create a duplicate object of the command (for example your command is named CMDA) like CMDADUP.  Then create a program that accepts the same parameters as the program specified on CMDA.  This program can then fetch the call stack, output some log file, print the joblog, whatever you need.  Then lastly just execute CMDADUP with the received parameters.  Then just change the program executed by CMDA to your version, and you should be able to find out the information your program can determine.  Of course you need the authority to these objects.



    ------------------------------
    Mike Overlander
    ------------------------------



  • 7.  RE: How to find which program is using specific command