02-20-2013
Search string and send email
Hi All,
I need script which should search for the "reason code" and it should send mail with its preceding line as well as the line below it.(first line before it and line after it)
I used below script but it is printing the whole lines inside it, your help is appreciated:
cd /app/usr/bin
grep -i 'reason code' system.log > queue_line.txt
( cat queue_line.txt ) | mailx -s "reason code"
hello@gmail.com
system.log :
=========
Feb 13 21:47:14 app20 please enter the valid input. system cannot understnd the queue you entered
reason code 2085. from the default values.
The Create MQ Channel (CRTMQMCHL) command creates a new MQ channel definition, specifying those attributes that are to be different
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi
A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as
" usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
2. Shell Programming and Scripting
Hi All
i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person
This is basically to find the encrypetd keys which are loaded in the unix server
Below are sample... (10 Replies)
Discussion started by: ranga27
10 Replies
3. Shell Programming and Scripting
Hi,
I need to find if there is any error in the last few lines of the log file and send a mail accordingly.For example,
Following errors can be logged in the log file.
ERR_1="DB Connection not established"
ERR_2="Server Unloading"
I need to find if these errors are found in the log file and... (1 Reply)
Discussion started by: AnneAnne
1 Replies
4. Solaris
Hello everyone
I have a problem and I need your help:
I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server.
I need send an email from Solaris servers preferably using Centos4 email server.
I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies
5. Shell Programming and Scripting
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies
6. UNIX for Dummies Questions & Answers
hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version).
i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010).
a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies
7. Shell Programming and Scripting
Folks,
Need a script which searches for a string and send line containing the string to the mail.
The requirement is like this :
file abc.log containts below text :
"error occurred due to the code 3456 and kill the process to recover it"
1. search for string "3456" and send entire... (14 Replies)
Discussion started by: rockingvj
14 Replies
8. Shell Programming and Scripting
Hello,
I wanted to search specific string in the acitve log file and send an email if the search string found in the log.
Log file is written by application all the time. So, script has to search if any new log entry has the specific string for example " sample exception" and send an email. (1 Reply)
Discussion started by: balareddy
1 Replies
9. SuSE
Dear users,
I have Linux server whose versions are Suse 10 SP 3 and Suse 11.
I am trying to send email from these servers to my GroupWise email account.
In /etc/postfix/main.cf file, The current value of MYHOSTNAME is LINUX.LOCAL. What should be the right value of MYHOSTNAME? Is... (0 Replies)
Discussion started by: JDBA
0 Replies
LEARN ABOUT DEBIAN
nullmailer-queue
nullmailer-queue(8) System Manager's Manual nullmailer-queue(8)
NAME
nullmailer-queue - insert mail messages into the queue
SYNOPSIS
nullmailer-queue
DESCRIPTION
This program reads a formatted mail message from standard input and safely injects it into the outgoing mail queue.
The data sent into standard input is expected to have the following format: one line containing the envelope sender, one or more lines con-
taining the recipients, a single blank line, and then the contents of the message exactly as it is to be transmitted to the destination.
All lines are terminated with a single line-feed character. All addresses must contain a fully-qualified domain name.
RETURN VALUE
Exits 0 if it successfully queues the message. If it failed to queue the message, it exits 1 and prints an error message to stdandard out-
put.
CONTROL FILES
adminaddr
If this file is not empty, all recipients to users at either "localhost" (the literal string) or the canonical host name (from
/etc/mailname) are remapped to this address. This is provided to allow local daemons to be able to send email to "somebody@local-
host" and have it go somewhere sensible instead of being bounced by your relay host.
OTHER FILES
/var/spool/nullmailer/queue
The directory into which the completed messages are moved.
/var/spool/nullmailer/tmp
The directory in which messages are formed temporarily.
/var/spool/nullmailer/trigger
A pipe used to trigger nullmailer-send to immediately start sending the message from the queue.
SEE ALSO
nullmailer-inject(1), nullmailer-send(8)
LIMITATIONS
This program should enforce system-wide configurable message length limits.
nullmailer-queue(8)