1 #******************* Loop for each client to check ******************* 2 while read days client level1 level2 level3 v r m f 3 do 4 first=`echo "$days" | awk '{print substr($0,1,1)}'` 5 if [ -z "$client" -o "$first" = "#" ] 6 then 7 continue # Skip the rest of the loop 8 fi 9 printf "\n%-10.10s %-14.14s: " "$client" "${level1}-${level2}-${level3}" 10 #******* Check that the client is on the network 11 ping_count=`eval $ping_cmd` 12 if [ "$ping_count" != "1" ] 13 then 14 echo "connection timed out @ `date`" 15 continue # Skip the rest of the loop 16 fi 17 18 #*************** The actual commands to execute ****************** 19 $rsh_cmd $client -n '/usr/sbin/swlist -l file|grep "/usr/lib/dld\.sl"' 20 21 $rsh_cmd $client 'mv /usr/dir/dumpauth /usr/dir/dumpauth.old' 22 rcp -p /distdir/dumpauth $client:/usr/dir/dumpauth 23 24 done < /tmp/checks/unix.client.hpux #12 |
The second slide loops through the list of client systems, checks that they are on the network, and executes the commands on each system.