Operating System - HP-UX
1834149 Members
2852 Online
110064 Solutions
New Discussion

Re: rcmd: -l: Unknown host

 
Robert DJ
Frequent Advisor

rcmd: -l: Unknown host

Hi,

am trying to do a remsh and the following error comes up in the log file,

rcmd: -l: Unknown host

Please do let me know what might be wrong in the statement, both my rhosts files and other nodes are active.

am using it in a for loop for example,

for livenode in $(remsh $live1 -l root -n /usr/sbin/cmviewcl 2>$log | awk '$1=="live"&&$2=="up"&&$3=="running" {print $5}')
do
if [[ $livenode = live1* ]]
then
print Found cluster live1
print Live application node $livenode detected
fi
done
echo " "

Thank you in advance

Regards,
Robs
Robert DJ
8 REPLIES 8
Muthukumar_5
Honored Contributor

Re: rcmd: -l: Unknown host

Can you try this:

remsh $live1 -l root -n "/usr/sbin/cmviewcl 2>$log"

what you are getting for this.?

Are you trying to redirect error messages to remote system $log file or local machine.?

hth.
Easy to suggest when don't know about the problem!
Luk Vandenbussche
Honored Contributor

Re: rcmd: -l: Unknown host

Hi,

Your are using a variable $live1 for you remote host.
Where is the variable $live1 defined.

You should add something like

live1=hostx

To check

echo $live1
Robert DJ
Frequent Advisor

Re: rcmd: -l: Unknown host

Hi,

Ive defined the live1 in my script.

The log file is in the local system, am trying to check on the cluster whether they are active and select the live node to work on.

Thank you once again.

Regards,
Robs
Robert DJ
Muthukumar_5
Honored Contributor

Re: rcmd: -l: Unknown host

Can you post the execution result as,

remsh $live1 -l root -n hostname

It is a problem with remsh execution only.

and this also.

remsh $live1 -l root -n /usr/sbin/cmviewcl 2>$log | awk '$1=="live"&&$2=="up"&&$3=="running" {print $5}'

hth.
Easy to suggest when don't know about the problem!
Robert DJ
Frequent Advisor

Re: rcmd: -l: Unknown host

Hi Muthu,

Ive check with the execution....its seem ive got wrong on my script.

am trying to get the output of cmviewcl and check which is the active and running, by these i identify the active node and proceed to the rest of my script.

For the command : remsh $live1 -l root -n hostname amd getting a valid output.

seems to me that the awk command is unable to get the output of the cmviewcl, is it right to have the 2> before the awk command.

Regards,
Robs
Robert DJ
Muthukumar_5
Honored Contributor

Re: rcmd: -l: Unknown host

Post this output for,

remsh $live1 -l root -n /usr/sbin/cmviewcl

what are you getting?

hth.
Easy to suggest when don't know about the problem!
Robert DJ
Frequent Advisor

Re: rcmd: -l: Unknown host

Hi Muthu,

Am able to get the output of the cmviewcl showing the servers cluster status and gives me info of both the nodes.

Thank you.

Regards,
Robs
Robert DJ
Muthukumar_5
Honored Contributor

Re: rcmd: -l: Unknown host

Robs,

Post the results of,

remsh $live1 -l root -n /usr/sbin/cmviewcl 2>$log | awk '$1=="live"&&$2=="up"&&$3=="running" {print $5}'

remsh $live1 -l root -n /usr/sbin/cmviewcl | awk '$1=="live"&&$2=="up"&&$3=="running" {print $5}'

remsh $live1 -l root -n /usr/sbin/cmviewcl 2>/dev/null

remsh $live1 -l root -n /usr/sbin/cmviewcl

If you post the result only, we can analyse the problem. Some times, cmviewcl is sending informations to STDERR FD.

Please post your results.
Easy to suggest when don't know about the problem!