Hello,
I've got a bunch of ancient HP-UX boxes that I can't put SSH on, so I've got to use rsh. Long and the short of it, we've got a specific app that is connection sensitive and susceptible to network glitches - if the network drops for a split second then the user gets kicked out and a ghost session remains. So every now and then, we get a request to clear the sessions across 20 odd servers. When this happens for multiple users, it can be a very time consuming process.
So, started thinking about ways round this but ran into a bit of stick with the cronky HP-UX limitations. So, I've got a list of hosts in a text file which I'm calling in a script then running this command:
for host in `cat /tmp/hosts.txt`
do
echo $host
rsh $host ps -ef | grep 1.0.0.1 | grep -v | awk '{print $2}' | xargs kill -9
done
Now the "ps -ef | grep 1.0.0.1 | grep -v | awk '{print $2}' | xargs kill -9" bit works perfectly when executed on host, but when you rsh it the "xargs kill -9" portion of the command tries to run on the host you're rsh-ing from. Bummer.
I've been reading around, and it says to dump the command you want executed remotely into "" "" because of funkyness in HP-UX. Doesn't seem to work though as it then looks for a command called "xargs kill -9" - Failboat.
So, anyone have an idea of the syntax needed to make this work?
The dirty cheat way I used to night was to create a small shell script of the command needed and rcp it out to every host, then for loop the host list as above and run the script.
Cheers in advance

I've got a bunch of ancient HP-UX boxes that I can't put SSH on, so I've got to use rsh. Long and the short of it, we've got a specific app that is connection sensitive and susceptible to network glitches - if the network drops for a split second then the user gets kicked out and a ghost session remains. So every now and then, we get a request to clear the sessions across 20 odd servers. When this happens for multiple users, it can be a very time consuming process.
So, started thinking about ways round this but ran into a bit of stick with the cronky HP-UX limitations. So, I've got a list of hosts in a text file which I'm calling in a script then running this command:
for host in `cat /tmp/hosts.txt`
do
echo $host
rsh $host ps -ef | grep 1.0.0.1 | grep -v | awk '{print $2}' | xargs kill -9
done
Now the "ps -ef | grep 1.0.0.1 | grep -v | awk '{print $2}' | xargs kill -9" bit works perfectly when executed on host, but when you rsh it the "xargs kill -9" portion of the command tries to run on the host you're rsh-ing from. Bummer.
I've been reading around, and it says to dump the command you want executed remotely into "" "" because of funkyness in HP-UX. Doesn't seem to work though as it then looks for a command called "xargs kill -9" - Failboat.
So, anyone have an idea of the syntax needed to make this work?
The dirty cheat way I used to night was to create a small shell script of the command needed and rcp it out to every host, then for loop the host list as above and run the script.

Cheers in advance
