From owner-freebsd-questions Sat Oct 27 17:50:55 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail-1.traffic.co.uk (mail-1.traffic.co.uk [193.132.107.4]) by hub.freebsd.org (Postfix) with SMTP id 51A8F37B405 for ; Sat, 27 Oct 2001 17:50:48 -0700 (PDT) Received: (qmail 19893 invoked by uid 1006); 28 Oct 2001 00:52:37 -0000 Received: from dookhee.s@trafficproximity.com by riker.traffic.co.uk with qmail-scanner-0.96 (sweep: 2.2/3.44. . Clean. Processed in 1.085124 secs); 28 Oct 2001 00:52:37 -0000 X-Virus-Scanner-Mail-From: dookhee.s@trafficproximity.com via riker.traffic.co.uk X-Virus-Scanner-Rcpt-To: kory@avatar.com,freebsd-questions@freebsd.org X-Virus-Scanner: 0.96 (No viruses found. Processed in 1.085124 secs) Received: from unknown (HELO WN2KSD) (194.202.29.48) by mail-1.traffic.co.uk with SMTP; 28 Oct 2001 00:52:35 -0000 From: "Shashi Dookhee" To: "Kory Hamzeh" , Subject: RE: How would you do this? Date: Sun, 28 Oct 2001 01:50:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <001d01c15f4a$3397f5a0$14ce21c7@avatar.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Spam-Rating: mail-1.traffic.co.uk 1.6.2 0/1000/N Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Perl would handle doing this with no probs... But u do need to be competent with the coding... I could possibly help you there, if you give me more details on what you want done? Thanks Shashi Dookhee Head of IT Infrastructure e-mail: dookhee.s@trafficproximity.com Telephone (Direct Line): +44 (0)20 7298 8222 - -----Original Message----- From: Kory Hamzeh [mailto:kory@avatar.com] Sent: 28 October 2001 01:48 To: Shashi Dookhee; freebsd-questions@freebsd.org Subject: RE: How would you do this? Hi Shashi, My concern is the second time it is run, I need to make sure that I don't send another e-mail because of OLD messages (which I already sent an e-mail for an hour ago). I looks like I need to parse the file and keep the timestamp of the newest log message that triggered the e-mail, and then only check for new messages with newer timestamps. That is something that I don't feel competent enough to do with a scripting language (i.e. convert a syslog time to a absolute number). Kory > -----Original Message----- > From: Shashi Dookhee [mailto:dookhee.s@trafficproximity.com] > Sent: Saturday, October 27, 2001 5:40 PM > To: Kory Hamzeh; freebsd-questions@freebsd.org > Subject: RE: How would you do this? > Importance: High > > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Set it up in crontab every hour - then it will only send mail once > an hour, every hour (if a message is found - else it will skip that > hour).. > > As for parsing the log, I'd say script it in perl - this is exactly > what it was designed for ;) > > S. > > > > Shashi Dookhee > Head of IT Infrastructure > > e-mail: dookhee.s@trafficproximity.com > Telephone (Direct Line): +44 (0)20 7298 8222 > > > - -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Kory > Hamzeh Sent: 28 October 2001 01:22 > To: freebsd-questions@freebsd.org > Subject: How would you do this? > > > > I need to write a script (preferably bourne shell) to send an mail > every > time a certain message gets sysloged, but not to send e-mail more > than once > an hour. I can grep /var/log/messages for the message, but I could > not come > up with a simple, clever way of making sure I don't send the e-mail > out more > than once an hour and the next time I grep, that I check for only > new items > logged since the last check. > > Any pointers would be great! > > - -- > Kory Hamzeh > ICQ # 133630494 > http://www.avatar.com/ > http://www.metaphysical-store.com/ > -----BEGIN PGP SIGNATURE----- Version: PGP 7.1 iQA/AwUBO9tWXR81+wdHSEUlEQIVegCfTpMXnxPtREG0gDDrq6bD/iUV7g0AoL0r fPPAEnqCO/TFCCoQbm6oDVKK =GsJa -----END PGP SIGNATURE----- =============================================================================== Traffic Proximity Limited 191 Old Marylebone Road London NW1 5DW United Kingdom Registered number: 3164767 Registered in England Tel: +44 (0) 20 7298 8200 Fax: +44 (0) 20 7298 8201 This email its contents and any files or images with it are intended solely for the addressee(s) and are confidential. If you have received this email in error you may not copy or use the contents, attachments or information in any way. Please destroy it and contact the sender on the number printed above, via the Traffic Proximity switchboard or via email return. DISCLAIMER Material contained in this email may be copyright material of Traffic Proximity or protected by other intellectual property rights. It may only be reproduced with the express permission of Traffic Proximity. Traffic Proxmity does not accept responsibility for any changes made to this email by unauthorised parties after it was sent. Whilst Traffic Proximity runs antivirus software on all Internet emails it is not liable for any loss or damage caused by an infected email. The recipient is advised to run their own antivirus software. All information contained in this email has been prepared using information believed by the author to be reliable and accurate, but Traffic Proximity makes no warranty as to accuracy and completeness. Any opinions expressed in this email are those of the author and do not necessarily reflect the opinions of Traffic Proximity or its affiliates. =============================================================================== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message