05-22-2008
Finding mail per hour
Hi,
i have a logfile of a mail server it looks like this:
d k 1004210238.380677500 1004210238.454490500 1004210238.679567500 3621 <VOLENDAM@Malawi.com>
local.EDAM@Frankrijk.com 6053 81
I have got the following script to set the time in normal gmt time
and to filter de failed messages, but i want that the script asks me what date and what time i want to filter at the beginning of the script.
BEGIN{{print "list of failed mails:"}
{print "---------------------------------------------"}}
{if ($1 ~ /d/ && $2 ~ /z/) {nr =nr+1 ; printf $7" ""%s\n%s\n",(""), strftime("%c", $3) }}
END {{print "---------------------------------------------"}
{print "there are:",nr " failed mails"}}
Can anybody help me ?
Greetz Joost
Last edited by Prince2; 05-22-2008 at 06:47 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My program:
__________________________________
#!/bin/ksh
DAY=`date +%y%m%d`
H=`date +%H`
M=`date +%M`
day=`date +%m/%d/%y`
let h=$H-1
echo DAY $DAY
echo H $H
echo M $M
echo day $day
echo h $h
_____________________________________
My result: (3 Replies)
Discussion started by: bobo
3 Replies
2. UNIX for Advanced & Expert Users
i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail.
actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies
3. Shell Programming and Scripting
Hi,
I have a folder structure as follows,
DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt
-> 01 -> ABC_2012-01-03_01.txt
-> 02 -> ABC_2012-01-03_02.txt
...
-> 23 -> ABC_2012-01-03_02.txt
-> 2012-01-02
-> 2012-01-03
So the dir DATA contains the above hierarchy,
User input Start and... (6 Replies)
Discussion started by: mihirvora16
6 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have a folder structure as follows,
DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt
-> 01 -> ABC_2012-01-03_01.txt
-> 02 -> ABC_2012-01-03_02.txt
...
-> 23 -> ABC_2012-01-03_02.txt
-> 2012-01-02
... (1 Reply)
Discussion started by: mihirvora16
1 Replies
5. Shell Programming and Scripting
Hello,
I need to write a script to check the files in one folder , if that folder doesn't have files generated from last 1 hr then we need to send mail to particular persons.
So Can you please help me to write script to check the files and send email.
Thank you.. (1 Reply)
Discussion started by: archana23
1 Replies
6. Shell Programming and Scripting
Hi friends, I want to convert 24 hour timing to 12 hour please help me...
my data file looks like this..
13-Nov-2011 13:27:36 15.32044 72.68502
13-Nov-2011 12:08:31 15.31291 72.69807
16-Nov-2011 01:16:54 15.30844 72.74028
15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
7. Shell Programming and Scripting
I have a cron: 0 5,11,17,23 * * * /home/oracle/scripts/sysize.ksh
This cron will trigger
cat dbsz.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS
I don't want to get the e-mail notice 4 times a day. Can I have just one e-mail triggered at 11 AM?
Please advise.
Thank you (3 Replies)
Discussion started by: Daniel Gate
3 Replies
8. UNIX for Dummies Questions & Answers
any useful command to find and e-mail address hardcoded into a cfg file on an specific server?
I already tried with::
find . -type f | xargs grep -l "nobody@foundstone.com"
Thanks!! (1 Reply)
Discussion started by: JLo5621
1 Replies
9. Shell Programming and Scripting
Hi,
I have a script written for monitoring the queue manager status continously. below is the script.
QMGR=`dspmq | awk '{print $1}' | cut -f2 -d "(" | cut -f1 -d ")"`
QMSTATUS=`dspmq | awk '{print $2}' | cut -f2 -d "(" | cut -f1 -d ")"`
count=`dspmq | awk '{print $1}' | cut -f2 -d "(" | ... (5 Replies)
Discussion started by: Anusha M
5 Replies
10. UNIX for Advanced & Expert Users
I am having trouble getting mail to work on a red hat server. At first I was getting this message.
Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused
Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
NOTIFY(8C) NOTIFY(8C)
NAME
notify - HylaFAX user notification script
SYNOPSIS
/var/spool/fax/bin/notify qfile why jobtime [ nextTry ]
DESCRIPTION
bin/notify is the command script invoked by the facsimile server to notify a user about the status of an outbound job. The default notifi-
cation script sends the user electronic mail describing the event or action. The arguments are:
qfile the pathname of the job description file.
why a string that specifies why the user is being notified; one of:
Why Notes Meaning
done 1 job was completed successfully
failed 12 job was not completed
rejected 1 job was rejected for specified reasons
requeued 2 job was not completed, but was requeued for retry
removed 1 job was deleted from the queue
killed 1 job was deleted from the queue
timedout 1 job could not be sent before kill time expired
format_failed 1 document conversion failed
no_formatter 1 the document conversion program was not found
poll_rejected 12 a polling request was rejected by the remote side
poll_no_document 12 a polling request failed because nothing was available
poll_failed 12 a polling request failed for an unknown reason
blocked 3 job is blocked by concurrent jobs
1 A final job state
2 A transcript of the failed communication is returned to the sender.
3 No emails are sent for the block state, the job has been neither requeued nor done, but remains waiting in the queue for the
ability to be sent.
jobtime the total transmission time of a successful job or the connect time of a failed request (passed as a string).
nextTry the time (passed as a string) at which the next attempt will be made to complete the job. This parameter is passed only if why
is ``requeued''.
NOTES
The behavior of notify is intended to be customizable via the etc/FaxNotify script, if present. FaxNotify is sourced after the q-file is
parsed and all default values are preset. Useful settings for FaxNotify are:
WHY is identical to why mentioned above and can be useful in determining under what conditions various settings should take effect. For
example,
if [ "$WHY" != "done" ]; then
RETURNFILETYPE=pdf;
fi
This would only set RETURNFILETYPE when the job did not complete successfully.
RETURNFILETYPE
can be set to ``tif'', ``pdf'', ``ps'', or ``original''. If set, this causes notify to return a copy of the submitted documents to
the SENDER address along with the notification message. The ``original'' setting uses the format type that was used in the submis-
sion. Multiple values may be specified by separating them with whitespace. In that case a separate attachment is created for each
filetype.
NOTIFY_FAXMASTER
is used to deliver a notification message to TOADDR (which defaults to ``FaxMaster'') that contains technical information about the
job. This is useful in allowing the administrator to be aware of any problems before those problems are reported by the users.
Possible settings are ``yes'', ``always'', ``no'', ``never'', and ``errors''. If ``errors'' is used then the notification message
is only sent to FaxMaster when the job experienced an error. The default is ``no''.
The settings of the user in $notify (read from the sendq job file) controls whether the user will get the notification email. If you want
to force notification emails, irregardless of the users selection, or force a blocked notification (which is not sent by default), you can
set
notify="always"
which will force the notify script to send the email.
FILES
/var/spool/fax spooling area
/usr/sbin/sendmail for delivering mail
SEE ALSO
faxq(8C), hylafax-server(5F), sendq(5F)
May 8, 1996 NOTIFY(8C)