|
View previous topic :: View next topic |
Author |
Message |
jhancock
Joined: 24 May 2004 Posts: 1
|
Posted: Mon May 24, 2004 3:00 pm Post subject: Solaris Scripting with RMA Issues |
|
|
I have created the following test script to run through RMA, but am getting an error when I try and insert any if...else, or two ifs in a script. I am runnning on Solaris 2.8 (Sparc)
Below is a test script:
--------------------Script----------------
#/bin/sh
PCOUNT=`vmstat|tail -1|awk '{print $5}'`
if [ $PCOUNT -lt $1 ]
then
echo ScriptRes:Ok:$PCOUNT
fi
--------------------------------------------
which gives the following result
-----------------Result--------------------
[4:49:44 PM] Agent: ITSPARKY is going to execute "Test Script" script ...
[4:49:45 PM] Script executed, correct result received:
----------
- Status: Ok
- Reply: 43968
----------
-------------------------------------------
Now, when I try this script:
----------------------Script----------------
#/bin/sh
PCOUNT=`vmstat|tail -1|awk '{print $5}'`
if [ $PCOUNT -lt $1 ]
then
echo ScriptRes:Ok:$PCOUNT
else
echo ScriptRes:Bad:$PCOUNT
fi
----------------------------------------------
it errors with the following:
---------------------Result------------------
[4:52:56 PM] Agent: ITSPARKY is going to execute "Test Script" script ...
[4:52:56 PM] Agent error: Cannot read data
----------------------------------------------
Nothing changes except the addition of the else clause. Also, all of the scripts that came with HA are failing with the same error through RMA but will run in a shell window on the box.
Any ideas? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12801 Location: USA
|
Posted: Tue May 25, 2004 9:03 am Post subject: |
|
|
We experienced similar problem when developed agent. Problem appeared because Windows uses \r\n to separate lines (HostMonitor is Windows application).
That's why RMA for UNIX replaces \r\n to \n in any script received from HostMointor. This behavior was implemented in first version of the agent, I wonder why you experience problem...
Quote: | Nothing changes except the addition of the else clause. Also, all of the scripts that came with HA are failing with the same error through RMA but will run in a shell window on the box. |
Have no idea We checked all scripts on Sparc system before release... Unfortunately I cannot check this again because we rented Sparc station.
If you don't change scripts often, you may locate (and edit) scripts on Sparc station and use HostMonitor's Script Manager to execute script.
Regards
Alex |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|