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.
Quote:
==== WPAR Status Check ===== ====== MMDDYYYY HH:MM ======
**** WPAR state Active: usprd02 usprd03
2 WPARs are in A-Active State
**** WPAR state Defined/Transition/Broken: usprd04 usprd05 usprd06
3 WPARs are in D-Defined/T-Transition/B-Broken State
hello all,
I'm invoking the program generate-report using backticks from my perl program and redirecting the output to the log file sge-stderr.log. But when i check the process using ps command it is spawing two processes where the below code is parent process and the program generate-report as... (2 Replies)
I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)
I currently have an expect script that issues the 'mail' command and sends an 'x' when it receives the & prompt from mail to quit.
The expect script is able to do stty rows 100 columns 200 < $spawn_out(slave,name) to set up the number of columns and rows.
I would like to get rid of the expect... (0 Replies)
hi,
i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Hi,
I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console.
I've tried this command:
myscript.sh | tail -f
However, it doesn't end after the script finishes running
I've also tried this:
myscript.sh | tee ~/results.txt
But it writes... (3 Replies)
hi,
i have a html form which call a perl program, this perl program calls a shell script.
<html>
<head>
<title>demo</title>
</head>
<body>
<form name="frm1" action="/cgi-bin/perl_script.pl" method="post">
<input type="text" name="fname">
... (1 Reply)
Hi Guys,
I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts.
I used below but it is not working:
OFILE=/home/home1/report1
echo "report1 details" > $OFILE
=/home/home1/1.sh > $OFILE
echo... (7 Replies)
I have the below script, but when i execute it is still printing to screen is there a way i can stop this and just print everything to the log file. Thank you.
#!/bin/bash
exec > >(tee "/var/log/ScriptLogs/called_from_incrontab.log") 2>&1
DIR="$1"
FILE="$2"
echo "STEP 1: Datafile... (5 Replies)
i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file.
#!/bin/bash
for i in `seq 1 20`;
do
echo $i
sleep 1
done
./test.sh |egrep "5|10|15"
5
10
15
r
./test.sh... (2 Replies)
Hi Experts,
Could you pls help with below query
I have written below script to capture disk utilization and then send the output on mail. But getting unformated output on mail
#!/bin/bash
echo "Hi Sur,">dfoutput.csv
printf '\n' >>dfoutput.csv
echo "Please find BAYSQUAR2 filesystem... (4 Replies)
Discussion started by: as7951
4 Replies
LEARN ABOUT FREEBSD
shar
SHAR(1) BSD General Commands Manual SHAR(1)NAME
shar -- create a shell archive of files
SYNOPSIS
shar file ...
DESCRIPTION
The shar command writes a sh(1) shell script to the standard output which will recreate the file hierarchy specified by the command line op-
erands. Directories will be recreated and must be specified before the files they contain (the find(1) utility does this correctly).
The shar command is normally used for distributing files by ftp(1) or mail(1).
EXAMPLES
To create a shell archive of the program ls(1) and mail it to Rick:
cd ls
shar `find . -print` | mail -s "ls source" rick
To recreate the program directory:
mkdir ls
cd ls
...
<delete header lines and examine mailed archive>
...
sh archive
SEE ALSO compress(1), mail(1), tar(1), uuencode(1)HISTORY
The shar command appeared in 4.4BSD.
BUGS
The shar command makes no provisions for special types of files or files containing magic characters. The shar command cannot handle files
without a newline ('
') as the last character.
It is easy to insert trojan horses into shar files. It is strongly recommended that all shell archive files be examined before running them
through sh(1). Archives produced using this implementation of shar may be easily examined with the command:
egrep -v '^[X#]' shar.file
BSD June 6, 1993 BSD