1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Logging Output from External Programs

Discussion in 'Support' started by Timothy Garay, Feb 3, 2013.

  1. Timothy Garay

    Joined:
    Feb 3, 2013
    Messages:
    1
    Likes Received:
    0
    I am evaluating Take Command for audit logging on a couple of servers where storage arrays are managed using commandline utilities.

    Using the Log /A command, I get everything in the command window recorded to a text file except the output from these commandline utilities.

    If I execute the commandline utility and add "| tee C:\test.txt" then I do get the output from the commandline utility on the screen and in the C:\test.txt file.

    Unfortunately, it requires that the user add this to each command issued. Is there any way of turning this "tee" operation on permanently for all commands issued in the window?

    Thanks!

    -TimG
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Rex:
    Could the PRE_EXEC (or possibly the POST_EXEC) alias be used to force the output of every command to be redirected while the alias is active?
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    If there aren't too many external commands, you could create an alias for each one....
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
    You could do it with PRE_EXEC, but not POST_EXEC.
     
  5. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    Could someone give me an example for redirecting the output with PRE_EXEC? Thanks.
     

Share This Page