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
mono-asp-apps(1)						   User Commands						  mono-asp-apps(1)

NAME
mono-asp-apps - utility to manage ASP.NET 2.0 applications installed from RPMs SYNOPSIS
mono-asp-apps command [options] DESCRIPTION
The 'mono-asp-apps' command is useful on systems which install applications from RPM packages and when the RPM packages have been created according to the Mono RPM packaging guidelines for ASP.NET applications. The utility allows one to initialize, enable, disable and start installed applications. Note that you do not use this utility to manage applications hosted and managed by the Apache (or other) web server, only by xsp. Note that this utility is useful only on systems where at least one application packaged according to the Mono ASP.NET 2.0 RPM packaging guidelines has been installed. COMMANDS
The commands which take an application name, require the it to be one of the registered names. See the `list` command below. init APPLICATION_NAME Initializes the application named APPLICATION_NAME, if it hasn't been done already. Initialization actions performed are applica- tion specific, but may include creating databases and populating them, creating directories, downloading files etc. enable APPLICATION_NAME Enables APPLICATION_NAME for automatic start when XSP is started as part of the system bootup process. disable APPLICATION_NAME Disables APPLICATION_NAME, so that it is not started automatically when XSP is started as part of the system bootup process. start APPLICATION_NAME [server_options] Manually starts the xsp2 process passing the configuration of APPLICATION_NAME to the xsp2 process. Applications may ship with a bundled start script which will be used instead of xsp2 if present. server_options are passed verbatim to the server process. list Lists all the applications known to the utility. AUTHORS
Marek Habersack <mhabersack@novell.com> SEE ALSO
xsp(1) MORE INFORMATION
The Mono project (http://www.go-mono.com) is a collaborative effort led by Novell (http://www.novell.com) to implement an open source ver- sion of the .NET Framework. MAILING LISTS
Mailing lists are listed at the http://www.mono-project.com/Mailing_Lists mono-asp-apps 2.6.4 31 Oct 2007 mono-asp-apps(1)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy