I’m performing data collection on about 150 RHEL servers through a script that gets copied (scp) out to each server, then run through ssh. On the monitoring server, I have:
H="ssh cshoults@ /usr/local/sc/collect.sh $SENDER $OUTPUTMETHOD "
RESULT=`$H`;
echo $RESULT;
The script returns nine values separated by colons. I’m then setting nine variables with something like this:
HST=`$H | awk -F' : ' '{ print $1}`
However, I can tell by the speed that it’s going out to the remote server each time instead of going to the server once and setting the response to a string. It’s late in the day and I’m getting irritated by this one. Can someone answer this for me? If I say HST=$RESULT…` it tries to execute the command and gives me command not found, so I know it’s not right.
If you don’t want to go to the server each time, save the result.