Pass Hostname to a batch script


From a triggered alert, I'm running a batch script and trying to pass the host name using this parameter %event_1.HostName% as the variable.  This worked fine using Intrust version 11.1 but, it doesn't seem to work for version 11.4.1.  Is there a different variable that I can use for hostname?  The application that is running the batch file is using %1 within the script and is not seeing the parameter that is being passed.

Parents
  • Hello Igor,

    Sorry, I mistyped the variable on my post but, I do have the correct field listed below.  The batch file that I'm trying to pass this variable to uses %1 within the batch file... The batch file looks like this.   echo %1 > logname.txt. Does Intrust allow me to echo a string into a file using ">"?

  • Hi Eddie,

    Yes, sure.

    Response Action type = Execute Command

    Application = cmd.exe

    Parameters = /C C:\Dumps\redir.cmd %event_1._HostName%

    Where C:\Dumps\redir.cmd should be changed to your script.

    Please transfer the "verified answer" mark here Stuck out tongue

  • Hello Igor,

    I attached a screen shot of the attempt you replied to me to my open Service Request # 4747601

    On the screen shot I attached, the red arrows is related to the execute command I'm trying to setup to echo the hostname into a file and the green arrow is the task to gather logs from the file where I the hostname should be in.

    As you can see on the status section, no objects were found because nothing was found in the computer list file.

Reply
  • Hello Igor,

    I attached a screen shot of the attempt you replied to me to my open Service Request # 4747601

    On the screen shot I attached, the red arrows is related to the execute command I'm trying to setup to echo the hostname into a file and the green arrow is the task to gather logs from the file where I the hostname should be in.

    As you can see on the status section, no objects were found because nothing was found in the computer list file.

Children