Tuesday, March 17, 2009

Compare command output on 2 hosts

This works nicely on my 2 compute nodes.


#!/bin/tcsh
set tmp1 = `mktemp -t computeDiff.csh.c1.XXXXXX`
set tmp2 = `mktemp -t computeDiff.csh.c2.XXXXXX`
onintr exit
foreach cmd ( $argv )
ssh kf-compute1 "$cmd" >! $tmp1
ssh kf-compute2 "$cmd" >! $tmp2
echo "########### $cmd ################"
echo "### diff compute1 compute2"
diff $tmp1 $tmp2
end

exit:
rm $tmp1* >&/dev/null
rm $tmp2* >&/dev/null
# end script


Q: What Software Is Installed On Only One Node?
A:

% computeDiff.csh pkg_info
########### pkg_info ################
### diff compute1 compute2
22a23
> compat6x-amd64-6.4.604000.200810 A convenience package to install the compat6x libraries
24d24
< cvsup-without-gui-16.1h_4 File distribution system optimized for CVS (non-GUI version
34d33
< fastest_cvsup-0.2.9_5 Finds fastest CVSup server
62a62
> iperf-2.0.4 A tool to measure maximum TCP and UDP bandwidth
150d149
< sge-6.2.b Sun Grid Engine, a batch queueing system

No comments:

Post a Comment