Shell Command Action script not writing to file

book

Article ID: 196404

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

We are trying to create a shell command action. The script is on the following path: /introscope/scripts/recycle_ABC/introscope_ABC.sh.
The $1 is the user's defined field and $2 is the parameters we can choose from the right.
To validate the execution, we have created a simple script, that will write to a file the values of $1 and $2.

#!/bin/bash

echo "Run" >> ABC_introscope.txt
echo "First parameter value $1" >> ABC_introscope.txt
echo "Second parameter value $2" >> ABC_introscope.txt

echo -e "\n"

We can see below configuration on Workstation:

 
We do not see any thing written in the ABC_introscope.txt file.

We do not see any errors on IntroscopeEnterpriseManager.log file, just see executions of the script:

7/30/20 11:12:25.707 AM CDT [INFO] [PO:main Mailman 5] [Manager.Action] Test requested of Action "Recycle_ABCOOL".
7/30/20 11:12:25.711 AM CDT [INFO] [Alarm Pooled Worker] [Manager.Action] Action "Recycle_ABCOOL" successfully executed shell command "/introscope/scripts/recycle_ABC/introscope_ABC.sh"

Environment

Release : 10.7.0

Component : APMISP

Resolution

On the output log file ABC_introscope.txt, the full path to the log file was not provided, which seems to be the case of this issue. 

So, the script should look as follows:

#!/bin/bash

echo "Run" >> /introscope/scripts/recycle_ABC/ABC_introscope.txt
echo "First parameter value $1" >> /introscope/scripts/recycle_ABC/ABC_introscope.txt
echo "Second parameter value $2" >> /introscope/scripts/recycle_ABC/ABC_introscope.txt

echo -e "\n"

Attachments