Hi everyone,
I'd like to know how to make an agent create a file on a remote host via a shell script.
I've already done a little script which should store configuration informations in a specific file, that script works well localy but when i make the RMA execute it, it looks that there is no problem but i don't know where my agent creates my file, i didn't find anything in the main rma folder or in the tmp rma folder.
Do you have any clues please??
Create a file (remote) with an agent
Well to precise a bit....
I understood that the agent execute my script as a new process on teh remote host so it should create my file where that process is launched...but where??
My script simply do a "touch" command and then add all information i need in it.
Well, i don't know what to add...
Thx for any rely.
Vini
I understood that the agent execute my script as a new process on teh remote host so it should create my file where that process is launched...but where??
My script simply do a "touch" command and then add all information i need in it.
Well, i don't know what to add...
Thx for any rely.
Vini
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Hello,
I cann't find my mistake.
I created an Action Profile to run external program. It should be executed by an agent (Unix).
Command line:
/usr/bin/echo %Reply_CStyle% >> /opt/hostmonitor/test.txt
Window mode:
SW_HIDE
After status change, there isn't a file in the specified folder. Why?
The RMA runs correctly and executes a lot of shell script tests, but it doesn't run the command of the Action Profile.
Regards,
ataudte
I cann't find my mistake.
I created an Action Profile to run external program. It should be executed by an agent (Unix).
Command line:
/usr/bin/echo %Reply_CStyle% >> /opt/hostmonitor/test.txt
Window mode:
SW_HIDE
After status change, there isn't a file in the specified folder. Why?
The RMA runs correctly and executes a lot of shell script tests, but it doesn't run the command of the Action Profile.
Regards,
ataudte
That's because output redirection (>>) is processed by command shell. In your case shell is not executed.
I would recommend to create simple script, e.g. /usr/rma/testlog.sh
============
#/bin/sh
/usr/bin/echo $1 >> /opt/hostmonitor/test.txt
============
Then HostMonitor can execute the following command
sh /usr/rma/testlog.sh %Reply_CStyle%
Regards
Alex
I would recommend to create simple script, e.g. /usr/rma/testlog.sh
============
#/bin/sh
/usr/bin/echo $1 >> /opt/hostmonitor/test.txt
============
Then HostMonitor can execute the following command
sh /usr/rma/testlog.sh %Reply_CStyle%
Regards
Alex