c-shell script advice please.

Hi, I have the following script running in my cron.
--------------------------------------------------------------------
#!/bin/csh

bnstat -p GPD_VSLinux | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' > /tmp/LX_xbatch.log
bnstat -p GPD_VSLinux_test | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' >> /tmp/LX_xbatch.log
bnstat -p GPD_Linux7 | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' >> /tmp/LX_xbatch.log
bnstat -p gnp_iAlinux | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' >> /tmp/LX_xbatch.log
bnstat -p GPN_Linux | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' >> /tmp/LX_xbatch.log
/usr/bin/mail -s "GPD_Linux xbatch Down Log `date`" killerserv@letni.com < /tmp/LX_xbatch.log
rm /tmp/LX_xbatch.log
-----------------------------------------------------------------------

When i execute it, the result as follow:

My Question, is there a way to change the script so that i can have a subject and the output.. Instead of the above dull look.

Ex:
blablaABC:
flsx0322 D (Varcon server not reachable OR Machine is down)

blablaDEF:
flsx4149 D (Varcon server not reachable OR Machine is down)

blablaGHI:
flvs8059 D (Varcon server not reachable OR Machine is down)

Not sure what your script is doing as I have no clue what OS this is (never saw bnstat before) but you should be able to add code to seperate the lines
echo "" >> /tmp/LX_xbatch.log
and as far as the blablaABC - what is that? Is that suppose to be put in only if the server is unreachable or down? Or is it always put in? Does it relate to GPD_VSLinux... ?

You might have to code it a little different - possibly use variables to store the output so you can grep for down again to create the proper echo "blablaABC" >> /tmp/LX_xbatch.log to create an eye-pleasing output.

set status=`bnstat -p GPD_VSLinux | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' `
if ("$status" != "" ) then 
        echo "GPD_VSLinux:" >> /tmp/LX_xbatch.log
         echo "" >> /tmp/LX_xbatch.log
          echo "$status" >> /tmp/LX_xbatch.log
endif

Put all this into a loop, give the loop the variables of each server your testing, shortens up the code, and makes it harder to read! So add comments on what you are doing - you will need them in the future.

Note - code pasted not tested - just an example written on the fly.

Hi RTM,
thanx for the reply. Actually this is a Linux platform. bnstat is a program that been programed for this Linux OS. We have more then 900+ Servers in our Data Farm running and executing massive numbers of Scripts for Using Parallel Processing Technic (Utilizing Entire Block of the Processor to this execution). The problem started from this point. By utilizing complete function of the processor this makes some of the Server less stable. So i create a script as above to capture which machine died and send me the output in real time. All this machine have bnstat running so if the Server died this will trigger me and alert thru mail. Btw, bnstat's function is like a middle man, to notify me if any of the server died from processing the correct calculation.

For the question that i posted:

ignore the blablaABC etc, i just put it as an example. Im wondering if i could put a subject on that portion.

Something like:

GPD_VSLinux:
The output...................

GPD_VSLinux_test:
The output....................

GPD_Linux7:
The output....................

gnp_iAlinux:
The output....................

GPN_Linux:
The output....................