Sponsored Content
Full Discussion: File monitoring script
Top Forums Shell Programming and Scripting File monitoring script Post 302420962 by whizkidash on Thursday 13th of May 2010 03:37:43 AM
Old 05-13-2010
File monitoring script

Team,

Attached 2 scripts for your validation(main script,mail script)

Problem description:

When its red it should wait for 10 seconds and then send a mail. If not red it should not send the mail

i have done the below changes in the main script:

Code:
 if [ $DIFF -gt 15 ]
        then
                if [ $DIFF -gt 30 ]
                then
                        COLOR="red"
 echo "<tr><td>$name</td><td> $timeE </td><td> $timeA </td><td bgcolor=$COLOR> $DIFF </td></tr>" >> $OUTFILE
sleep 10 
mail.sh

(I have hashed out the(main script)rest in-order to achieve my desired result)

But the problem is when i run the script with the above modification.
It sends me a mail with a blank(html) format. So.. How do i stop this blank mail.. ?

Request you to please suggest as to how to resolve the problem

Many thanks!

P.S: Please dont treat this as assignment task!

Regards
Whizkidash

Last edited by Franklin52; 05-13-2010 at 07:10 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file system monitoring script

Hi Does anyone know any website which contains examples of unix system monitoring scripts example? cheers (1 Reply)
Discussion started by: g-e-n-o
1 Replies

2. Shell Programming and Scripting

Shell Script for monitoring File system.

Hi, need help to write one shell script to monitor UNIX file systems and if any changes happend like deletion of any file, adding new file, time stamp changed, permisson changed etc. Script need to send alert mail to defined person/mail id. I request someone to help me to create the... (1 Reply)
Discussion started by: vjauhari
1 Replies

3. Shell Programming and Scripting

[Solved] File System Monitoring Script

Hello Scripts Guru I had created a shell script to monitor the threshold of the file system, but some where it is not giving the correct output. Request to all to hel me out I am getting the following output /dev/vg00/lvol3 mounted on 1865224 10% / is 2097152% /dev/vg00/lvol1 mounted on... (2 Replies)
Discussion started by: indrajit_renu
2 Replies

4. Shell Programming and Scripting

help needed - log file monitoring script

hi Gurus, Need to pick your brains on this minor script project. I would like to continuously monitor a log file with sample log messages as below, and if PSOldGen percentage is either 99% or 100% for consecutively 10 times, alert someone. {Heap before gc invocations=46516: PSYoungGen ... (6 Replies)
Discussion started by: kenchen722
6 Replies

5. UNIX for Advanced & Expert Users

ldapsearch in monitoring script without bind password written in script

Hi I do a very simple monitoring of our OpenLDAP (runs in cronjob and generate alerts if unsuccessfull) $ ldapsearch -h hostname.domain -D "cn=monitor_user,ou=People,dc=organisation" -w "password" -b "dc=organisation" -x "(&(cn=monitor_user)(ou=People))" dn | grep -v version dn:... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

6. Shell Programming and Scripting

Help with File Monitoring Script

I am getting errors when I try to run the script I just made, any suggestiongs would be helpful. Please be gentle, Im still a newbie and learning on the go at an entry level position. #!/usr/bin/ksh # PURPOSE: This script is going to view the top 10 largest home directory Folders, then go in each... (11 Replies)
Discussion started by: gkelly1117
11 Replies

7. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

8. Shell Programming and Scripting

Monitoring script for a log file

Hi, I need to get a script working to monitor a log file and throw an alert via mailx as soon as a particular error is encountered. I do not want repeatative email notifications of same error so simply cat logfile and grepping the error would not work. Here is what i planned but it seems... (2 Replies)
Discussion started by: roshan.171188
2 Replies

9. UNIX for Beginners Questions & Answers

Monitoring script for Log file

Hi, Iam new to unix , plz help me to write below script. I need to write a script for Monitoring log file when any error occurs it has to send a mail to specified users and it should be always pick latest error not the existing one and the script should be able to send mail all errors (more... (1 Reply)
Discussion started by: vij05
1 Replies

10. UNIX for Beginners Questions & Answers

Shell script for continuously monitoring log file

Hi I have written below log monitoring script to egrep multiple words and redirect the output to a text file and its working fine but I want to add some more below given functionality to it, which is very advance and im not very good in it, so please help if you can :) I am egrepping all the... (1 Reply)
Discussion started by: scazed
1 Replies
NEWS2MAIL(8)						    InterNetNews Documentation						      NEWS2MAIL(8)

NAME
news2mail - Channel script to gateway news into e-mails SYNOPSIS
news2mail DESCRIPTION
news2mail runs as a channel process underneath innd. It is set up as channel feed in newsfeeds, with different mailing-lists as funnel entries pointing to it (see below); news2mail expects the token of an article followed by a sequence of list names. news2mail uses the configuration file pathetc/news2mail.cf to map mailing-list names to e-mail addresses. news2mail causes sendmail to queue the messages for later delivery (to avoid DOS attacks by mass postings). You must run "sendmail -q" periodically to get the queue processed. CONFIGURATION FILE
The configuration file format is simple: comments (starting with a hash sign "#") and blank lines are ignored. All other lines have two or three fields on them. The first is the list name and is what innd uses (i.e. the site field of the entry in the newsfeeds file). The second field is the actual e-mail address to send the article to. The third field is optional: it sets the envelope-from address (for instance a list member's address; if not set, it defaults to the "news" user). In e-mail messages, the To: header will have the mailing-list address (i.e. the second field). Besides, news2mail strips most article headers from the article before mailing. In newsfeeds, the channel feed should look like: news2mail!:!*:Ac,Tc,Wn*:<pathbin>/news2mail and for each mailing-list, you only have to add to newsfeeds an entry list like: list-big-red-ants/lists.ucsd.edu:!*,rec.pets.red-ants:Ap,Tm:news2mail! Please note the use of "Ap" and the exclusion of the list owner domain to protect the list from feeding back new arrivals from the list. The site name used in the newfeeds entry for a mailing-list (above "list-big-red-ants") must be the same as the first field in an entry in news2mail.cf. For instance: # Newsfeeds-name List-to-address [List-sender-address] list-big-red-ants big-red-ants@lists.ucsd.edu news+big-red-ants@local.news.server.org FILES
pathbin/news2mail The Perl program itself used to gateway news into e-mails. pathetc/news2mail.cf The configuration file which specifies the mapping to use for gatewaying. BUGS
The news2mail program is set up as a funneled channel in newsfeeds, implying multiple matches should be handled as one - and multiple matching funneled feeds will result in a single call to the script. Therefore, since only one mail is sent, crossposts are not currently properly handled as for the envelope-from address (which then defaults to the "news" user). HISTORY
news2mail was written by Brian Kantor in 1998. This man page was written by James Brister and converted to POD by Julien Elie. The third optional field in news2mail.cf was added by D. Stussy in 2008. $Id: news2mail.pod 8199 2008-11-30 13:30:47Z iulius $ SEE ALSO
innd(8), newsfeeds(5). INN 2.5.3 2009-05-21 NEWS2MAIL(8)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy