Sponsored Content
Top Forums Shell Programming and Scripting check the status and send an email with status Post 94360 by linuxpenguin on Thursday 29th of December 2005 06:22:00 PM
Old 12-29-2005
To email the message=

grep "~ZZ~" dat.txt| awk '{
if ( $3 == "~ZZ~VISTN" ) {
print "huge msg with status passed"
}
else
print "another message with status failed"
}' | mail urid@whatever.com

or
to redirect it to some file

grep "~ZZ~" dat.txt| awk '{
if ( $3 == "~ZZ~VISTN" ) {
print "huge msg with status passed"
}
else
print "another message with status failed"
}' > redirect_file_name
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies

2. UNIX for Dummies Questions & Answers

awk to find the status and send an email

Hi, I have a datafile which has the following data and it can have much more records. The data set is as follows: ISA~00~ ~00~ ~ZZ~F159B ~ZZ~U1CAD ~051215~184 3~U~00200~000011432~0~P~< GS~FA~TC11A~U1CAD~051215~1843~000011432~X~002002 ST~997~0001... (6 Replies)
Discussion started by: isingh786
6 Replies

3. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

4. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh` if $rshstatus <>0 then errstatus=1 mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr else if errstatus=0 echo "status to xirsol8dr successful" can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
Discussion started by: bpm12
1 Replies

5. Shell Programming and Scripting

Help with Email Status shell script

I have written a bash script to to sort the data from logs i need some help in printing the outputs , i dont have much ideas in bah scripting. Sample script ----------------------- #!/bin/bash a=`date | cut -d " " -f2,2,3` cat /var/log/maillog |grep "$a" |grep -E -e 'deferred|bounced'... (9 Replies)
Discussion started by: unimaxlin
9 Replies

6. Shell Programming and Scripting

Check HD status

I have some server ( IBM , Dell ) , our data center is not in the same location with office , therefore , I do not know if the HD lamp is flash when the HD is fault , can advise if I can write a script to check if the HD is normal running or not ? thanks (1 Reply)
Discussion started by: ust
1 Replies

7. Shell Programming and Scripting

Script to email status

Hi, I have few processes in the server continuous run few jobs, each of the process will generate a log file which detailing when its jobs are completed. the logfile will has the name something like this, result1.log, result2.log, result3.log,.... result10.log, result11.log, result12.log.......... (8 Replies)
Discussion started by: khchong
8 Replies

8. Shell Programming and Scripting

Help....script check status if see something then send email

autorep -m bogus Machine Name Max Load Current Load Factor O/S Status ___________ ________ ___________ ______ ________ ______ bogus --- --- 1.00 Sys Agent Online Status ______ Online Offline Missing Unqualified The "Status" always "Online". I like create a script execute run... (6 Replies)
Discussion started by: dotran
6 Replies

9. Shell Programming and Scripting

Send Disk Space Usage Status via email

Hi Guys, Is there any way I can write a script that sends DISK SPACE USAGE STATUS via email once a week? Thanks, (5 Replies)
Discussion started by: g4v1n
5 Replies

10. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies
CommandResult(3pm)					  LogReport's Lire Documentation					CommandResult(3pm)

NAME
Lire::Test::CommandResult - Object used to report the results of shell commands SYNOPSIS
use Lire::Test::FunctionalTestCase; my $result = $self->lire_run( "echo Test" ); print $result->status(); print $result->stdout(); print $result->stderr(); print scalar $result->sent_mail(), " emails were sent. "; DESCRIPTION
Lire::Test::ComandResult objects are used to report the results of shell commands run through Lire::Test::FunctionalTestCase::lire_run(). command() Returns the shell command that was run. This is the complete command line which was interpreated by the shell. status() Returns the command result status. (What is usually contained in $?). stdout() Returns what was output on stdout while executing the command. stderr() Returns what was output on stderr while executing the command. sent_mail() Returns in an array reference the message that were sent out during this command run. The element of this array are hash reference containing two keys: recipients An array reference containing the recipients as passed on the command line to sendmail. message The email which was sent. This is the complete text of the email. This is what was passed to sendmail via STDIN. SEE ALSO
Lire::Test::FunctionaLTestCase(3pm) VERSION
$Id: CommandResult.pm,v 1.6 2006/07/23 13:16:31 vanbaal Exp $ AUTHOR
Francis J. Lacoste <flacoste@logreport.org> COPYRIGHT
Copyright (C) 2003 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 CommandResult(3pm)
All times are GMT -4. The time now is 07:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy