Sponsored Content
Top Forums Shell Programming and Scripting Email alert doesnt contain any message Post 302336059 by lscanaleta on Tuesday 21st of July 2009 05:48:21 AM
Old 07-21-2009
Email alert doesnt contain any message

I have created a script which will monitor disk space in unix, it will send an email alert that will notify the specified receipients. I used echo in the mailx command but the email doesnt contain any message. I have used printf to store the message ($message2) and when tried to display on the screen using echo command the value appeared. I have also tried to use the cat command but still no message in the email. Below is the script.

#!/bin/sh
2 HOST=`uname -s`
3 LIST="apps/AI2dbFeeds apps/ai2install apps/data_transfer apps/informatica apps/oracle apps/samba apps/tsm"
4 SYSTIME=`date`
5 #SYSTIME=`date | sed -e 's/BST//'`
6 #SYSTIME=`date +"%OH:%OM"`
7 LEVEL1=40
8 LEVEL2=90
9 LEVEL3=95
10 MAILGRP="leah.dimapawi@db.com"
11 MESS="/apps/informatica/current/pmserver/Scripts/message2"
12
13 for i in $LIST
14 do
15 XXX=`df -k | grep $i|sed -e 's/%//'|awk '{print $5}'`
16 #echo $i
17 #echo $XXX
18 if [ "$XXX" -ge "$LEVEL1" ]
19 then
20 message= echo "$SYSTIME : $HOST /$i $XXX% Full!"
21 printf "$message" >> "$message2"
22 echo $message2
24 fi
25 done
26
27
28 #cat $message2 < /dev/null | mailx -s "ETL UAT - UNIX Disk Space Utilization" $MAILGRP
29 echo $message2 | mailx -s "ETL UAT - UNIX Disk Space Utilization" $MAILGRP
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sendmail and message alert

gurus, i need to know 2 things, first: how can i send mail over the internet in case of system failures/crash? second: how can i receive SMS alert on my phone in case of failures? do i need to start any service on my box? thanks & regards abhijeet (1 Reply)
Discussion started by: abhijeetkul
1 Replies

2. Shell Programming and Scripting

email Alert

Hello, I want a script that will scan the file /etc/httpd/conf/httpd.conf and the folder /etc/httpd/libexec/ -bash-2.05b# grep mod_r /etc/httpd/conf/httpd.conf LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c -bash-2.05b# -bash-2.05b# find... (4 Replies)
Discussion started by: fed.linuxgossip
4 Replies

3. UNIX for Dummies Questions & Answers

compare two files if doesnt match then display error message

hi , i have one file ,i need to search particular word from this file and if content is matched then echo MATCHED else NOT MATCHED file contains : mr x planned to score 75% in exam but end up with 74%. word to be searched id 75% please help me out . waiting for reply thanks in advance (2 Replies)
Discussion started by: atl@mav
2 Replies

4. UNIX for Dummies Questions & Answers

IPC Message Queue. msgrcv doesnt work..

Hi everybody, this is the situation. there is a programm XYZ which opens a message queue with the key 47110815 and waits for a SIGUSR1. After receiving this signal it sends a message with type 100 and a number (as ASCII) in the message-body. I have to write a prog which frist sends the... (1 Reply)
Discussion started by: daredevil82m
1 Replies

5. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

6. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

7. Shell Programming and Scripting

Email alert after termination

I am running the gaussian program on UNIX with bash and I want to form a script that will email me once the output life terminates either "normal termination" or "false" I just started learning this last week so could you let me know how to go about this.:b: (13 Replies)
Discussion started by: Jade_Michael
13 Replies
Email::Sender(3pm)					User Contributed Perl Documentation					Email::Sender(3pm)

NAME
Email::Sender - a library for sending email VERSION
version 0.110005 SYNOPSIS
my $message = Email::MIME->create( ... ); # produce an Email::Abstract compatible message object, # e.g. produced by Email::Simple, Email::MIME, Email::Stuff use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTP qw(); use Try::Tiny; try { sendmail( $message, { from => $SMTP_ENVELOPE_FROM_ADDRESS, transport => Email::Sender::Transport::SMTP->new({ host => $SMTP_HOSTNAME, port => $SMTP_PORT, }) } ); } catch { warn "sending failed: $_"; }; OVERVIEW
Email::Sender replaces the old and sometimes problematic Email::Send library, which did a decent job at handling very simple email sending tasks, but was not suitable for serious use, for a variety of reasons. Most users will be able to use Email::Sender::Simple to send mail. Users with more specific needs should look at the available Email::Sender::Transport classes. Documentation may be found in Email::Sender::Manual, and new users should start with Email::Sender::Manual::QuickStart. IMPLEMENTING
Email::Sender itelf is a Moose role. Any class that implements Email::Sender is required to provide a method called "send". This method should accept any input that can be understood by Email::Abstract, followed by a hashref containing "to" and "from" arguments to be used as the envelope. The method should return an Email::Sender::Success object on success or throw an Email::Sender::Failure on failure. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-06 Email::Sender(3pm)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy