automating daily monitoring process


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting automating daily monitoring process
# 1  
Old 04-17-2010
automating daily monitoring process

Hi there,

I have to automate daily monitoring process and then the result of these process should be sent to a log file, then this log file should be mailed .

ps -ef | grep aa

In this atleast one process should run.
If the process is running it should mention Success in the log file if not mention it as failure.

Please can anyone assit in this.

Thanks In Advance,
Neha.
# 2  
Old 04-18-2010
Quote:
Originally Posted by NehaKrish
Hi there,

I have to automate daily monitoring process and then the result of these process should be sent to a log file, then this log file should be mailed .

ps -ef | grep aa

In this atleast one process should run.
If the process is running it should mention Success in the log file if not mention it as failure.

Please can anyone assit in this.

Thanks In Advance,
Neha.
Code:
process_status=`ps -ef | grep aa | grep -v grep`
if [ $? -eq "0" ]; then
echo "Success" > /tmp/logfile.log
mailx -s "Success - Process Running" abcd@abc.com < /tmp/logfile.log
else
echo "Failed" > /tmp/logfile.log
mailx -s "Failed - Process not Running" abcd@abc.com < /tmp/logfile.log
fi


Last edited by itkamaraj; 04-18-2010 at 03:52 AM..
# 3  
Old 04-20-2010
Quote:
Originally Posted by itkamaraj
Code:
 
process_status=`ps -ef | grep aa | grep -v grep`
if [ $? -eq "0" ]; then
echo "Success" > /tmp/logfile.log
mailx -s "Success - Process Running" abcd@abc.com < /tmp/logfile.log
else
echo "Failed" > /tmp/logfile.log
mailx -s "Failed - Process not Running" abcd@abc.com < /tmp/logfile.log
fi

Thanks!!


I want this mail to be sent daily morning.

Can u plz help in this.

Thanks in Advance,
Neha
# 4  
Old 04-20-2010
Hey Neha,

set up a cron

read about the cron from the below link

Crontab – Quick Reference

thanks
kamaraj
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating an interactive process with EOF string

Hello, I'm running Stockfish chess engine ( Home - Stockfish - Open Source Chess Engine ) CLI on Linux in interactive mode which is working fine. root@ubuntu1950x:~# ./stockfish Stockfish 080218 64 POPCNT by T. Romstad, M. Costalba, J. Kiiski, G. Linscott setoption name Debug Log File... (2 Replies)
Discussion started by: prvnrk
2 Replies

2. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

3. Shell Programming and Scripting

Automating Mail Process

Hi i had written one script,it sends email from terminal and mine script is as: #!/bin/bash SUBJECT="linux mail send attachment example" BODY_FILE="/home/sreenivasa/Desktop/Testing.txt" #ATTACHMENT_FILE="/home/sreenivasa/Desktop/Dataset.zip"... (23 Replies)
Discussion started by: rajnikant
23 Replies

4. Shell Programming and Scripting

Help me with daily monitoring script

find /usr/IBM/FileNet/BulkUploaderScript/$i/Log/SuccessLog \( -newer range_start -a \! -newer range_end \) -exec wc -l {} \; |awk '{total+=$1-1} END {print total}' >>$LOGFILE I need to print time stamp of the files int the paticular period .Please modify the above script so that i get... (34 Replies)
Discussion started by: RaghavendraT
34 Replies

5. UNIX for Dummies Questions & Answers

Automating a process

Could any one tell me , how to start a thread here, i just searching for so long. sorry to post in irrelavent here ---------- Post updated at 08:19 AM ---------- Previous update was at 08:00 AM ---------- Hi, I got a requirement to automate the process. We have SLA files, there are... (1 Reply)
Discussion started by: afahmed
1 Replies

6. Shell Programming and Scripting

Automating The process

Hi Guru's, I am trying to write a scripts that will automate my image provisoining process. Scenario: I have Linux Image Hosted on cloud which needs to be provisoned before it can be used. Currently we log onto the image through the putty on windows and connect to linux instance. I... (3 Replies)
Discussion started by: taqvia
3 Replies

7. Shell Programming and Scripting

Error in script to automate the daily monitoring process of UNIX server and it's proc

hi friends, I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines . 1. i logged in using root ,but it... (8 Replies)
Discussion started by: rdhaprakasam
8 Replies

8. Linux

Automating build and test process

Hey ppl, I've been asked to automate the build and test process for my team at office.we work on Linux and use Perforce for SCM. I've just joined this company and dont have much knowledge on unix scripts. Could someone tell me how to go about doing this?:confused: (8 Replies)
Discussion started by: laxmi
8 Replies

9. Shell Programming and Scripting

Automating build and test process

Hey ppl, I've been asked to automate the build and test process for my team at office.we work on Linux and use Perforce for SCM. I've just joined this company and dont have much knowledge on unix scripts. Could someone tell me how to go about doing this? (0 Replies)
Discussion started by: laxmi
0 Replies

10. Shell Programming and Scripting

process monitoring

hi all, i would like to write the shell script to monitoring the processing, but if i passing the parameter the number of process is incorrect how to slove it? many thx got the correct number of process as following script: ===========================================================... (3 Replies)
Discussion started by: eric_wong_ch
3 Replies
Login or Register to Ask a Question