Script to monitor a process and track status in a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to monitor a process and track status in a file
# 1  
Old 05-19-2011
Error Script to monitor a process and track status in a file

i have a scenario where i need a script that monitors a process "Monitor" based on process id... there can be any number of instances of this running... i start this across 4 servers in NFS. Now i need a file which has the process ids of the process that are currently in execution at any instant,this script must also remove an entry of a process as an when that process completes.
# 2  
Old 05-19-2011
What are things you want to monitor ? Is it only the status that process running or not or anything else.
# 3  
Old 05-19-2011
status and memory utilization.....
# 4  
Old 05-19-2011
First you need to capture the PID when every the process-to-be-monitored is started. This can be done either using a startup script to start the process and add the PID in to a file or directly from your process to write its own PID.

Once this is captured you can write shell script that periodically checks for the status of the processes and their memory utilization. say every 1 mins or 2 mins. If the PID exists but for a different process then remove the PID.

Note this idea has to refined to your needs.
# 5  
Old 05-19-2011
i could do till adding of process ids....the problem is deletion should happen after monitoring across NFS connected servers where im not able to proceed....
# 6  
Old 05-19-2011
I don't understand the point "NFS connected servers". Is it like NFS clients that are running the processes and you want NFS server to monitor the process status.
# 7  
Old 05-19-2011
just to say that all servers share file system thats it....i tried with ssh but its taking a long time to update...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Some trace file to track timings of a process

I will initiate a process from Server1 and the flow is as follow Server1 --> Web server --> Application server --> DB Server Note all seperate unix servers. Now I need to put a trace for that process to track the timings from each server. Like the below trace should be there: ... (5 Replies)
Discussion started by: saraperu
5 Replies

2. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies

3. Shell Programming and Scripting

Script to monitor the process

Hi, I need help to monitoring a process using the shell script The same output is below oracle 32578 32577 0 Feb27 ? 00:06:47 java -cp .:lib/ant.jar:lib/ojdbc5.jar:lib/log4j-1.2.17.jar:/ORACLE_HOME/server/lib/wlfullclient.jar:/ORACLE _HOME/server/lib/weblogic.jar:Alerts.jar... (9 Replies)
Discussion started by: ajothi
9 Replies

4. Shell Programming and Scripting

Script to Monitor windows process

Hi Guys, I'm looking for a script( preferably perl script) which should monitor a application service and alert me when it goes down. application is installed in windows NT. Scenario: I have remedy ARS 6.1 installed in windows platform and need some script to monitor its service and alert me... (2 Replies)
Discussion started by: user__user3110
2 Replies

5. Shell Programming and Scripting

Script to Monitor a Process with Top.

Hi, I have written a script to monitor a Process with the help of top command. This is my script. ====================== #!/bin/sh DATE=`date +%Y%m%d%H%M%S` HOME=/home/xmp/testing/xmp_report RADIUS_PID=`xms -xmp sh pr | grep "RADIUS.iamsp02ldv" |awk '{ print $3 }'` PSE_PID=`xms -xmp sh... (5 Replies)
Discussion started by: Siddheshk
5 Replies

6. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

7. Shell Programming and Scripting

how to track a log file of one process and mail that logfile to a group?

Hi Friendz, I have 14 DB load scripts say 1,2,3....14. I want a script to call each script automatically, and after completion of every script, it needs to track the logfile and mail that log file to a group.and again it should run the next script in sequence 1,2,3...14 Please help me,need... (1 Reply)
Discussion started by: shirdi
1 Replies

8. Shell Programming and Scripting

How to track and later kill a process in a script

Hello, I am trying to write a script that turns off the screensaver for a certain period of time, then come back on. I have had it up and running for a while, but then I decided to refactor it a bit for my family members that are less computer savvy. I am starting a subshell for the "meat" of... (4 Replies)
Discussion started by: Narnie
4 Replies

9. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

10. Shell Programming and Scripting

How to track exit status of ftp automation

ftp automation code is ftp -v -n -i $host_name << EOF user $u_name $u_pass bi mput $tar_file bye EOF How to check whether the file is successfully transfered or not. Suppose the user name or password is provided wrongly then the code should track the error and ask the end user to enter... (2 Replies)
Discussion started by: Dip
2 Replies
Login or Register to Ask a Question