[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum moderator: shanky, Piyu, Resh  
Identify zombie processes
shankyDate: Tuesday, 2014-05-27, 1:39 PM | Message # 1
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
From: Rajesh Mandadi
Sent: Friday, May 23, 2014 5:28 PM

To: Shankar Kumar Bhagat

Subject: RE: Archiving and compression of files in Linux

Hi Shankar

Read your article, it is nice and helpful. I have one requirement in my project

I have to find the zombie processes, and then alert the info to mail box.

Can you please help me any shell script you have.

Regards,

Rajesh




s.k.bhagat
 
shankyDate: Tuesday, 2014-05-27, 1:49 PM | Message # 2
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
Hi Rajesh

Sure I will help. But just onerequest, if you have any query in Linux, you can raise it to my forum:

http://www.shankysportal.com/forum
 

We can identify the Zombieprocess using its stat as “Z”. So I have written a little script as below

 

#!/usr/bin/ksh

#find the zombie process

ps aux|grep Z

# to get the process id

getPID=$(ps aux|awk '$8=="Z" {print $0}'|tr -s " "":"|cut -d ":" -f 2)

print "The process Id of Zombie process : $getPID";

But it gives only the processId. Now I need more info on requirement from you.

If you want this as alert to urmailbox, it can be done.

Please reply for further help.

 

Regards

Shankar Kumar Bhagat


s.k.bhagat
 
shankyDate: Tuesday, 2014-05-27, 1:49 PM | Message # 3
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
On behalf of user:

Thanks Shankar

Requirement is to find the complete details of zombie process to mailbox. Not only process id.  Like
below one. I need to send below info to mail box. How can i send output of

command to mailbox


[root@s324 /]# ps -el | grep 'Z'

F S   UID   PID  PPID  CPRI  NI ADDR    SZ WCHAN  TTY TIME CMD

1 Z     0  1213  589  0  75   0    - 0 funct> ?        00:00:00 dovecot-auth


s.k.bhagat
 
shankyDate: Tuesday, 2014-05-27, 1:49 PM | Message # 4
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
Hi Rajesh

Try this and let me know:

#!/usr/bin/ksh
#find the zombie process
ps aux|awk '$8=="Z" {print $0}'>zombieMail.txt
# to get the process id
getPID=$(ps aux|awk '$8=="Z" {print $0}'|tr -s " "":"|cut -d ":" -f 2)
print "The process Id of Zombie process : $getPID";
#send this info to a mailbox
 
mail -s 'All zombie process list' [url=mailto:[email protected][color=#0000ff][email protected]<zombieMail.txt[/url]

Regards
Shankar Kumar Bhagat


s.k.bhagat
 
  • Page 1 of 1
  • 1
Search: