Operating System - HP-UX
1754366 Members
4911 Online
108813 Solutions
New Discussion юеВ

Remsh to stop / start measureware on HP-UX 11.00

 
ES UNIX Team
Advisor

Remsh to stop / start measureware on HP-UX 11.00

For some reason my script works OK with a single exception, the remsh does not exit the remote box and hangs the scripts execution after the first host. I am looking for possible suggestions, etc. It seems to be an issue with MeasureWare itself and I have tried substituting the /sbin/init.d path with the /opt/perf/bin path as well with no luck. Any help is greatly appreciated!!! The script is as follows:

#!/bin/sh -x

dbexec="/opt/pgsql/bin/psql -t -U username -d web -c "
query="SELECT server
FROM usa_mwa
WHERE status LIKE '%Down'"
stop="/sbin/init.d/mwa stop"
start="/sbin/init.d/mwa start"

for i in $($dbexec "$query"); do
remsh $i "$stop; $start"
done
7 REPLIES 7
Steve Steel
Honored Contributor

Re: Remsh to stop / start measureware on HP-UX 11.00

Hi


Interesting Idea

Try 2 x remsh

1 to stop

1 to start

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
ES UNIX Team
Advisor

Re: Remsh to stop / start measureware on HP-UX 11.00

Steve,

Thanks for the input, just tried using two remsh's but it hung on the second as before. Definitely a good idea though...

I guess it is also helpful to know that I have tried running the stop / start process under different shells as well as a background command with the same results. I think it is more of an issue with the MeasureWare start script where it wants a terminal...
Sheriff Andy
Trusted Contributor

Re: Remsh to stop / start measureware on HP-UX 11.00

I have had a memory leak w/ measureware (scopeux in particular), so what I have set up is a cronjob.

/sbin/init.d/mwa restart all

When I tried doing a stop & start w/in the same script, it created some problems. However the mwa restart all works very well. It takes quite a while before all of the processes come online though. You can check by doing a mwa status.
Sridhar Bhaskarla
Honored Contributor

Re: Remsh to stop / start measureware on HP-UX 11.00

Hi,

remsh with -n will take care of background issues. Try

Start the shell with 'set -x' to ensure that things are working the way expected.

remsh $i -n "$stop:$start"

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
ES UNIX Team
Advisor

Re: Remsh to stop / start measureware on HP-UX 11.00

I had already corrected the issue and switched it from remsh to ssh for security. Thanks for all of the responses.

dbexec="/opt/pgsql/bin/psql -t -U username -d web -c "
query="SELECT server
FROM usa_mwa
WHERE status LIKE '%Down'"
stop="/sbin/init.d/mwa stop"
start="/sbin/init.d/mwa start"

for i in $($dbexec "$query"); do
ssh -n $i "$stop"
ssh -n $i "$start"
done

at now + 5 minutes << EOF
/usa/bin/usa_mwacheck.sh
EOF
Muthukumar_5
Honored Contributor

Re: Remsh to stop / start measureware on HP-UX 11.00

We have to use -n to execute muliple commands on remote shell as,

remsh $i -n "$stop;$start"

If you are doing with ssh then,

ssh -n $i "$stop;$start" ( secure way )

Regards
Muthu
Easy to suggest when don't know about the problem!
Sheriff Andy
Trusted Contributor

Re: Remsh to stop / start measureware on HP-UX 11.00

If you need to use remsh, that is fine. I still think that you could eliminate the stop & start by doing;

/sbin/init.d/mwa restart all

It has the same effect as a stop & start, but I think that it is actually cleaner.