Sponsored Content
Top Forums Shell Programming and Scripting c-shell script advice please. Post 52429 by killerserv on Friday 18th of June 2004 05:47:21 AM
Old 06-18-2004
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:

Quote:
--------------------------------------------------------------------------------
From: Cron Daemon [mailto:cron@blabla.letni.com]
Sent: Friday, June 18, 2004 4:13 PM
To: Killerserv
Subject: GPD_Linux xbatch Down Log Fri Jun 18 16:13:29 AZ 2004

flsx0322 D (Varcon server not reachable OR Machine is down)
flsx4149 D (Varcon server not reachable OR Machine is down)
flvs8059 D (Varcon server not reachable OR Machine is down)
flpe8079 D (Varcon server not reachable OR Machine is down)
flsx8106 D (Varcon server not reachable OR Machine is down)

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)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

first script. need help and advice.

Hello everyone, This is my first post here and this is the first time I am using UNIX OS (Slackware). I find it really useful and powerful and would like to master it but as you may guess I am expreicing quite a few problems. I've been reading a few documentations about it and bash this week... (17 Replies)
Discussion started by: sanchopansa
17 Replies

2. Shell Programming and Scripting

Script Advice please?

Ok. I want to parse a log file and search only for denied traffic for the previous hour. The log looks like this: Jun 18 17:47:56 routername 36806: Jun 18 17:53:01.088: %SEC-6-IPACCESSLOG: list ingress-filter denied tcp 1.2.3.4(1234) -> 6.7.8.9(53), 4 packets I only really care about the... (12 Replies)
Discussion started by: earnstaf
12 Replies

3. Shell Programming and Scripting

advice on shell script

Hello, I have this script running on cron every 20 minutes. By 12pm daily, our system is expecting all input files to be uploaded by the script. After this cutoff time, the script would still be running though, but i need some kind of alerts/logs to know which input files weren't received for... (1 Reply)
Discussion started by: gholdbhurg
1 Replies

4. UNIX for Dummies Questions & Answers

shell scripting help/advice

hello i am trying to generate a list of the most bandwidth consuming ip's from an Apache style log file. the script is run with the path to the log file as the only peramater. here is my code so far: echo "The ten most bandwidth consuming IP's were:" $outpt='' for ip in $(awk '{print $1}'... (4 Replies)
Discussion started by: qcent
4 Replies

5. UNIX for Advanced & Expert Users

Career advice for experienced shell script coder, need help.

I have four years of shell scripting experience in AIX and HP-UX and have worked in perl scripts as well, the good part is i love scripting and so far i have been getting job offers as well. The bad part is , shell scripting is all i know , so the kind of jobs i am getting is mostly production... (2 Replies)
Discussion started by: harishrao
2 Replies

6. Shell Programming and Scripting

Advice on script

Hi folks, I use following script:- #!/bin/sh # cd Linbread TODAY=`date +"%m%d"` DATA=`grep $TODAY linbread.dat` HOUR=`date +"%H"` if then TOD="Morning" elif then TOD="Afternoon" else TOD="Evening" fi echo $DATA | gawk -F"|" '{printf("%s\n\n%s",$2,$3)}' > $$tmp fold -s -w60... (0 Replies)
Discussion started by: satimis
0 Replies

7. UNIX for Dummies Questions & Answers

Few shell programs advice

Hy i have some tasks to do in school but i'm having problems with it,so could you help me out? :) first there is a task where i have to find a running program on the system and kill it, then repeat that every 5 minutes. The name of the process is given with an argument. I have done this so far,... (1 Reply)
Discussion started by: petel1
1 Replies

8. Shell Programming and Scripting

Advice required shell script

Hi all, this is my first post, so please be gentle... I have a situation wherby I need a script that traverses known paths. Check for the modified date (n days) and then deletes all subdirs. I have come up with this hotch potch, but as far as I can tell it seems to work. What I am wondering... (4 Replies)
Discussion started by: primus7
4 Replies

9. Shell Programming and Scripting

Help! Basic shell script advice

##### (2 Replies)
Discussion started by: AidoPotato
2 Replies

10. Shell Programming and Scripting

Script advice

All I have 2 parent directories - input and output. Each parent has multiple sub-directories...each sub-directory has multiple files. Each parent directory structure is a mirror image of itself I need to poll the imput directory and if a new file is found, encrypt the file, move the file to... (2 Replies)
Discussion started by: davidra
2 Replies
BNSTAT(1)							BNETD User's Manual							 BNSTAT(1)

NAME
bnstat - Battle.net statisics client SYNOPSIS
bnstat [options] [servername [serverport]] DESCRIPTION
bnstat is a simple Battle.net client emulator that can be used to gather player statistics. It is also compatible with FSGS servers, but has difficulty with real Battle.net servers. If no servername is specified, localhost is assumed. If no serverport is specified, 6112 is assumed. If no player is specified on the command line, bnstat(1) will connect to the server and prompt for one from stdin. All avaliable statistics for the emulated client type are formatted and displayed on stdout. OPTIONS
-b Causes bnstat to emulate a Brood Wars client. --client Causes bnstat to emulate a specific client. The following client tags are recognized: DRTL DSHR STAR SSHR SEXP W2BN. There are short options which may be used instead for the common clients. --bnetd Also attempt to gather bnetd(1) specific information. -d Causes bnstat to emulate a Diablo client. --fsgs Also attempt to gather FSGS specific information. -h --help --usage Print usage information and exit. -k --cdkey Causes bnstat to report an alternate key to the bnetd(1) server. -o --owner Causes bnstat to report an alternate owner to the bnetd(1) server. -p --player Gather statistics only for the specified player and then exit. This also avoids using login and terminal functions allowing it to be used in shell scripts. -s Causes bnstat to emulate a Starcraft client. -v --version Print its version number and exit. -w Causes bnstat to emulate a Warcraft II BNE client. NOTES
The current version is available with the bnetd distribution at: http://www.bnetd.org/ BUGS
This program assumes that the terminal will move to the beginning of the current line when the carriage return character (^M) is printed. It also assumes the backspace character (^H) will move one column to the left that character printed after that will replace those already on the screen. The terminal settings are not consulted for keybindings. The following are assumed: ^H delete the character to the left of the cursor ^J accept current line ^M (return) accept current line ^T transpose the last two characters ^W delete word to the left of the cursor ^U delete the whole input line ^[ (escape) cancel the current input line ^? (delete) delete the character to the left of the cursor SEE ALSO
bnetd(1) AUTHOR
Ross Combs (ross@bnetd.org) BNETD
11 June, 2000 BNSTAT(1)
All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy