Hi,

I thought you wanted the state of a process i.e
Running/Sleeping

You can do this by
STATE = `ps -l | cut -c 4-5`

This is in case of HP-UX.  You might like to refer to
the manual of ps(1) for the exact columnar location of
the state information in other OS's.

Regards,
--Chandan


--- [EMAIL PROTECTED] wrote:

>
> use string comparison in shell... if [ $pid == "" ]
> check for NULL...
>
>
>
> piyu sen <[EMAIL PROTECTED]>
> 11/09/2004 01:52 PM
>
> Please respond to
> [EMAIL PROTECTED]
>
>
> To
> [EMAIL PROTECTED]
> cc
> [EMAIL PROTECTED]
> Subject
> RE: [c-prog] Process iD.   !!!URGENT......!!
>
>
>
>
>
>
> i am giving u what i have done hope u will
> understand then what i want
>
> pid=`ps -ef |awk '/xxxx/ && !/awk/ {print $2}'`
> if [ $pid -eq ???? ]

> so if there is no process called xxxx then it will
> give null for pid value

> Then what should be my value for ???? in my if
> statement
>
>
> [EMAIL PROTECTED] wrote:
>
> $procs=`ps -ef | grep root |awk '{print $8}'`
>
> The $8 gives me the process name (aix)..suit it to
> your OS.
> From $procs compare each entry with your list of
> processes that should be
> running and then for those
> processes for which there is no entry in $procs send
> a alert..
>
>
>
>
> "Raghavan, Rajeev" <[EMAIL PROTECTED]>
> 11/09/2004 01:23 PM
>
> Please respond to
> [EMAIL PROTECTED]
>
>
>
> To
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> cc
>
> Subject
> RE: [c-prog] Process iD.   !!!URGENT......!!
>
>
>
>
>
>
>
>
> ps -ef | grep "processname" | grep -v grep | wc -l
>  
> will give you the number of instances of a
> particular process.
> You need to write a shell script to monitor the
> process instances and then
> send an alert.
> -----Original Message-----
> From: piyu sen [mailto:[EMAIL PROTECTED]
> Sent: 09 November 2004 15:35
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
>
> [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [c-prog] Process iD. !!!URGENT......!!
>
> Yes i have all of them
>
> [EMAIL PROTECTED] wrote:
>
> >>>i want to generate allerts for the process that r
> not running???
>
> So..Do you have a list of processes that should be
> running???
> Only then can you check which processes are running
> and then send alerts
> for those that are not running!
>
> Thanks.
>
>
> piyu sen <[EMAIL PROTECTED]>
> 11/09/2004 12:39 PM
>
> Please respond to
> [EMAIL PROTECTED]
>
>
>
> To
> [EMAIL PROTECTED], [EMAIL PROTECTED],
> [EMAIL PROTECTED]
> cc
>
> Subject
> Re: [c-prog] Process iD.   !!!URGENT......!!
>
>
>
>
>
>
>
>
>
>
> i want to generate allerts for the process that r
> not running
>
> Mahesh Menase <[EMAIL PROTECTED]> wrote:
> if process id is 0 then ...........

> :) ......... go Home.
>
> piyu sen <[EMAIL PROTECTED]> wrote:
> ok
> if the process id is 0 then
>
> Satya Prasad <[EMAIL PROTECTED]> wrote:
>
> I would like to help you ... but how can a
> terminated
> process have a process Id.
>
> Regards,
> Satya Prakash Prasad.
>
> --- piyu sen <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > Can ne 1 tel me what will b the Process id for a
> > process that have been normaly terminated or
> > terminated by fource..
> > I need to send sms allert for the process that r
> not
> > running.
> > Plz help me.
> > U can call me in this number or give ur number so
> > that i can talk to u in this regard
> > 9811425054.
> > Thanks
> > Regards Piyu
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> >  Check out the new Yahoo! Front Page.
> www.yahoo.com
>
>
>

> __________________________________
> Do you Yahoo!?
> Check out the new Yahoo! Front Page.
> www.yahoo.com
>
>
>
>
> To unsubscribe, send a blank message to <
> mailto:[EMAIL PROTECTED]>.
>
>
>
>
> Piyu Sen
> Software Engineer.
> SSL. Bangalore.
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
=== message truncated ===



           
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com




To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=:HM/A=2376776/rand=239249356


Yahoo! Groups Links

Reply via email to