get mail when matching with threshold value


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting get mail when matching with threshold value
# 1  
Old 08-18-2011
get mail when matching with threshold value

HI Guys

Below is my file structure and now I want if % is equal and above 95% then I will get the mail with the name of that filesystem and threshold value.

Is someone help me ?

55G 33G 22G 61% /mnt/projects/stp2int4_web_runtime
16G 14G 1.7G 90% /mnt/projects/stp2int1_app_runtime
15G 14G 1.3G 92% /mnt/projects/stp2int1_web_runtime
16G 7.4G 8.7G 46% /mnt/projects/stp2int2_app_runtime
16G 9.9G 6.2G 62% /mnt/projects/stp2int2_web_runtime
42G 18G 24G 43% /mnt/projects/stp2int4_app_runtime
8.0G 1.6M 8.0G 1% /mnt/projects/stp2ob_app_runtime
8.0G 1.7M 8.0G 1% /mnt/projects/stp2ob_web_runtime
27G 23G 4.7G 83% /mnt/projects/stp2perf1_app_runtime
13G 12G 629M 96% /mnt/projects/stp2perf1_web_runtime
27G 24G 3.3G 88% /mnt/projects/stp2perf2_app_runtime
13G 12G 1.5G 89% /mnt/projects/stp2perf2_web_runtime
27G 22G 5.5G 80% /mnt/projects/stp2perf4_app_runtime
16G 11G 5.4G 67% /mnt/projects/stp2perf4_web_runtime
13G 7.5G 5.4G 59% /mnt/projects/stp2perf5_web_runtime
16G 14G 2.6G 84% /mnt/projects/stp2qa1_app_runtime
13G 8.4G 4.4G 66% /mnt/projects/stp2qa1_web_runtime
27G 26G 1.3G 96% /mnt/projects/stp2qa2_app_runtime
40G 29G 12G 71% /mnt/projects/stp2qa2_web_runtime
16G 15G 1.7G 90% /mnt/projects/ual1int1_app_runtime
16G 15G 1.1G 94% /mnt/projects/ual1int1_web_runtime
16G 13G 3.7G 78% /mnt/projects/ual1int2_app_runtime
16G 3.6G 13G 23% /mnt/projects/ual1int2_web_runtime
40G 16G 24G 40% /mnt/projects/ual1int4_app_runtime
31G 8.9G 22G 30% /mnt/projects/ual1int4_web_runtime
16G 6.2G 9.9G 39% /mnt/projects/ual1perf1_app_runtime
4.0G 3.4G 629M 85% /mnt/projects/ual1perf1_web_runtime
16G 5.9G 11G 37% /mnt/projects/ual1perf2_app_runtime
4.7G 3.3G 1.5G 69% /mnt/projects/ual1perf2_web_runtime
16G 11G 5.4G 67% /mnt/projects/ual1perf4_app_runtime
16G 7.4G 8.7G 46% /mnt/projects/ual1perf4_web_runtime
16G 6.6G 9.5G 41% /mnt/projects/ual1qa1_app_runtime
7.4G 3.1G 4.4G 42% /mnt/projects/ual1qa1_web_runtime
14G 13G 1.3G 91% /mnt/projects/ual1qa2_app_runtime
40G 29G 12G 71% /mnt/projects/ual1qa2_web_runtime

Thanks
# 2  
Old 08-18-2011
Try if the below one works..
Code:
awk 'int($4)>=95 {print "echo "$NF,$(NF-1)"| mailx -s Threshold_Breach myid@mail.com"}' inputfile | sh

# 3  
Old 08-18-2011
it works for me....

Thanks a lot

---------- Post updated at 06:02 AM ---------- Previous update was at 04:36 AM ----------

Hi ,

Script is working finre but I need a little correction there it was giing me lost of mail but I want here that all the filesystem whose value is equal or above give me only single mail.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

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

2. UNIX for Dummies Questions & Answers

Threshold for swap memory

hi guys the monitoring team is using a tool for monitoring linux boxes and they set an alarm for swap memory to 10%(critical) I really has no idea when swap memory usage is high.... Can someone recommend me a threshold for this? when is warning or critical and this parameters can affect... (3 Replies)
Discussion started by: karlochacon
3 Replies

3. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

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

4. Solaris

Rootvol above threshold

Hi there, Root filesystem is above threshold, I have search and cleared unwanted files which are filling up space. But the root fs is still above threshold. I don't know about veritas volume management. Can anyone show me how to solve this. Du shows /proc is occupying a lot of space. Most of the... (2 Replies)
Discussion started by: sundar63
2 Replies

5. UNIX for Dummies Questions & Answers

threshold

Hi, I have a table with 14 columns. How can I filter the columns 2-14, so that I get only those rows back in which the data values are >= 6 in 5 or more columns. :confused: E.g. A 6 6 3 6 7 8 B 1 2 3 4 5 5 C 2 2 2 6 7 8 Here I should only get back the row A. I would like to work from... (5 Replies)
Discussion started by: danieladna
5 Replies

6. UNIX for Advanced & Expert Users

Quota threshold

Hi, I am trying to make a script in which the user is notified once the disk space of the environment increases a particular threshold. I have made a script for it but I am facing an error while executing it. Could any one here guide me further?? Script #!/bin/sh warninglimit=350000... (22 Replies)
Discussion started by: Taranjeet Singh
22 Replies

7. Shell Programming and Scripting

Check Quota of the Environment and mail the user if the threshold increases.

Hi All, I wish to check the quota of the system and if it increases the threshold value,I need that a mail is shot to the environment user informing hi/her about the same. I know it can be done using cron jobs and warnquota command but I am unable to implement it as I am not acquianted with... (1 Reply)
Discussion started by: Taranjeet Singh
1 Replies

8. UNIX for Advanced & Expert Users

Check Quota of the Environment and mail the user if the threshold increases.

Hi All,I wish to check the quota of the system and if it increases the threshold value,I need that a mail is shot to the environment user informing hi/her about the same.I know it can be done using cron jobs and warnquota command but I am unable to implement it as I am not acquianted with both... (1 Reply)
Discussion started by: Taranjeet Singh
1 Replies

9. Shell Programming and Scripting

apache threshold

Hi folks, how can i check apache threshold values via shell scripting and what factors need to check via shell scripting process or number of users or what. pls do advice me. Thanks, Bash (9 Replies)
Discussion started by: learnbash
9 Replies
Login or Register to Ask a Question